Releases and downloads
A release page tells readers what shipped and lets them download it safely: a
card linking the GitHub release and its source archives, a table of files with
their checksums, and install instructions for each way of getting the
software. OINK builds all of it from facts kept in your repository (one
release_url in the page’s front matter, the sha256sum output you paste
into the body, and a data/download/<key>.yaml record), so the build never
contacts GitHub.
This page’s own front matter sets release_url to OINK v0.4.0, so the card,
asset tables and download block below are live output. The checksums and
asset filenames are made up, and the download links they produce point at
files that do not exist. Do not verify anything against these hashes.
What a release page is made of
| What you want | What renders it | Where the facts come from |
|---|---|---|
| A summary card with tag, date, source archives and repository | release-card |
The page’s release_url |
| A table of assets with checksums | The checksums fence, or release-assets |
sha*sum lines in the page body |
| Install instructions for several channels | download |
data/download/<key>.yaml |
| A chronological index of releases | layout: releases |
Each page’s release_url, or its title |
Link the release
A release page names its GitHub release with one front matter key, the release URL for an exact tag:
The owner, project and tag come from the URL, and the date from the page’s own
date. A value that is not an exact-tag GitHub release URL warns and the
release block is skipped. Pages written for OINK 0.5 (the release map,
release_products, release_group_by_product) get a warning naming the
replacement; see the 0.6.0 release notes.
Put the card where you want the summary. The shortcode takes no parameters, because every fact comes from the front matter:
The card carries four links derived from the URL: the release itself, the
.tar.gz and .zip source archives, and the repository. It does not list
checksum files, which belong in the asset table below, or compare the release
with the previous one, which GitHub already does on the release page.
Checksums and assets
Paste the output of sha256sum (or any sha*sum command) into a checksums
fence, and the page gets a download table with each file linked and its hash
ready to copy:
| File | Checksum | |
|---|---|---|
| oink-0.4.0-linux-amd64.tar.gz Linuxamd64SHA-256 | 1e2f4c8a…e7c4 |
|
| oink-0.4.0-darwin-arm64.tar.gz macOSarm64SHA-256 | 7b3d9e0c…8250 |
Each line must be either <hex><two spaces><filename> or
<hex><space>*<filename>, exactly as the tools print it; blank lines and lines
starting with # are ignored. The hash length identifies the algorithm (MD5,
SHA-1, SHA-256 or SHA-512), and one block holds one algorithm. A filename must
be a single path segment, and package type, operating system and architecture
badges are added when the filename makes them recognizable. A malformed line, or
one whose algorithm differs from the rest of the block, warns with its line
number and is skipped, so a single typo costs one row rather than the table.
On a page with release_url, asset links point at
https://github.com/<owner>/<repo>/releases/download/<tag>/. On a page without
one, set base= to wherever the files are hosted. Setting both, or neither,
warns and skips the block, because a guessed base would publish links to the
wrong files:
algo= pins the algorithm instead of inferring it, and group="auto" groups
rows by platform and architecture.
release-assets is the shortcode form of the same table. It adds one
parameter the fence lacks, src=, which reads the checksum file itself from a
page resource or global asset instead of inline lines; use either src or
inline lines, not both.
.rpm
| File | Checksum | |
|---|---|---|
| oink-0.4.0-1.el9.x86_64.rpm Linuxamd64SHA-256 | 5a0c7d1e…7db6 |
|
| oink-0.4.0-1.el9.aarch64.rpm Linuxarm64SHA-256 | c93f16a8…0ea8 |
The HTML table shortens each hash for display, while screen readers and the copy button get the full value; the copy button’s script loads only on pages that have a table. Without JavaScript the table is still complete and linked. Print and RSS show the full hashes without controls, and the page’s Markdown output is a pipe table of full hashes.
Download block
Install instructions belong to the product rather than to one release: the
install script, the source archive and the package repository stay the same
from version to version. Keep them in one data record and render it with
download, whose only parameter is the record’s key, the file name under
data/download/ without .yaml:
Install script
The rolling channel deliberately contains no version interpolation.
Source archive
Release assets
| File | Checksum | |
|---|---|---|
| oink-0.4.0.tar.gz SHA-256 | aaaaaaaa…aaaa |
The block opens with a row of links to each channel, followed by one section
per channel. Code steps use the enhanced code block and its copy button, and a
channel with checksums renders the same asset table as above. Print shows the
same content expanded, the Markdown output keeps the titles, code fences and
full hashes, and RSS leaves the block out. A landing page’s download section
reads the same record, so the home page and the docs never disagree about the
current version; see Home and landing pages.
Release workflow
A release note and the download data do different jobs. The release note,
written as a blog post, tells readers what
changed, how to upgrade and what breaks; it carries release_url and can open
with a release-card. The download data tells them which channel to use,
which command to run and which hash to check, and it changes in one place when
the version does.
Publish a new version in this order, so that no page ever links to a file that is not there yet:
- In
data/download/<key>.yaml, setversionto the new version andpublished: false. Rolling channels keep working, while pinned channels show a “pending release” state with their commands omitted and their asset links and copy buttons disabled. - Write the release note, for example
content/blog/release/0.4.0.md, with itsrelease_url. - Create the tag and upload the assets, then set
published: true. Do not write a guessed download link into the prose in the meantime.
The release index page
A section of release notes can list them as a strict chronology instead of a blog index:
Every regular page in the section is listed newest first by date; when two
pages share a date, the version in their tags breaks the tie, by SemVer
precedence with a deterministic fallback for tags that are not SemVer. An entry
whose release_url parses reads project tag, such as oink v0.4.0, above
the page description. A page without one keeps its own title, so an ordinary
note between releases is a normal entry rather than an error.
When you would rather keep the blog shell, blog_index: table gives a compact
date-ordered archive instead; this site’s release notes use it.
Download data format
This site’s real record is data/download/prd5.yaml, the one rendered above:
A record takes the five top-level fields below; any other key warns and the whole block is skipped.
Each channel:
Two rules govern the text fields:
- Localized fields resolve by suffix, from
<field>_<exact language>to<field>_<base language>to<field>. Azh-cnpage triestitle_zh_cn, thentitle_zh, thentitle. camelCase variants are not accepted. - Only a pinned channel’s
urlandsteps[].codeinterpolate${version}and${tag}. A rolling channel refuses interpolation, so a command meant to install the latest release is never silently tied to one version. Titles and notes never interpolate.
Verify
-
Build with diagnostics visible:
hugo --printPathWarnings. A malformed hash line, mixed algorithms, a missingbaseand a misspelled channel field each produce a warning; read them, because each one means a row, a table or a channel is missing from the page. -
On the page, check that the card’s tag and date match the repository and that every asset row opens a real download.
-
Check each hash against the real artifact yourself. The table only displays the hashes you paste; it verifies nothing.
-
Confirm the Markdown output carries the full hashes:
-
Try the page with
published: falsefirst, and switch totrueonly once the tag and assets exist. Check every language, and a subpath deployment if you use one.
Related
- Blog posts — where release notes live and how they are ordered
- Code Blocks — code rendering and copying inside download steps
- Home and landing pages — the landing
downloadsection - Configuration —
params.versionand the related site parameters - Upgrade — how a site keeps up with new OINK versions