fd3cd4c18c413aa753f8194af85bf6680032a230
2
Commits
| Author | SHA1 | Message | Date | |
|---|---|---|---|---|
|
|
3e0694e6e0 |
Widen the prettier gate to markdown and CSS everywhere (closes #12)
check / check (push) Successful in 59s
REPO_POLICIES.md scopes prettier to JS/CSS/Markdown/HTML, but script/fmt
and script/fmt-check covered only '*.md' - top-level markdown. The
canonical scripts use '**/*.md'. Both now run over '**/*.md' and
'**/*.css', and both header comments, which still described the old
top-level-only scope, were rewritten.
That brings themes/loravega/static/css/style.css into the gate. It is
inlined into every page by baseof.html via readFile, and its formatting
is whitespace-only: the minified <style> block in the built
public/index.html is byte-identical across the reformat, which is the
preceding commit.
Two paths are excluded, each with the reason recorded in
.prettierignore so the exclusion reads as a decision rather than an
oversight:
themes/loravega/layouts/ - these are not HTML. They are Go templates
carrying {{ define }}, {{ block }}, {{ .Content }} and
{{ readFile ... | safeCSS }}, and prettier has no Go-template parser; it
would fail or reflow the delimiters into markup Hugo cannot parse.
Covering them needs an out-of-tree plugin and therefore a package.json,
which this repo deliberately does not have.
content/ - excluded on measurement, not on the earlier assumption. With
content/ in scope, prettier re-wrapped one list item in
content/_index.md, and the rendered public/index.html changed with it:
the wrap landed as a literal newline between "7 PM at" and the following
<a> tag. HTML collapses that newline to a space, so the page looks the
same, but the published bytes do not match, and this content carries raw
div/span/br blocks that goldmark passes through verbatim because
hugo.toml sets markup.goldmark.renderer.unsafe = true. A formatter that
can silently change a published page is not worth the consistency.
archetypes/ stays covered - it is a template for new content, not
published output, and prettier leaves it unchanged.
Verified by extracting public/ from the built image before and after.
With the final scope, index.html, index.xml and sitemap.xml are
byte-identical; only the verbatim-copied public/css/style.css differs,
in whitespace. Each commit on this branch passes make check on its own -
the reformat lands first, under the old narrow glob that does not look
at CSS, so the widening commit arrives on an already-clean tree and no
merge commit is required to land it.
|
||
|
|
90f188c256 |
Add canonical policy dotfiles, harden both ignore files (closes #8)
REPO_POLICIES.md lists the files every repo must contain at minimum; four were missing here and .gitignore covered only Hugo's outputs. REPO_POLICIES.md is a byte-identical copy of the canonical file in the prompts repo, YAML front matter (title, last_modified) intact so it can be diffed against upstream as policy evolves. It is not clean under this repo's prettier settings, so the reformat is the next commit rather than churn mixed in here; the byte-identical copy is what landed. .editorconfig, .prettierrc and .prettierignore are the canonical contents. script/fmt and script/fmt-check keep passing --tab-width 4 --prose-wrap always on the command line: the duplication is deliberate so the scripts still work standalone when copied as a template, and the values agree, so adding .prettierrc changes nothing about what make fmt does. .gitignore keeps its three Hugo lines and gains the canonical OS/editor/node/secrets block plus .claude/. The secrets patterns are the point: a stray .env or private key can no longer be committed by a broad git add. .claude/ holds worktrees/, so without it a clean checkout with agent tooling present is not git status-clean. .dockerignore gains the same coverage but not the same syntax. It does not use .gitignore semantics: it matches with Go's filepath.Match rules extended with **, where * does not cross / and an unprefixed pattern is anchored at the context root. A bare *.key therefore excludes ./server.key and ships ./certs/server.key into the image, which is worse than an obviously incomplete file because it reads as complete. Every depth-independent pattern here carries an explicit **/ prefix; only the entries that are genuinely root-anchored by definition go bare - .git, Hugo's public and resources output directories, and .hugo_build.lock. The distinction is spelled out in a comment at the top of the file so the next edit does not quietly undo it. Excluding .claude/ also keeps entire additional checkouts of this repo out of the build context, which the Dockerfile's COPY . . would otherwise copy into the image. Verified by planting .env, server.key, deep.pem and node_modules two directories deep and building: with the patterns unprefixed all of them reach /src in the image, with **/ none do. Root-only testing does not exercise this and produces a false pass. |