Blog Workflow
It is universal truth (probably) that all personal blogs are ~70% "automated" with a mish mash of command line tools trying to simulate a CMS. My blog is no different, and like everyone else, I think it is a brilliant and elegant process. My blog is built with `svelte.js` and I generally write posts in html directly in a `Post` component.
I use `hygen` templating to automate boring and repeatable file creation and manipulation tasks.
For example if I want to create a new blog post, I invoke hygen as shown below and it will create a new post page and inject a hyperlink to itself on my home page.
$ hygen blogpost new
$ Loaded templates: _templates
inject: src/routes/(main)/+page.svelte
added: src/routes/(simple)/posts/blog-workflow/+page.svelte
---
to: src/routes/(simple)/posts/<%=name%>/+page.svelte
---
// page html
---
inject: true
to: src/routes/(main)/+page.svelte
after: <div id="listings" class="pt-4 pb-8">
---
<Listing
slug="posts/<%=name%>"
title="<%=name%>"
description=""
/>-%>
---
inject: true
to: ../src/routes/(simple)/status/+page.svelte
after: </header>
---
<Status
title="<%=title%>"
status="<%=emote%>"
date="<%= h.currentDate() %>"
time="<%= h.currentTime() %>"
city="Tokyo, Japan"
note="<%=update%>"
/>