summaryrefslogtreecommitdiffhomepage
path: root/web/README.md
blob: 40c12b070506ab759cb1a33146e10f0b9fd976b3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
# web

The zash website: a Hugo site in the project's `web/` directory, building to
`web/public/`. Nothing is generated into the repository, and Hugo itself is
not a build dependency of the shell.

## Local preview

```sh
make docs                         # render the documents into web/ (see below)
hugo server --source web          # http://localhost:1313/
hugo --source web --minify        # -> web/public/
```

Hugo is a single Go binary; `go install github.com/gohugoio/hugo@latest` or a
release tarball from github.com/gohugoio/hugo/releases both do. No theme
module is used, so the site builds with no network access.

## Layout

```
web/
  hugo.toml            baseURL, title, menu, highlight style
  content/
    _index.md          home page
    docs/              the documentation pages, ordered by weight
                       readme.md, design.md: written by `make docs`
  layouts/
    baseof.html        shell of every page
    home.html          hero, the measured benchmark, the README body
    single.html        a docs page: sidebar, text, and its own contents
    list.html          the docs index
    404.html
    partials/          head, docs-nav
  assets/
    css/zash.css       the design
    css/chroma.css     `hugo gen chromastyles --style=tokyonight-night`
    js/copy.js         copy buttons on code blocks, optional
  static/              the logo; the specification and the Doxygen reference,
                       copied in by `make docs`: zash-spec.html, zash-spec.pdf,
                       reference/
```

## The documents

`README.md`, `DESIGN.md` and the specification are the site's reference pages
too, so `make docs` (the same target that writes `docs/` for the repository)
puts copies here, and only here - they are ignored by git, like `docs/`:

- `README.md` and `DESIGN.md` are already markdown, so they are copied with a
  front-matter block added. The logo block, the byline, the document's own
  `## Contents` list and its first heading are dropped: the page gets a title
  from the front matter, a logo from the site header and a contents list from
  the sidebar, so none of those belong in the body. A link into the other
  document becomes a `../design/` page link; a link to any other file in the
  tree becomes a GitHub link.
- The specification is a page too: `web/spec-md.py` turns typst's HTML
  export into markdown, keeping the heading ids the spec cross-references
  itself by and carrying the MathML over as it is (browsers render it, so the
  page needs no TeX script). Typst has no markdown writer. Its own contents
  list is dropped for the same reason as the other two, though its section
  numbering is kept. The typeset HTML export and the PDF are copied beside
  it, and the docs sidebar links all three.
- The source reference is the Doxygen HTML from `docs/html`, copied to
  `static/reference/`; its links are relative, so it serves as it is.

So a checkout needs `make docs` before `hugo` for a complete site; the rest of
the pages are hand-written.

No theme module is used: the CSS is a few hundred lines, and the palette comes
from `packaging/zash-logo.svg` - mainframe navy, periwinkle and a signal blue.
The site is dark only, on purpose. A docs page is three columns on a wide
screen (sections, text, the page's own headings from Hugo's table of
contents), and one column with a row of section links below 60rem. The home
page's terminal is a real transcript, measured on Linux; the numbers in it
are not decorative.

The code blocks are highlighted with classes rather than inline styles
(`markup.highlight.noClasses = false`), so `assets/css/chroma.css` has to match
the `style` in `hugo.toml`. Regenerate both together:

```sh
hugo gen chromastyles --style=tokyonight-night > web/assets/css/chroma.css
```

## Publishing

There is no deploy workflow yet: zash is a private repository and GitHub Pages
is not available for one on a free plan. The options when it comes to
publishing are a public repository, a paid plan with Pages enabled for this
one, or a separate public repository that carries only `web/` and its
workflow.