Technical reference
Build a zero-JS static article site from hand-written HTML fragments.
smartpress builds a single-page or multi-page static site from
articles/slug/article.html files. Run make build
to generate site/, then serve it as static files or open
site/index.html through file://.
The build targets POSIX.1-2017 shell and utilities for portability across BSD, Linux, macOS, and other Unix-like systems. The generated interface uses HTML and CSS only; it requires no client-side scripting or server-side processing.
sh, make, and utilities;
BSD and GNU make are supported.awk, sed, grep,
sort, tr, date, dirname,
pwd, printf, mkdir, rm,
wc, cat, cksum, chmod,
mv, cp, and find.cmp and pax with ustar output.
Some systems require installing pax separately.pygmentize (Pygments, default) or
GNU source-highlight.sha256, sha256sum,
shasum, or openssl; the first successful one is used.:has(), :target,
prefers-color-scheme, native details/summary,
and HTML popovers. CSS random() is optional.Makefile.PUBLIC_SITE_ENV in the Makefile for the site's
identity, appearance, and feed settings. Set its own SITE_URL
and SITE_AUTHOR, or disable SITE_FEED.articles/.make build. Open site/index.html to preview,
or deploy the contents of site/ to the web root.build copies all article directories and renders the site
in staging before replacing site/.assets/ to site/assets/.
It contains the shared SVG and Roboto fonts. The smartpress article is
optional for make build and make smarts, and
required for make release and make full.site/. Run builds from the
source root, never from the generated tree.site/; run one target at a time, without
parallel builds. Keep the Makefile's FORCE target name free
of files.For generator release packaging, see MAINTENANCE.
Create articles/slug/article.html with this structure:
article tag on one line. Its class list
must include article; id must match the directory
name; data-title supplies the index title.h1, an optional kicker, and
p class="summary". The summary may span lines and contain
inline HTML.script tag on one line. Script bodies, including
inline JSON, are copied verbatim.data-listed: true (default) or
false; see Unlisted articles under CONFIGURATION.data-feed-sections: none (default),
h1, h2, or h3; see ATOM FEED.h2 sections and h3 subsections. Use one heading
per line, with plain text and its closing tag on that line. An h3 follows an h2.index is reserved for the homepage
in every combination of upper- and lowercase letters.#article-id or #heading-id.
Multi-page links use slug.html#heading-id, or
slug#heading-id with extensionless URLs.
Article, h2, and h3 attributes accept
auto or a value beginning with a valid YYYY-MM-DD
date. Metadata, date sorting, and feed timestamps use the date portion.
auto: current UTC build date.auto: UTC build date.data-modified takes precedence over data-created.
auto uses the UTC build date. An undated h2
inherits the article's resolved modification date; an undated
h3 contributes no date. A newer child h3 date
updates its parent section's effective date.data-src values are relative to the article directory. Path
components use ASCII letters, digits, dots, underscores, and hyphens;
empty components, ., .., and symlinks are rejected.data-title overrides the displayed source path;
data-note adds a header qualifier.data-lang: explicit lexer, or omit for filename inference.
Pygments auto also permits content guessing.data-open="false": initially collapsed; default is open.data-header="false": always visible, without a header.data-footer="true" or "false": override
automatic footer selection. Normally shown above
CODE_FOOTER_LINES; headerless blocks require explicit
true.
HIGHLIGHTER selects pygments (default),
source-highlight, or none:
none always uses escaped source.tools/html-fragment.outlang; an
omitted or auto language enables its language inference.span.w and Source-highlight
span.sh-normal wrappers are removed without removing whitespace.data-src file per marker.data-title changes the label, not the download path.A file creates a single image; a directory creates a gallery. Both use the same size, alignment, frame, header, and footer options.
false
collapses the block or removes its header.false. Headerless images
require explicit true.small (20rem), medium (32rem),
large (48rem), or full (default).
Caps image/gallery width within available space; frame padding is additional.full (default): full-width frame.
fit: frame fitted to the image or gallery, with equal-width
header and footer. none: no frame, padding, header, or footer;
the block retains an opaque article-background surface.start, center (default), or end.
Aligns the image inside a full frame, or the entire fit/borderless block.section,
before the text that should flow beside it.data-border="fit" or "none" with
data-align="start" or "end".Set data-src to a file in the article directory or a link
to one YouTube video. Give the player a descriptive data-title.
Readers press Play to watch the video in the article.
youtu.be, Shorts, live or embed link.
Links with a timestamp still play from the beginning. Preview over HTTP or HTTPS.
Use Watch on YouTube if embedding is unavailable.For size, alignment and framing, see
Image blocks.
Videos also accept data-caption, data-note,
data-open, data-header and data-footer.
Edit Makefile defaults or override individual values with make NAME=value build.
PUBLIC_SITE_ENV: site defaults for build and full.RELEASE_SITE_ENV: site defaults for release.BUILD_ENV: shared defaults.true or false.smartstechnical; release smartpress.single-page (default): all generated articles in
index.html. multi-page: one article per
slug.html, plus index.html containing the first
listed article. Each page embeds its navigation rules and shares the CSS.html: page links retain .html.
extensionless: multi-page navigation and contact actions
use slug and ./; files retain .html.
Requires a server rewrite. Single-page output is unaffected.
Default: public extensionless; release html.title (default), created,
or modified. Title sorting is case-insensitive; date sorting
is newest first. Ties use the slug. Visitors can switch order with the
index controls; sections and subsections retain source order.slug.html titles use article title followed by
SITE_TITLE; the index page uses SITE_TITLE.index. Extensionless slugs also
cannot contain dots or collide with a path at the site root.HIGHLIGHTER=none
for large code-heavy collections.
Mark an article data-listed="false".
SITE_MODE_UNLISTED=true generates it; false
excludes it from generated pages and navigation. Default: public
true; release false.
noindex, nofollow.site/articles/, even when unlisted generation is disabled.tools/theme-menu.html, with or without
theme-. Default: public everforest-hard-dark;
release solarized-dark.off: no mode control; use the selected theme unchanged.
exact, auto, light, or
dark: show all four controls and select that initial mode.
Default: public exact; release off.true (default): show the Theme popover in either page mode.
false: fix the theme, corners, and opacity to build values.
The separate mode control remains governed by DEFAULT_THEME_MODE.square, soft, rounded, or
round. Applies across controls, highlights, blocks, images,
and popovers. Default: public soft; release square.0 to 100 percent
in steps of 10. Default: 30. Its selector appears above
Corners when SITE_BACKGROUND=true.data-auto-light and
data-auto-dark on theme inputs in tools/theme-menu.html.
Supply both IDs, refer to existing themes, and include the source theme
in its pair. Unmapped themes remain unchanged in every mode.styles.css maps them
to interface and syntax roles, without colour mixing or contrast adjustment.favicon.svg. Default: public
assets/smartstechnicalsundual.svg; release empty.true: embed and theme the header SVG; requires
SITE_ICON_PATH. false: display it as an external
image. The favicon always keeps its original colours.
Default: public true; release false.SITE_ICON_PATH is empty. Default: public U+4DEA; release U+4DD6.#rgb or #rrggbb override for the
Unicode icon. Empty (default): header uses the article-title colour;
generated favicon uses SVG's default text fill. Unused with a custom SVG.assets/. Use the same path-component
rules as generated blocks and supply a readable, non-empty
.svg source file. The generated favicon.svg
is reserved for output.class="colour-out"
and class="colour-in" attributes to drawable elements or
groups. Edit the SVG directly or use Inkscape's XML Editor. When the same
SVG is inlined as the header icon and backdrop, use artwork without
id attributes.colour-out with the article background and
colour-in with its title colour. The mapping follows the
active theme and mode. Avoid inline style declarations that override those fills.SITE_ICON_PATH= and
SITE_ICON_PATH_THEME=false.true; release false.assets/smartstechnicalsundual.svg.true (default): browsers supporting CSS random()
choose a scale and crop on document load. Unsupported browsers, or
false, retain the SVG's base fit.colour-in with the theme's background
artwork colour; colour-out is unpainted.
DEFAULT_BACKGROUND_OPACITY controls opacity.preserveAspectRatio="xMidYMid slice" for a centred
cover crop, as in the bundled SVG.pygments (default), source-highlight, or
none. See Code blocks under GENERATED BLOCKS.23; blocks at or below it omit the footer.Create custom-styles.css in the project root for site-local styling:
feed.atom, discovery metadata, and the header's
Atom link. Default: public true; release false.https://smartstechnical.com; release empty.v6support@smartsystems.co.uk;
release SITE_TITLE.
Enable SITE_FEED, set the feed identity, and opt listed
articles in with data-feed-sections:
h2, adding a linked list of that section's h3 headings.h2/h3 fall back to h1 when the
article has no sections. An h3 entry without child headings
contains only its section link. Section entries do not include article prose.h1 uses the effective
article modification date; section entries use their effective
h2 date, including newer child dates.auto date participates in whole-article
entries. For section entries, it is only the fallback for an undated
h2.SITE_MODE and SITE_URL_STYLE.
IDs remain SITE_URL/#article-id or SITE_URL/#section-id,
independent of dates and output mode.SITE_URL changes IDs.h3 links retain
the parent entry ID. Switching to section mode introduces existing
sections as entries. Read/unread status is controlled by the reader.site/ without changing relative paths.file:// access, open site/index.html;
multi-page navigation requires SITE_URL_STYLE=html..atom as application/atom+xml..html files.
The OpenBSD httpd(8) example supplies the Atom MIME type and
rewrite. Replace its host, certificate, and document-root paths; validate
before reloading. Keep specific location rules before the final rewrite.
Set SITE_CONTACT_EMAIL to one plain address to open the reader's
mail client. Use an ASCII domain and a mailbox name made up of letters,
digits, dots, or the characters ! ' * + _ ~ -. An empty value
selects the contact form. Only make smarts defaults to
v6support@smartsystems.co.uk. To use the form for that target,
run SITE_CONTACT_EMAIL= make smarts.
reply: optional address, maximum 254 characters.
message: required, maximum 500 characters.sanitised-site-title_contact=1.
The title is lowercased; runs outside ASCII letters, digits, dots,
underscores, and hyphens become an underscore; edge underscores are
removed. A result without letters or digits becomes smartpress.smartstechnical_contact=1 for public
builds and smartpress_contact=1 for releases.These targets package the generator; routine site updates use make build.
smartpress; archive names remain smartpress.1.0.73.articles/smartpress with RELEASE_FILES.
The manual is listed as the homepage in the standalone release copy.
Creates a working release tree in site/ and
smartpress_VERSION.tar at the project root, under a matching
top-level directory. Its own download is absent inside that tree/archive.RELEASE_FILES and installs the archive into the staged
generator article. Leaves that complete tree in site/.data-release="generator" download marker.smartpress_*.tar and
smartpress_*.tar.gz from the source generator article
directory after publication. Other root archives remain.release and full check that the archive contains
the files needed to run the default make targets before publishing it.build uses RUNTIME_FILES and all articles;
it leaves source download markers and archives unchanged.GENERATOR_VERSION and run make release.articles/smartpress/, then
run make build to publish it with other articles.
Alternatively, make full integrates it into staged output.site/. If installing the site or release archive fails,
the build restores the previous site. If restoration fails, it reports
where the backup is kept..site-build.*
under the project root, .render-build.* under the build root,
and .article-build.* under articles/smartpress/
before removing leftovers. Existing workspace names are never reused;
a collision stops the build.site/ to discard generated
output; remove obsolete root archives by exact filename.make release with the same version before
make full, from the same source root.data-listed="true"
or no data-listed attribute.LC_ALL=C; the generator unsets
SOURCE_HIGHLIGHT_DATADIR.tools/build-profile.sh invokes tools/build.sh
with internal BUILD_ROOT and ARTICLE_SELECTION
settings.sh tools/build.sh to render directly.
It writes index.html and other generated files in the project root.
Before replacing or removing output, it checks for an earlier Smartpress
build of each file. If an output name belongs to an unrecognised file,
the build stops and names the file to move aside. Move an older, unmarked
feed.atom aside once when upgrading a direct build.custom-styles.css from its build root.assets/fonts/.tools/license.txt.THIRD_PARTY_NOTICES.txt and licenses/.
The license and Theme popovers link to those notices.