<feed xmlns='http://www.w3.org/2005/Atom'>
<title>dotemacs/tests/test-hugo-config-commands.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-05-25T22:51:17+00:00</updated>
<entry>
<title>fix(org): guard external-tool assumptions in export and publishing commands</title>
<updated>2026-05-25T22:51:17+00:00</updated>
<author>
<name>Craig Jennings</name>
<email>c@cjennings.net</email>
</author>
<published>2026-05-25T22:51:17+00:00</published>
<link rel='alternate' type='text/html' href='https://git.cjennings.net/dotemacs/commit/?id=d665582d6fc19c15a772c6ec24ff822e7e3c37f9'/>
<id>urn:sha1:d665582d6fc19c15a772c6ec24ff822e7e3c37f9</id>
<content type='text'>
Four export/publishing commands shelled out to external tools without checking they exist, so a missing tool surfaced as an opaque process error — or, for reveal.js, a silently broken presentation. I added a command-time guard to each that names the tool and what's needed:

- zathura, in the pandoc PDF export-and-open command
- the hugo binary and the platform file-manager opener, in hugo-config
- the local reveal.js checkout (run scripts/setup-reveal.sh), shared by the reveal export and preview commands
- pandoc, in the web-clip protocol handler

The checks run only when the command runs, so startup stays quiet. Each guard has a test asserting the user-error fires when the tool is absent, and the existing happy-path tests now stub the lookups so they exercise the real path rather than tripping the new guard.
</content>
</entry>
<entry>
<title>test(hugo-config): cover new-post, export, navigation, preview, publish</title>
<updated>2026-05-14T06:30:33+00:00</updated>
<author>
<name>Craig Jennings</name>
<email>c@cjennings.net</email>
</author>
<published>2026-05-14T06:30:33+00:00</published>
<link rel='alternate' type='text/html' href='https://git.cjennings.net/dotemacs/commit/?id=54f54840686b29d510b360caeb43d254aec09ffe'/>
<id>urn:sha1:54f54840686b29d510b360caeb43d254aec09ffe</id>
<content type='text'>
Sibling tests covered the pure helpers (`cj/hugo--post-file-path`, `cj/hugo--post-template`, `cj/hugo--post-metadata`, `cj/hugo--collect-drafts`, `cj/hugo-open-blog-dir-external`, `cj/hugo-toggle-draft`). This batch covers the remaining commands and preview helpers:

- `cj/hugo-new-post`: writes the template to a slugged file, errors when one already exists.
- `cj/hugo-export-post`: errors outside org-mode, delegates to `org-hugo-export-to-md` otherwise.
- `cj/hugo-open-blog-dir`: ensures the dir exists and opens dired on it.
- `cj/hugo-open-draft`: messages when no drafts, otherwise picks via `completing-read` and opens.
- `cj/hugo--preview-filter`: opens the browser when Hugo prints "Web Server is available", ignores arbitrary output.
- `cj/hugo--preview-sentinel`: clears the process var on clean exit, messages on a non-zero exit.
- `cj/hugo-preview`: stops a running server, starts one when stopped (verifying `start-process` got the "server" arg).
- `cj/hugo-publish`: hands off to `magit-status-setup-buffer` on `website-dir`.

ox-hugo's `org-hugo-slug` is stubbed via `defun` (the package isn't installed in batch); `require`, `org-hugo-export-to-md`, `dired`, `find-file`, `browse-url`, `start-process`, `kill-process`, and `magit-status-setup-buffer` are stubbed per-test.
</content>
</entry>
</feed>
