Files
website/README.md
T

2.7 KiB

old-computers.com — static site

Static rebuild of old-computers.com with Hugo (0.158 or newer, tested with 0.167). The content is recovered from the Wayback Machine by the extraction repository (../oc), which generates part of this one.

Path Origin
content/{museum,machine-tabs,companies,software,history,magazine,fun}/ generated, replaced on every make content
static/media/ generated (copied images and documents)
data/slugs.json generated, keeps URLs stable between runs — do not delete
content/post/ written by hand: news posts, see below
content/_index.md, layouts/, assets/, hugo.toml, tools/ written by hand
build/, public/ build output (make build, hugo server), not versioned

Content pages are Markdown with YAML front matter and can be corrected by hand, but a later make content overwrites them: lasting fixes belong in the extraction repository.

Posts

make post NAME=my-title

creates content/post/<today>-my-title.md (any .md file in content/post/ is a post). The date comes from the file name unless date: is set; author: is optional; the name links to /author/<name>/, which lists all posts by that author. For a banner, put an image under static/media/ and set banner: /media/....jpg (image: works too). Write the text in Markdown and remove draft: true to publish. The most recent posts (homePosts in hugo.toml, 5 by default) appear on the home page with their banner, date, author and summary (summary: in the front matter, or the text before <!--more-->, or the first lines); all posts are listed under News and on each author's page, listPosts per page (20 by default). Posts are never touched by make content.

Search runs in the visitor's browser on an index generated by Pagefind at the end of make build (fetched by npx, so Node.js is needed to build). The header box sends to /search/, where results can be filtered by section. Content pages are indexed (data-pagefind-body on <main> in layouts/baseof.html); lists, taxonomy pages and the visitor-comments tabs are not. hugo server has no index: use make build and serve build/ to try the search locally.

Usage

make content   # regenerate from ../oc (OC=path to use another location)
make build     # build into build/, with the search index
make check     # build + verify every internal link and image
make serve     # preview on http://localhost:1313
make deploy    # build and copy to the test server (share must be mounted; see DEPLOY_DIR/DEPLOY_URL)

The site uses relative URLs, so public/ can be served from any directory of a web server.