Repository navigation
Writing a post
The short version. The complete guide, with every front matter field, is docs/writing-a-post.md; this page does not repeat its tables.
-
Propose it. Open an issue with the "Post proposal" template: topic, who it is for and what the reader will learn.
-
Create it. From the repository root:
hugo new content posts/my-post-title
Lowercase words joined by hyphens: the folder name becomes the slug and the address (
/posts/my-post-title/). Hugo builds a page bundle fromarchetypes/posts/index.md: a folder holdingindex.md, with room for the images beside it. The new post is a draft and does not syndicate. -
Write it. The file starts with front matter, then the opening paragraph, then the line
<!--more-->. Everything above that line is the summary, so write the opening paragraph to stand on its own. -
Fill in the front matter. The fields a reader of the repository meets first:
Field Why title,date,slugThe headline, the publication date and the address. descriptionOne or two plain sentences. It becomes the page description, the social card text and the announcement text. Each page needs its own; the output check refuses duplicates. categories,tagsOne broad category, a few specific tags. Reuse existing ones first. Tags show as #taglinks and feed Search and tags.drafttruekeeps the page out of the production build. Setfalseto publish.syndicateA flag for a later announcement step; no workflow in this repository announces posts today, and the flag does not change the feed. Leave falsewhile writing.image,imageAltThe optional headline image. See Headline images. aliasesOld addresses that redirect here. New posts rarely need one. -
Add images beside
index.mdwith real alt text. See Images and alt text. -
Preview with
hugo server --buildDrafts. -
Publish: set
draft: false, build, and run the checks below. -
Open a pull request that links the issue. The maintainer merges when
CI greenpasses.
hugo --minify --gc
EXPECT_ENV=production scripts/check-output.sh public
scripts/check-wording.sh
scripts/test-archetype.shscripts/test-archetype.sh proves that a post made from the archetype builds and
passes the output checks and that a missing alt text fails the build.
- No embeds and no outside images. The Content Security Policy allows only the site's own files, and raw HTML in Markdown is off. Link to a video or a post instead of embedding it.
-
Affiliate links need
affiliate: true, a plain statement near the first link and, for Amazon links, the line "As an Amazon Associate I earn from qualifying purchases." once in the body. -
House wording. Write "cryptocurrency" or the coin name, never the short
form; write "cryptography" for the math. Use American English, short
sentences and no em dashes.
scripts/check-wording.shenforces the first rule. -
Private data. Never put a real callsign, grid square, employer, internal
hostname, serial number, token or exact location in a post, image or commit.
Use placeholders:
N0CALL,N0TST,FN31pr,host.example,192.0.2.1.
For work notes rather than articles, see Journal entries.