<feed xmlns='http://www.w3.org/2005/Atom'>
<title>dotemacs/tests/test-hugo-config--post-metadata.el, branch main</title>
<subtitle>My Emacs configuration
</subtitle>
<id>https://git.cjennings.net/dotemacs/atom?h=main</id>
<link rel='self' href='https://git.cjennings.net/dotemacs/atom?h=main'/>
<link rel='alternate' type='text/html' href='https://git.cjennings.net/dotemacs/'/>
<updated>2026-04-22T11:57:00+00:00</updated>
<entry>
<title>feat(hugo): draft picker, preview toggle, publish command</title>
<updated>2026-04-22T11:57:00+00:00</updated>
<author>
<name>Craig Jennings</name>
<email>c@cjennings.net</email>
</author>
<published>2026-04-22T11:57:00+00:00</published>
<link rel='alternate' type='text/html' href='https://git.cjennings.net/dotemacs/commit/?id=96c73033bbd759054d394172dfad6971816c3dc3'/>
<id>urn:sha1:96c73033bbd759054d394172dfad6971816c3dc3</id>
<content type='text'>
Put the full Hugo workflow inside Emacs. All of it lives in modules/hugo-config.el.

New functions:
- cj/hugo-open-draft reads all .org files under content-org/log, finds those with #+hugo_draft: true, and offers a completing-read picker.
- cj/hugo-preview toggles a local hugo server subprocess and opens the preview URL in the browser. A second press stops the server.
- cj/hugo-publish opens magit-status on the website repo. The server-side post-receive hook on cjennings.net already rebuilds and deploys on push, so committing and pushing is the deploy.

Two pure helpers support the picker: cj/hugo--post-metadata parses the front matter region of a post, and cj/hugo--collect-drafts walks a directory and filters to drafts. Seven ERT tests cover both helpers across normal, boundary, and error cases.

Keybinding note: C-; h d and C-; h D have swapped roles. Lowercase d now opens the draft picker. Uppercase D toggles the draft flag in the current buffer. The previous lowercase-d binding was toggle.
</content>
</entry>
</feed>
