just a website, yo
- CSS 51.7%
- Emacs Lisp 18.6%
- Just 12.4%
- Shell 10.8%
- Nix 5.1%
- Other 1.4%
| Filename | Latest commit message | Latest commit date |
|---|---|---|
The recipe ran `emacs -q --script new-post.el`, which only DEFINES
create-new-post: emacs loaded a function, threw it away and exited 0. The command
had been doing nothing at all, quietly.
It now writes content/posts/<slug>.org with the header every post carries
(DESCRIPTION, HTML_HEAD_EXTRA with a background pattern, TITLE) and adds the
home-page link. The link is the reason the script exists: content/index.org
lists posts BY HAND, so a file dropped into content/posts/ publishes perfectly
and is reachable from nothing. Scaffolding that ships an unreachable post is
worse than no scaffolding, so the link is not optional -- and because a half
scaffold is the same bug wearing a hat, the index edit is computed BEFORE any
file is written and the post is deleted if the write afterwards fails.
The CLI is `just new-post [flags] "the title"` (--journal, --description,
--pattern, --force), with the title as whatever is left over so a quoted phrase
and bare words mean the same. M-x create-new-post still prompts.
What was wrong, all of it found by running it rather than by reading it:
- the slug replaced ONE whitespace character at a time, so "hello world!"
became hello--world!.org. Now: downcase, every run of non-alphanumerics to a
single -, ends trimmed. The trims are explicit regexps because
(string-trim "abc-" "-") does not trim a hyphen.
- the journal link used the stem instead of the dated filename, so every
journal entry was linked to a file that does not exist.
- pattern urls were built as "/static/" + the name relative to static/patterns,
which gives /static/128/clouds1.jpg -- a 404 background on every new post.
`just check' would have refused to publish it, which is the only reason this
is a bug report and not an incident.
- `^\#+END_EXPORT` matches nothing: \# is not a literal hash in an Emacs
regexp. Both export markers now go through regexp-quote.
- an unescaped " inside a docstring closes the docstring early and the rest of
the line is read as code, which turned a "/static/" in a comment into
(void-variable /static/) at runtime.
- the list search was unbounded, so an empty journal would have taken its new
entry from the literature list's position. It is bounded by the next
#+BEGIN_EXPORT now.
Getting arguments from just to emacs without the shell eating them took a pass of
its own. The recipe line goes through bash, so a bare title would have had its &,
;, parentheses and apostrophes interpreted -- and "ripping & processing vinyl" is
a real title on this site, whose & backgrounds the emacs. There is no per-element
escaping in just 1.58 (no ^args, and quote() on a list quotes the whole joined
list), so the recipe passes ONE shell-quoted lump and `haze--tokens' splits it
back, which is why flags go last and why a flag's value runs to the next flag.
--help could not be handled in the script either: emacs' startup eats --help
before the script file loads, so the recipe answers it and forwards --usage.
Also `just lint`, which byte-compiles build-site.el and new-post.el and fails on
ANY compiler output. That is the only check these two files get, and the
docstring bug above is exactly the class it catches -- the compiler says
"probable '\"' without '\'' in doc string", as a warning, exit 0, so empty output
is the gate. Verified by planting the bug and watching it refuse. build-site.el's
two warnings are fixed here so the gate can be strict from the start; neither
changes the build (the navbar still renders, 173 files still pass the gate).
|
||
| .buildkite | ||
| .firebase | ||
| assets | ||
| content | ||
| nix | ||
| scripts | ||
| static | ||
| .editorconfig | ||
| .envrc | ||
| .firebaserc | ||
| .gitignore | ||
| build-site.el | ||
| firebase.json | ||
| flake.lock | ||
| flake.nix | ||
| haze8831.aseprite | ||
| home-head.html | ||
| justfile | ||
| literature-head.html | ||
| misc-head.html | ||
| new-post.el | ||
| PAGESPEED-GAMEPLAN.md | ||
| post-head.html | ||
| test.html | ||