annotate doc/format.md @ 0:71dd8d58a8e5 default tip

cleaned up re-init from net_wobblyhead_www project tooling
author ark
date 2026-10-22 14:59 +0200
parents
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
71dd8d58a8e5 cleaned up re-init from net_wobblyhead_www project tooling
ark
parents:
diff changeset
1 # Format
71dd8d58a8e5 cleaned up re-init from net_wobblyhead_www project tooling
ark
parents:
diff changeset
2
71dd8d58a8e5 cleaned up re-init from net_wobblyhead_www project tooling
ark
parents:
diff changeset
3 This document describes everything a site author writes: the site layout, the
71dd8d58a8e5 cleaned up re-init from net_wobblyhead_www project tooling
ark
parents:
diff changeset
4 configuration, the page sources and the templates. What the generator does
71dd8d58a8e5 cleaned up re-init from net_wobblyhead_www project tooling
ark
parents:
diff changeset
5 with them is in [build.md](build.md).
71dd8d58a8e5 cleaned up re-init from net_wobblyhead_www project tooling
ark
parents:
diff changeset
6
71dd8d58a8e5 cleaned up re-init from net_wobblyhead_www project tooling
ark
parents:
diff changeset
7 ## Site layout
71dd8d58a8e5 cleaned up re-init from net_wobblyhead_www project tooling
ark
parents:
diff changeset
8
71dd8d58a8e5 cleaned up re-init from net_wobblyhead_www project tooling
ark
parents:
diff changeset
9 A site is a directory. The tools are run in it.
71dd8d58a8e5 cleaned up re-init from net_wobblyhead_www project tooling
ark
parents:
diff changeset
10
71dd8d58a8e5 cleaned up re-init from net_wobblyhead_www project tooling
ark
parents:
diff changeset
11 - `config.txt` -- the site configuration.
71dd8d58a8e5 cleaned up re-init from net_wobblyhead_www project tooling
ark
parents:
diff changeset
12 - `src/` -- the page sources, and the images and other files they reference.
71dd8d58a8e5 cleaned up re-init from net_wobblyhead_www project tooling
ark
parents:
diff changeset
13 - `static/` -- files copied to the output as they are, which no page
71dd8d58a8e5 cleaned up re-init from net_wobblyhead_www project tooling
ark
parents:
diff changeset
14 references: a favicon, `robots.txt`.
71dd8d58a8e5 cleaned up re-init from net_wobblyhead_www project tooling
ark
parents:
diff changeset
15 - `tpl/` -- the templates and their assets: stylesheets, images, fonts.
71dd8d58a8e5 cleaned up re-init from net_wobblyhead_www project tooling
ark
parents:
diff changeset
16 - `www/` -- the build directory, configurable. It is output, never input.
71dd8d58a8e5 cleaned up re-init from net_wobblyhead_www project tooling
ark
parents:
diff changeset
17 - `dist/` -- archives written by `make_dist.sh`.
71dd8d58a8e5 cleaned up re-init from net_wobblyhead_www project tooling
ark
parents:
diff changeset
18
71dd8d58a8e5 cleaned up re-init from net_wobblyhead_www project tooling
ark
parents:
diff changeset
19 The output tree mirrors the source tree. `src/notes/first_steps.md` becomes
71dd8d58a8e5 cleaned up re-init from net_wobblyhead_www project tooling
ark
parents:
diff changeset
20 `www/notes/first_steps.html`, and an image next to it is placed next to the
71dd8d58a8e5 cleaned up re-init from net_wobblyhead_www project tooling
ark
parents:
diff changeset
21 output.
71dd8d58a8e5 cleaned up re-init from net_wobblyhead_www project tooling
ark
parents:
diff changeset
22
71dd8d58a8e5 cleaned up re-init from net_wobblyhead_www project tooling
ark
parents:
diff changeset
23 The generator creates only the directories it needs to mirror the source.
71dd8d58a8e5 cleaned up re-init from net_wobblyhead_www project tooling
ark
parents:
diff changeset
24 `index.md` is an ordinary source with no special role. Where directory-style
71dd8d58a8e5 cleaned up re-init from net_wobblyhead_www project tooling
ark
parents:
diff changeset
25 links are wanted, they have to be written out.
71dd8d58a8e5 cleaned up re-init from net_wobblyhead_www project tooling
ark
parents:
diff changeset
26
71dd8d58a8e5 cleaned up re-init from net_wobblyhead_www project tooling
ark
parents:
diff changeset
27 Files from `static/`, from `tpl/` (all except `.html` files) and from `src/`
71dd8d58a8e5 cleaned up re-init from net_wobblyhead_www project tooling
ark
parents:
diff changeset
28 all end up in the build directory. They must not overlap.
71dd8d58a8e5 cleaned up re-init from net_wobblyhead_www project tooling
ark
parents:
diff changeset
29
71dd8d58a8e5 cleaned up re-init from net_wobblyhead_www project tooling
ark
parents:
diff changeset
30 All text files are UTF-8. The output is UTF-8. `.DS_Store` files are not
71dd8d58a8e5 cleaned up re-init from net_wobblyhead_www project tooling
ark
parents:
diff changeset
31 copied.
71dd8d58a8e5 cleaned up re-init from net_wobblyhead_www project tooling
ark
parents:
diff changeset
32
71dd8d58a8e5 cleaned up re-init from net_wobblyhead_www project tooling
ark
parents:
diff changeset
33 ## Site configuration
71dd8d58a8e5 cleaned up re-init from net_wobblyhead_www project tooling
ark
parents:
diff changeset
34
71dd8d58a8e5 cleaned up re-init from net_wobblyhead_www project tooling
ark
parents:
diff changeset
35 `config.txt` uses the same format as the header block of a page, described
71dd8d58a8e5 cleaned up re-init from net_wobblyhead_www project tooling
ark
parents:
diff changeset
36 below. It has no body. A missing `config.txt` is an error, and an unknown key
71dd8d58a8e5 cleaned up re-init from net_wobblyhead_www project tooling
ark
parents:
diff changeset
37 produces a warning.
71dd8d58a8e5 cleaned up re-init from net_wobblyhead_www project tooling
ark
parents:
diff changeset
38
71dd8d58a8e5 cleaned up re-init from net_wobblyhead_www project tooling
ark
parents:
diff changeset
39 Keys:
71dd8d58a8e5 cleaned up re-init from net_wobblyhead_www project tooling
ark
parents:
diff changeset
40
71dd8d58a8e5 cleaned up re-init from net_wobblyhead_www project tooling
ark
parents:
diff changeset
41 - `site_url` -- required. The public address of the site, without a trailing
71dd8d58a8e5 cleaned up re-init from net_wobblyhead_www project tooling
ark
parents:
diff changeset
42 slash. The absolute addresses in the page head are built from it.
71dd8d58a8e5 cleaned up re-init from net_wobblyhead_www project tooling
ark
parents:
diff changeset
43 - `build_dir` -- the output directory. Defaults to `www`.
71dd8d58a8e5 cleaned up re-init from net_wobblyhead_www project tooling
ark
parents:
diff changeset
44 - `image_sizes` -- symbolic image sizes, as a comma-separated list of
71dd8d58a8e5 cleaned up re-init from net_wobblyhead_www project tooling
ark
parents:
diff changeset
45 `<name>:<width in pixels>` pairs.
71dd8d58a8e5 cleaned up re-init from net_wobblyhead_www project tooling
ark
parents:
diff changeset
46 - `extra_header_keys` -- a comma-separated list of page header keys that
71dd8d58a8e5 cleaned up re-init from net_wobblyhead_www project tooling
ark
parents:
diff changeset
47 should not produce a warning.
71dd8d58a8e5 cleaned up re-init from net_wobblyhead_www project tooling
ark
parents:
diff changeset
48 - `index_sections` -- the sections of the root index page that
71dd8d58a8e5 cleaned up re-init from net_wobblyhead_www project tooling
ark
parents:
diff changeset
49 `update_index.py` maintains. A comma-separated list of
71dd8d58a8e5 cleaned up re-init from net_wobblyhead_www project tooling
ark
parents:
diff changeset
50 `<directory>:<heading>` pairs. See [tools.md](tools.md).
71dd8d58a8e5 cleaned up re-init from net_wobblyhead_www project tooling
ark
parents:
diff changeset
51 - `index_recent` -- the number of entries in each of those sections.
71dd8d58a8e5 cleaned up re-init from net_wobblyhead_www project tooling
ark
parents:
diff changeset
52 Defaults to 5.
71dd8d58a8e5 cleaned up re-init from net_wobblyhead_www project tooling
ark
parents:
diff changeset
53
71dd8d58a8e5 cleaned up re-init from net_wobblyhead_www project tooling
ark
parents:
diff changeset
54 All values are available to templates with a `site.` prefix.
71dd8d58a8e5 cleaned up re-init from net_wobblyhead_www project tooling
ark
parents:
diff changeset
55
71dd8d58a8e5 cleaned up re-init from net_wobblyhead_www project tooling
ark
parents:
diff changeset
56 Example:
71dd8d58a8e5 cleaned up re-init from net_wobblyhead_www project tooling
ark
parents:
diff changeset
57
71dd8d58a8e5 cleaned up re-init from net_wobblyhead_www project tooling
ark
parents:
diff changeset
58 site_url: https://www.example.org
71dd8d58a8e5 cleaned up re-init from net_wobblyhead_www project tooling
ark
parents:
diff changeset
59 build_dir: www
71dd8d58a8e5 cleaned up re-init from net_wobblyhead_www project tooling
ark
parents:
diff changeset
60 image_sizes: small:300, half:400, wide:800
71dd8d58a8e5 cleaned up re-init from net_wobblyhead_www project tooling
ark
parents:
diff changeset
61 extra_header_keys: location
71dd8d58a8e5 cleaned up re-init from net_wobblyhead_www project tooling
ark
parents:
diff changeset
62 index_sections: notes:Recent notes
71dd8d58a8e5 cleaned up re-init from net_wobblyhead_www project tooling
ark
parents:
diff changeset
63 index_recent: 3
71dd8d58a8e5 cleaned up re-init from net_wobblyhead_www project tooling
ark
parents:
diff changeset
64
71dd8d58a8e5 cleaned up re-init from net_wobblyhead_www project tooling
ark
parents:
diff changeset
65 A change to `image_sizes` takes effect for existing images only after a clean
71dd8d58a8e5 cleaned up re-init from net_wobblyhead_www project tooling
ark
parents:
diff changeset
66 build.
71dd8d58a8e5 cleaned up re-init from net_wobblyhead_www project tooling
ark
parents:
diff changeset
67
71dd8d58a8e5 cleaned up re-init from net_wobblyhead_www project tooling
ark
parents:
diff changeset
68 ## Pages
71dd8d58a8e5 cleaned up re-init from net_wobblyhead_www project tooling
ark
parents:
diff changeset
69
71dd8d58a8e5 cleaned up re-init from net_wobblyhead_www project tooling
ark
parents:
diff changeset
70 A page is a header block, a blank line and a body. A source that does not
71dd8d58a8e5 cleaned up re-init from net_wobblyhead_www project tooling
ark
parents:
diff changeset
71 start with a header block is an error.
71dd8d58a8e5 cleaned up re-init from net_wobblyhead_www project tooling
ark
parents:
diff changeset
72
71dd8d58a8e5 cleaned up re-init from net_wobblyhead_www project tooling
ark
parents:
diff changeset
73 Further blank lines between the header block and the body are ignored, and so
71dd8d58a8e5 cleaned up re-init from net_wobblyhead_www project tooling
ark
parents:
diff changeset
74 are blank lines at the end of the file. A page with headers and no body
71dd8d58a8e5 cleaned up re-init from net_wobblyhead_www project tooling
ark
parents:
diff changeset
75 produces an empty page and a warning.
71dd8d58a8e5 cleaned up re-init from net_wobblyhead_www project tooling
ark
parents:
diff changeset
76
71dd8d58a8e5 cleaned up re-init from net_wobblyhead_www project tooling
ark
parents:
diff changeset
77 ### Header block
71dd8d58a8e5 cleaned up re-init from net_wobblyhead_www project tooling
ark
parents:
diff changeset
78
71dd8d58a8e5 cleaned up re-init from net_wobblyhead_www project tooling
ark
parents:
diff changeset
79 Lines of `key: value`. The first blank line ends the block.
71dd8d58a8e5 cleaned up re-init from net_wobblyhead_www project tooling
ark
parents:
diff changeset
80
71dd8d58a8e5 cleaned up re-init from net_wobblyhead_www project tooling
ark
parents:
diff changeset
81 A value is literal text to the end of the line. There is no quoting, nesting
71dd8d58a8e5 cleaned up re-init from net_wobblyhead_www project tooling
ark
parents:
diff changeset
82 or list syntax.
71dd8d58a8e5 cleaned up re-init from net_wobblyhead_www project tooling
ark
parents:
diff changeset
83
71dd8d58a8e5 cleaned up re-init from net_wobblyhead_www project tooling
ark
parents:
diff changeset
84 Long values are folded the way mail headers are (RFC 5322). A line that starts
71dd8d58a8e5 cleaned up re-init from net_wobblyhead_www project tooling
ark
parents:
diff changeset
85 with a space or a tab continues the previous value, and the parts are joined
71dd8d58a8e5 cleaned up re-init from net_wobblyhead_www project tooling
ark
parents:
diff changeset
86 with a single space. Leading whitespace is therefore significant in the header
71dd8d58a8e5 cleaned up re-init from net_wobblyhead_www project tooling
ark
parents:
diff changeset
87 block: a continuation line that loses its indentation becomes an invalid
71dd8d58a8e5 cleaned up re-init from net_wobblyhead_www project tooling
ark
parents:
diff changeset
88 header line.
71dd8d58a8e5 cleaned up re-init from net_wobblyhead_www project tooling
ark
parents:
diff changeset
89
71dd8d58a8e5 cleaned up re-init from net_wobblyhead_www project tooling
ark
parents:
diff changeset
90 The order of keys does not matter. A duplicate key produces a warning, and the
71dd8d58a8e5 cleaned up re-init from net_wobblyhead_www project tooling
ark
parents:
diff changeset
91 later value wins.
71dd8d58a8e5 cleaned up re-init from net_wobblyhead_www project tooling
ark
parents:
diff changeset
92
71dd8d58a8e5 cleaned up re-init from net_wobblyhead_www project tooling
ark
parents:
diff changeset
93 Example:
71dd8d58a8e5 cleaned up re-init from net_wobblyhead_www project tooling
ark
parents:
diff changeset
94
71dd8d58a8e5 cleaned up re-init from net_wobblyhead_www project tooling
ark
parents:
diff changeset
95 title: First steps
71dd8d58a8e5 cleaned up re-init from net_wobblyhead_www project tooling
ark
parents:
diff changeset
96 subtitle: Notes from the first week,
71dd8d58a8e5 cleaned up re-init from net_wobblyhead_www project tooling
ark
parents:
diff changeset
97 written down later
71dd8d58a8e5 cleaned up re-init from net_wobblyhead_www project tooling
ark
parents:
diff changeset
98 tags: Notes, Model making
71dd8d58a8e5 cleaned up re-init from net_wobblyhead_www project tooling
ark
parents:
diff changeset
99 created_at: 2026-03-01
71dd8d58a8e5 cleaned up re-init from net_wobblyhead_www project tooling
ark
parents:
diff changeset
100 updated_at: 2026-03-04
71dd8d58a8e5 cleaned up re-init from net_wobblyhead_www project tooling
ark
parents:
diff changeset
101 is_published: 1
71dd8d58a8e5 cleaned up re-init from net_wobblyhead_www project tooling
ark
parents:
diff changeset
102
71dd8d58a8e5 cleaned up re-init from net_wobblyhead_www project tooling
ark
parents:
diff changeset
103 ### Header keys
71dd8d58a8e5 cleaned up re-init from net_wobblyhead_www project tooling
ark
parents:
diff changeset
104
71dd8d58a8e5 cleaned up re-init from net_wobblyhead_www project tooling
ark
parents:
diff changeset
105 `title` is the only required key. A page without a title is an error.
71dd8d58a8e5 cleaned up re-init from net_wobblyhead_www project tooling
ark
parents:
diff changeset
106
71dd8d58a8e5 cleaned up re-init from net_wobblyhead_www project tooling
ark
parents:
diff changeset
107 Keys the generator acts on:
71dd8d58a8e5 cleaned up re-init from net_wobblyhead_www project tooling
ark
parents:
diff changeset
108
71dd8d58a8e5 cleaned up re-init from net_wobblyhead_www project tooling
ark
parents:
diff changeset
109 - `title` -- the page title. The template uses it for the page heading.
71dd8d58a8e5 cleaned up re-init from net_wobblyhead_www project tooling
ark
parents:
diff changeset
110 - `is_published` -- `1` publishes the page. Anything else, or no value,
71dd8d58a8e5 cleaned up re-init from net_wobblyhead_www project tooling
ark
parents:
diff changeset
111 leaves it unpublished. Unpublished pages are only built in draft mode.
71dd8d58a8e5 cleaned up re-init from net_wobblyhead_www project tooling
ark
parents:
diff changeset
112 - `tags` -- a comma-separated list of tags. Empty items are dropped. Each tag
71dd8d58a8e5 cleaned up re-init from net_wobblyhead_www project tooling
ark
parents:
diff changeset
113 links to a tag index page, see [Tag index pages](#tag-index-pages).
71dd8d58a8e5 cleaned up re-init from net_wobblyhead_www project tooling
ark
parents:
diff changeset
114 - `template` -- the file name of a template in `tpl/` to use instead of
71dd8d58a8e5 cleaned up re-init from net_wobblyhead_www project tooling
ark
parents:
diff changeset
115 `page.html`.
71dd8d58a8e5 cleaned up re-init from net_wobblyhead_www project tooling
ark
parents:
diff changeset
116 - `description` -- one or two sentences summarising the page, for search
71dd8d58a8e5 cleaned up re-init from net_wobblyhead_www project tooling
ark
parents:
diff changeset
117 results and link previews. Without it, `subtitle` is used.
71dd8d58a8e5 cleaned up re-init from net_wobblyhead_www project tooling
ark
parents:
diff changeset
118 - `image` -- the link preview image, as a path relative to the source. It is
71dd8d58a8e5 cleaned up re-init from net_wobblyhead_www project tooling
ark
parents:
diff changeset
119 expected to be 1200x630 pixels. See [build.md](build.md).
71dd8d58a8e5 cleaned up re-init from net_wobblyhead_www project tooling
ark
parents:
diff changeset
120 - `crossref` -- the path of a related page, relative to the source, like a
71dd8d58a8e5 cleaned up re-init from net_wobblyhead_www project tooling
ark
parents:
diff changeset
121 link in the body. A `.md` extension is rewritten to `.html`, and the target
71dd8d58a8e5 cleaned up re-init from net_wobblyhead_www project tooling
ark
parents:
diff changeset
122 is checked like a body link. A value with a scheme, such as `https:`,
71dd8d58a8e5 cleaned up re-init from net_wobblyhead_www project tooling
ark
parents:
diff changeset
123 produces a warning and is passed on unchanged.
71dd8d58a8e5 cleaned up re-init from net_wobblyhead_www project tooling
ark
parents:
diff changeset
124 - `created_at` -- an ISO date, `YYYY-MM-DD`, or an ISO date and time such as
71dd8d58a8e5 cleaned up re-init from net_wobblyhead_www project tooling
ark
parents:
diff changeset
125 `2026-03-01T14:30:05+01:00`. Templates get the date as `dd.mm.yyyy`.
71dd8d58a8e5 cleaned up re-init from net_wobblyhead_www project tooling
ark
parents:
diff changeset
126 - `updated_at` -- as `created_at`.
71dd8d58a8e5 cleaned up re-init from net_wobblyhead_www project tooling
ark
parents:
diff changeset
127
71dd8d58a8e5 cleaned up re-init from net_wobblyhead_www project tooling
ark
parents:
diff changeset
128 The generator reads the dates only to format them and to sort tag index
71dd8d58a8e5 cleaned up re-init from net_wobblyhead_www project tooling
ark
parents:
diff changeset
129 pages. A time is accepted and not shown. The date is shown as written,
71dd8d58a8e5 cleaned up re-init from net_wobblyhead_www project tooling
ark
parents:
diff changeset
130 without converting the time zone. A value that is not a valid ISO date
71dd8d58a8e5 cleaned up re-init from net_wobblyhead_www project tooling
ark
parents:
diff changeset
131 produces a warning and is shown as written. The accepted forms are those of
71dd8d58a8e5 cleaned up re-init from net_wobblyhead_www project tooling
ark
parents:
diff changeset
132 Python's `datetime.fromisoformat`, which accepts more of them from Python 3.11
71dd8d58a8e5 cleaned up re-init from net_wobblyhead_www project tooling
ark
parents:
diff changeset
133 on.
71dd8d58a8e5 cleaned up re-init from net_wobblyhead_www project tooling
ark
parents:
diff changeset
134
71dd8d58a8e5 cleaned up re-init from net_wobblyhead_www project tooling
ark
parents:
diff changeset
135 Known keys without defined format, passed to templates as they are:
71dd8d58a8e5 cleaned up re-init from net_wobblyhead_www project tooling
ark
parents:
diff changeset
136
71dd8d58a8e5 cleaned up re-init from net_wobblyhead_www project tooling
ark
parents:
diff changeset
137 - `subtitle` -- a one-line summary.
71dd8d58a8e5 cleaned up re-init from net_wobblyhead_www project tooling
ark
parents:
diff changeset
138 - `timeframe` -- a period, as free text, such as `03.2024 - 06.2025`.
71dd8d58a8e5 cleaned up re-init from net_wobblyhead_www project tooling
ark
parents:
diff changeset
139 - `repository` -- the address of the source repository of a project.
71dd8d58a8e5 cleaned up re-init from net_wobblyhead_www project tooling
ark
parents:
diff changeset
140 - `todo` -- notes for the author.
71dd8d58a8e5 cleaned up re-init from net_wobblyhead_www project tooling
ark
parents:
diff changeset
141
71dd8d58a8e5 cleaned up re-init from net_wobblyhead_www project tooling
ark
parents:
diff changeset
142 Any other key is passed to templates as well, and produces a warning unless
71dd8d58a8e5 cleaned up re-init from net_wobblyhead_www project tooling
ark
parents:
diff changeset
143 it is listed in `extra_header_keys`. The warning only catches typos in keys
71dd8d58a8e5 cleaned up re-init from net_wobblyhead_www project tooling
ark
parents:
diff changeset
144 that are known.
71dd8d58a8e5 cleaned up re-init from net_wobblyhead_www project tooling
ark
parents:
diff changeset
145
71dd8d58a8e5 cleaned up re-init from net_wobblyhead_www project tooling
ark
parents:
diff changeset
146 ### Body
71dd8d58a8e5 cleaned up re-init from net_wobblyhead_www project tooling
ark
parents:
diff changeset
147
71dd8d58a8e5 cleaned up re-init from net_wobblyhead_www project tooling
ark
parents:
diff changeset
148 The body is Markdown, processed by python-markdown with two extensions:
71dd8d58a8e5 cleaned up re-init from net_wobblyhead_www project tooling
ark
parents:
diff changeset
149
71dd8d58a8e5 cleaned up re-init from net_wobblyhead_www project tooling
ark
parents:
diff changeset
150 - `extra` -- abbreviations, attribute lists, definition lists, fenced code,
71dd8d58a8e5 cleaned up re-init from net_wobblyhead_www project tooling
ark
parents:
diff changeset
151 footnotes, Markdown inside HTML, and tables.
71dd8d58a8e5 cleaned up re-init from net_wobblyhead_www project tooling
ark
parents:
diff changeset
152 - `sane_lists`.
71dd8d58a8e5 cleaned up re-init from net_wobblyhead_www project tooling
ark
parents:
diff changeset
153
71dd8d58a8e5 cleaned up re-init from net_wobblyhead_www project tooling
ark
parents:
diff changeset
154 The top-level heading comes from the `title` header through the template. The
71dd8d58a8e5 cleaned up re-init from net_wobblyhead_www project tooling
ark
parents:
diff changeset
155 body usually starts at the second level.
71dd8d58a8e5 cleaned up re-init from net_wobblyhead_www project tooling
ark
parents:
diff changeset
156
71dd8d58a8e5 cleaned up re-init from net_wobblyhead_www project tooling
ark
parents:
diff changeset
157 HTML in the body is passed through. Links and images in it are handled like
71dd8d58a8e5 cleaned up re-init from net_wobblyhead_www project tooling
ark
parents:
diff changeset
158 those written in Markdown, as long as attributes are in double quotes.
71dd8d58a8e5 cleaned up re-init from net_wobblyhead_www project tooling
ark
parents:
diff changeset
159
71dd8d58a8e5 cleaned up re-init from net_wobblyhead_www project tooling
ark
parents:
diff changeset
160 ### Links
71dd8d58a8e5 cleaned up re-init from net_wobblyhead_www project tooling
ark
parents:
diff changeset
161
71dd8d58a8e5 cleaned up re-init from net_wobblyhead_www project tooling
ark
parents:
diff changeset
162 Paths are relative to the source file.
71dd8d58a8e5 cleaned up re-init from net_wobblyhead_www project tooling
ark
parents:
diff changeset
163
71dd8d58a8e5 cleaned up re-init from net_wobblyhead_www project tooling
ark
parents:
diff changeset
164 A link to another page can use the `.md` extension, which is rewritten to
71dd8d58a8e5 cleaned up re-init from net_wobblyhead_www project tooling
ark
parents:
diff changeset
165 `.html`, or the `.html` extension directly. Fragments and query strings are
71dd8d58a8e5 cleaned up re-init from net_wobblyhead_www project tooling
ark
parents:
diff changeset
166 kept. A `.md` link that points nowhere is still rewritten.
71dd8d58a8e5 cleaned up re-init from net_wobblyhead_www project tooling
ark
parents:
diff changeset
167
71dd8d58a8e5 cleaned up re-init from net_wobblyhead_www project tooling
ark
parents:
diff changeset
168 A link to a file that is neither a page nor an image, such as a PDF or an
71dd8d58a8e5 cleaned up re-init from net_wobblyhead_www project tooling
ark
parents:
diff changeset
169 archive, copies that file to the mirrored output path.
71dd8d58a8e5 cleaned up re-init from net_wobblyhead_www project tooling
ark
parents:
diff changeset
170
71dd8d58a8e5 cleaned up re-init from net_wobblyhead_www project tooling
ark
parents:
diff changeset
171 Links with a scheme, such as `https:` or `mailto:`, and protocol-relative
71dd8d58a8e5 cleaned up re-init from net_wobblyhead_www project tooling
ark
parents:
diff changeset
172 links are left alone. All other links are checked, see [build.md](build.md).
71dd8d58a8e5 cleaned up re-init from net_wobblyhead_www project tooling
ark
parents:
diff changeset
173
71dd8d58a8e5 cleaned up re-init from net_wobblyhead_www project tooling
ark
parents:
diff changeset
174 ### Tables
71dd8d58a8e5 cleaned up re-init from net_wobblyhead_www project tooling
ark
parents:
diff changeset
175
71dd8d58a8e5 cleaned up re-init from net_wobblyhead_www project tooling
ark
parents:
diff changeset
176 Standard pipe tables. Outer pipes are optional.
71dd8d58a8e5 cleaned up re-init from net_wobblyhead_www project tooling
ark
parents:
diff changeset
177
71dd8d58a8e5 cleaned up re-init from net_wobblyhead_www project tooling
ark
parents:
diff changeset
178 | Year | Model | Scale |
71dd8d58a8e5 cleaned up re-init from net_wobblyhead_www project tooling
ark
parents:
diff changeset
179 |------|------------|------:|
71dd8d58a8e5 cleaned up re-init from net_wobblyhead_www project tooling
ark
parents:
diff changeset
180 | 2024 | Tug | 1:50 |
71dd8d58a8e5 cleaned up re-init from net_wobblyhead_www project tooling
ark
parents:
diff changeset
181 | 2025 | Lighthouse | 1:87 |
71dd8d58a8e5 cleaned up re-init from net_wobblyhead_www project tooling
ark
parents:
diff changeset
182
71dd8d58a8e5 cleaned up re-init from net_wobblyhead_www project tooling
ark
parents:
diff changeset
183 Alignment markers produce an inline `text-align` style on every cell.
71dd8d58a8e5 cleaned up re-init from net_wobblyhead_www project tooling
ark
parents:
diff changeset
184 Attribute lists cannot be attached to tables, so all tables share one style.
71dd8d58a8e5 cleaned up re-init from net_wobblyhead_www project tooling
ark
parents:
diff changeset
185 Where Markdown cannot express a table, it can be written in HTML.
71dd8d58a8e5 cleaned up re-init from net_wobblyhead_www project tooling
ark
parents:
diff changeset
186
71dd8d58a8e5 cleaned up re-init from net_wobblyhead_www project tooling
ark
parents:
diff changeset
187 ### Footnotes
71dd8d58a8e5 cleaned up re-init from net_wobblyhead_www project tooling
ark
parents:
diff changeset
188
71dd8d58a8e5 cleaned up re-init from net_wobblyhead_www project tooling
ark
parents:
diff changeset
189 A reference is `[^label]` in the text. A definition is `[^label]:` at the
71dd8d58a8e5 cleaned up re-init from net_wobblyhead_www project tooling
ark
parents:
diff changeset
190 start of a line, followed by the text. The label identifies the note and can
71dd8d58a8e5 cleaned up re-init from net_wobblyhead_www project tooling
ark
parents:
diff changeset
191 be any string without whitespace; it is not the printed number. Further
71dd8d58a8e5 cleaned up re-init from net_wobblyhead_www project tooling
ark
parents:
diff changeset
192 paragraphs of a note are indented by four spaces.
71dd8d58a8e5 cleaned up re-init from net_wobblyhead_www project tooling
ark
parents:
diff changeset
193
71dd8d58a8e5 cleaned up re-init from net_wobblyhead_www project tooling
ark
parents:
diff changeset
194 The hull was planked twice.[^planks]
71dd8d58a8e5 cleaned up re-init from net_wobblyhead_www project tooling
ark
parents:
diff changeset
195
71dd8d58a8e5 cleaned up re-init from net_wobblyhead_www project tooling
ark
parents:
diff changeset
196 [^planks]: The first planks were too thick.
71dd8d58a8e5 cleaned up re-init from net_wobblyhead_www project tooling
ark
parents:
diff changeset
197
71dd8d58a8e5 cleaned up re-init from net_wobblyhead_www project tooling
ark
parents:
diff changeset
198 Notes are numbered in the order of their definitions, not of their
71dd8d58a8e5 cleaned up re-init from net_wobblyhead_www project tooling
ark
parents:
diff changeset
199 references. Putting each definition right after the paragraph that refers to
71dd8d58a8e5 cleaned up re-init from net_wobblyhead_www project tooling
ark
parents:
diff changeset
200 it keeps the two orders the same.
71dd8d58a8e5 cleaned up re-init from net_wobblyhead_www project tooling
ark
parents:
diff changeset
201
71dd8d58a8e5 cleaned up re-init from net_wobblyhead_www project tooling
ark
parents:
diff changeset
202 A definition without a reference is still printed and numbered. A reference
71dd8d58a8e5 cleaned up re-init from net_wobblyhead_www project tooling
ark
parents:
diff changeset
203 without a definition stays in the text as written, without a warning.
71dd8d58a8e5 cleaned up re-init from net_wobblyhead_www project tooling
ark
parents:
diff changeset
204
71dd8d58a8e5 cleaned up re-init from net_wobblyhead_www project tooling
ark
parents:
diff changeset
205 The notes are collected at the end of the body in a `div` of class
71dd8d58a8e5 cleaned up re-init from net_wobblyhead_www project tooling
ark
parents:
diff changeset
206 `footnote`. The generator passes them to the template separately, as
71dd8d58a8e5 cleaned up re-init from net_wobblyhead_www project tooling
ark
parents:
diff changeset
207 `footnotes`. The generated ids are `fn:` and `fnref:` followed by the label;
71dd8d58a8e5 cleaned up re-init from net_wobblyhead_www project tooling
ark
parents:
diff changeset
208 they share the id space of the page.
71dd8d58a8e5 cleaned up re-init from net_wobblyhead_www project tooling
ark
parents:
diff changeset
209
71dd8d58a8e5 cleaned up re-init from net_wobblyhead_www project tooling
ark
parents:
diff changeset
210 ### Images
71dd8d58a8e5 cleaned up re-init from net_wobblyhead_www project tooling
ark
parents:
diff changeset
211
71dd8d58a8e5 cleaned up re-init from net_wobblyhead_www project tooling
ark
parents:
diff changeset
212 An image is standard Markdown, with the path relative to the source file:
71dd8d58a8e5 cleaned up re-init from net_wobblyhead_www project tooling
ark
parents:
diff changeset
213
71dd8d58a8e5 cleaned up re-init from net_wobblyhead_www project tooling
ark
parents:
diff changeset
214 ![The finished hull](hull.jpg)
71dd8d58a8e5 cleaned up re-init from net_wobblyhead_www project tooling
ark
parents:
diff changeset
215
71dd8d58a8e5 cleaned up re-init from net_wobblyhead_www project tooling
ark
parents:
diff changeset
216 The output gets `width` and `height` attributes, see [build.md](build.md).
71dd8d58a8e5 cleaned up re-init from net_wobblyhead_www project tooling
ark
parents:
diff changeset
217
71dd8d58a8e5 cleaned up re-init from net_wobblyhead_www project tooling
ark
parents:
diff changeset
218 #### Sizes
71dd8d58a8e5 cleaned up re-init from net_wobblyhead_www project tooling
ark
parents:
diff changeset
219
71dd8d58a8e5 cleaned up re-init from net_wobblyhead_www project tooling
ark
parents:
diff changeset
220 A smaller copy of an image is requested in the file name, by putting a size
71dd8d58a8e5 cleaned up re-init from net_wobblyhead_www project tooling
ark
parents:
diff changeset
221 between the name and the extension:
71dd8d58a8e5 cleaned up re-init from net_wobblyhead_www project tooling
ark
parents:
diff changeset
222
71dd8d58a8e5 cleaned up re-init from net_wobblyhead_www project tooling
ark
parents:
diff changeset
223 ![The finished hull](hull.800.jpg)
71dd8d58a8e5 cleaned up re-init from net_wobblyhead_www project tooling
ark
parents:
diff changeset
224 ![The finished hull](hull.half.jpg)
71dd8d58a8e5 cleaned up re-init from net_wobblyhead_www project tooling
ark
parents:
diff changeset
225
71dd8d58a8e5 cleaned up re-init from net_wobblyhead_www project tooling
ark
parents:
diff changeset
226 The size is either a width in pixels or a name from `image_sizes`. The height
71dd8d58a8e5 cleaned up re-init from net_wobblyhead_www project tooling
ark
parents:
diff changeset
227 follows from the aspect ratio. If `hull.800.jpg` exists as a file, it is
71dd8d58a8e5 cleaned up re-init from net_wobblyhead_www project tooling
ark
parents:
diff changeset
228 copied as it is, and no copy is generated.
71dd8d58a8e5 cleaned up re-init from net_wobblyhead_www project tooling
ark
parents:
diff changeset
229
71dd8d58a8e5 cleaned up re-init from net_wobblyhead_www project tooling
ark
parents:
diff changeset
230 PNG and JPEG can be scaled, and WebP where Pillow supports it. Other formats,
71dd8d58a8e5 cleaned up re-init from net_wobblyhead_www project tooling
ark
parents:
diff changeset
231 SVG among them, are only copied.
71dd8d58a8e5 cleaned up re-init from net_wobblyhead_www project tooling
ark
parents:
diff changeset
232
71dd8d58a8e5 cleaned up re-init from net_wobblyhead_www project tooling
ark
parents:
diff changeset
233 #### Layout classes
71dd8d58a8e5 cleaned up re-init from net_wobblyhead_www project tooling
ark
parents:
diff changeset
234
71dd8d58a8e5 cleaned up re-init from net_wobblyhead_www project tooling
ark
parents:
diff changeset
235 An attribute list adds classes, which the stylesheet defines:
71dd8d58a8e5 cleaned up re-init from net_wobblyhead_www project tooling
ark
parents:
diff changeset
236
71dd8d58a8e5 cleaned up re-init from net_wobblyhead_www project tooling
ark
parents:
diff changeset
237 ![The finished hull](hull.half.jpg){: .right }
71dd8d58a8e5 cleaned up re-init from net_wobblyhead_www project tooling
ark
parents:
diff changeset
238
71dd8d58a8e5 cleaned up re-init from net_wobblyhead_www project tooling
ark
parents:
diff changeset
239 Class names are not checked. How an image without a class is shown is up to
71dd8d58a8e5 cleaned up re-init from net_wobblyhead_www project tooling
ark
parents:
diff changeset
240 the stylesheet.
71dd8d58a8e5 cleaned up re-init from net_wobblyhead_www project tooling
ark
parents:
diff changeset
241
71dd8d58a8e5 cleaned up re-init from net_wobblyhead_www project tooling
ark
parents:
diff changeset
242 #### Captions
71dd8d58a8e5 cleaned up re-init from net_wobblyhead_www project tooling
ark
parents:
diff changeset
243
71dd8d58a8e5 cleaned up re-init from net_wobblyhead_www project tooling
ark
parents:
diff changeset
244 The title of an image becomes its caption when the image is alone in its
71dd8d58a8e5 cleaned up re-init from net_wobblyhead_www project tooling
ark
parents:
diff changeset
245 paragraph:
71dd8d58a8e5 cleaned up re-init from net_wobblyhead_www project tooling
ark
parents:
diff changeset
246
71dd8d58a8e5 cleaned up re-init from net_wobblyhead_www project tooling
ark
parents:
diff changeset
247 ![The finished hull](hull.800.jpg "The hull before painting")
71dd8d58a8e5 cleaned up re-init from net_wobblyhead_www project tooling
ark
parents:
diff changeset
248
71dd8d58a8e5 cleaned up re-init from net_wobblyhead_www project tooling
ark
parents:
diff changeset
249 The paragraph becomes a `figure` with a `figcaption` below the image. The
71dd8d58a8e5 cleaned up re-init from net_wobblyhead_www project tooling
ark
parents:
diff changeset
250 title attribute is removed, so the caption does not also appear as a tooltip.
71dd8d58a8e5 cleaned up re-init from net_wobblyhead_www project tooling
ark
parents:
diff changeset
251 Classes move from the image to the figure, so a floated image takes its
71dd8d58a8e5 cleaned up re-init from net_wobblyhead_www project tooling
ark
parents:
diff changeset
252 caption along. An image with a title inside running text keeps the title as
71dd8d58a8e5 cleaned up re-init from net_wobblyhead_www project tooling
ark
parents:
diff changeset
253 a tooltip.
71dd8d58a8e5 cleaned up re-init from net_wobblyhead_www project tooling
ark
parents:
diff changeset
254
71dd8d58a8e5 cleaned up re-init from net_wobblyhead_www project tooling
ark
parents:
diff changeset
255 #### Linking to the original
71dd8d58a8e5 cleaned up re-init from net_wobblyhead_www project tooling
ark
parents:
diff changeset
256
71dd8d58a8e5 cleaned up re-init from net_wobblyhead_www project tooling
ark
parents:
diff changeset
257 A thumbnail linked to the original is the nested Markdown construct:
71dd8d58a8e5 cleaned up re-init from net_wobblyhead_www project tooling
ark
parents:
diff changeset
258
71dd8d58a8e5 cleaned up re-init from net_wobblyhead_www project tooling
ark
parents:
diff changeset
259 [![The finished hull](hull.800.jpg)](hull.jpg)
71dd8d58a8e5 cleaned up re-init from net_wobblyhead_www project tooling
ark
parents:
diff changeset
260
71dd8d58a8e5 cleaned up re-init from net_wobblyhead_www project tooling
ark
parents:
diff changeset
261 The inner reference generates the smaller copy, the outer link copies the
71dd8d58a8e5 cleaned up re-init from net_wobblyhead_www project tooling
ark
parents:
diff changeset
262 original. An original that is only used for smaller copies is not copied to
71dd8d58a8e5 cleaned up re-init from net_wobblyhead_www project tooling
ark
parents:
diff changeset
263 the output.
71dd8d58a8e5 cleaned up re-init from net_wobblyhead_www project tooling
ark
parents:
diff changeset
264
71dd8d58a8e5 cleaned up re-init from net_wobblyhead_www project tooling
ark
parents:
diff changeset
265 An attribute list attaches to the thumbnail, and a title makes a caption as
71dd8d58a8e5 cleaned up re-init from net_wobblyhead_www project tooling
ark
parents:
diff changeset
266 above:
71dd8d58a8e5 cleaned up re-init from net_wobblyhead_www project tooling
ark
parents:
diff changeset
267
71dd8d58a8e5 cleaned up re-init from net_wobblyhead_www project tooling
ark
parents:
diff changeset
268 [![The finished hull](hull.800.jpg "The hull"){: .right }](hull.jpg)
71dd8d58a8e5 cleaned up re-init from net_wobblyhead_www project tooling
ark
parents:
diff changeset
269
71dd8d58a8e5 cleaned up re-init from net_wobblyhead_www project tooling
ark
parents:
diff changeset
270 ## Templates
71dd8d58a8e5 cleaned up re-init from net_wobblyhead_www project tooling
ark
parents:
diff changeset
271
71dd8d58a8e5 cleaned up re-init from net_wobblyhead_www project tooling
ark
parents:
diff changeset
272 `tpl/` holds the template set: one or more HTML templates and their assets,
71dd8d58a8e5 cleaned up re-init from net_wobblyhead_www project tooling
ark
parents:
diff changeset
273 which may be in subdirectories. Everything in `tpl/` except `.html` files is
71dd8d58a8e5 cleaned up re-init from net_wobblyhead_www project tooling
ark
parents:
diff changeset
274 copied to the build directory, keeping its relative path.
71dd8d58a8e5 cleaned up re-init from net_wobblyhead_www project tooling
ark
parents:
diff changeset
275
71dd8d58a8e5 cleaned up re-init from net_wobblyhead_www project tooling
ark
parents:
diff changeset
276 - `page.html` is the default page template. The `template` header selects
71dd8d58a8e5 cleaned up re-init from net_wobblyhead_www project tooling
ark
parents:
diff changeset
277 another one.
71dd8d58a8e5 cleaned up re-init from net_wobblyhead_www project tooling
ark
parents:
diff changeset
278 - `tag.html` renders the tag index pages.
71dd8d58a8e5 cleaned up re-init from net_wobblyhead_www project tooling
ark
parents:
diff changeset
279
71dd8d58a8e5 cleaned up re-init from net_wobblyhead_www project tooling
ark
parents:
diff changeset
280 Error pages, such as a 404 page, are ordinary pages.
71dd8d58a8e5 cleaned up re-init from net_wobblyhead_www project tooling
ark
parents:
diff changeset
281
71dd8d58a8e5 cleaned up re-init from net_wobblyhead_www project tooling
ark
parents:
diff changeset
282 ### Markers
71dd8d58a8e5 cleaned up re-init from net_wobblyhead_www project tooling
ark
parents:
diff changeset
283
71dd8d58a8e5 cleaned up re-init from net_wobblyhead_www project tooling
ark
parents:
diff changeset
284 A marker is replaced with a value:
71dd8d58a8e5 cleaned up re-init from net_wobblyhead_www project tooling
ark
parents:
diff changeset
285
71dd8d58a8e5 cleaned up re-init from net_wobblyhead_www project tooling
ark
parents:
diff changeset
286 <h1>{{title}}</h1>
71dd8d58a8e5 cleaned up re-init from net_wobblyhead_www project tooling
ark
parents:
diff changeset
287 <p>{{site.site_url}}</p>
71dd8d58a8e5 cleaned up re-init from net_wobblyhead_www project tooling
ark
parents:
diff changeset
288
71dd8d58a8e5 cleaned up re-init from net_wobblyhead_www project tooling
ark
parents:
diff changeset
289 A marker is `{{`, a key, optionally a `|` and a filter name, and `}}`, with no
71dd8d58a8e5 cleaned up re-init from net_wobblyhead_www project tooling
ark
parents:
diff changeset
290 spaces. Anything else is left as it is, including a stray `{{`. There is no
71dd8d58a8e5 cleaned up re-init from net_wobblyhead_www project tooling
ark
parents:
diff changeset
291 way to escape a well-formed marker.
71dd8d58a8e5 cleaned up re-init from net_wobblyhead_www project tooling
ark
parents:
diff changeset
292
71dd8d58a8e5 cleaned up re-init from net_wobblyhead_www project tooling
ark
parents:
diff changeset
293 Rendered values are not scanned for markers or blocks again.
71dd8d58a8e5 cleaned up re-init from net_wobblyhead_www project tooling
ark
parents:
diff changeset
294
71dd8d58a8e5 cleaned up re-init from net_wobblyhead_www project tooling
ark
parents:
diff changeset
295 A marker for an undefined value renders as an empty string and produces a
71dd8d58a8e5 cleaned up re-init from net_wobblyhead_www project tooling
ark
parents:
diff changeset
296 warning. A marker with an unknown filter, and a marker for a list value, are
71dd8d58a8e5 cleaned up re-init from net_wobblyhead_www project tooling
ark
parents:
diff changeset
297 errors.
71dd8d58a8e5 cleaned up re-init from net_wobblyhead_www project tooling
ark
parents:
diff changeset
298
71dd8d58a8e5 cleaned up re-init from net_wobblyhead_www project tooling
ark
parents:
diff changeset
299 ### Filters
71dd8d58a8e5 cleaned up re-init from net_wobblyhead_www project tooling
ark
parents:
diff changeset
300
71dd8d58a8e5 cleaned up re-init from net_wobblyhead_www project tooling
ark
parents:
diff changeset
301 Values are HTML-escaped by default.
71dd8d58a8e5 cleaned up re-init from net_wobblyhead_www project tooling
ark
parents:
diff changeset
302
71dd8d58a8e5 cleaned up re-init from net_wobblyhead_www project tooling
ark
parents:
diff changeset
303 - `{{key|htmlencode}}` -- HTML-escaped. This is the default, written out.
71dd8d58a8e5 cleaned up re-init from net_wobblyhead_www project tooling
ark
parents:
diff changeset
304 - `{{key|literal}}` -- not escaped. Needed for `body` and `footnotes`.
71dd8d58a8e5 cleaned up re-init from net_wobblyhead_www project tooling
ark
parents:
diff changeset
305 - `{{key|urlencode}}` -- URL-encoded, including `/`.
71dd8d58a8e5 cleaned up re-init from net_wobblyhead_www project tooling
ark
parents:
diff changeset
306
71dd8d58a8e5 cleaned up re-init from net_wobblyhead_www project tooling
ark
parents:
diff changeset
307 ### Blocks
71dd8d58a8e5 cleaned up re-init from net_wobblyhead_www project tooling
ark
parents:
diff changeset
308
71dd8d58a8e5 cleaned up re-init from net_wobblyhead_www project tooling
ark
parents:
diff changeset
309 A condition renders its content only when the condition holds:
71dd8d58a8e5 cleaned up re-init from net_wobblyhead_www project tooling
ark
parents:
diff changeset
310
71dd8d58a8e5 cleaned up re-init from net_wobblyhead_www project tooling
ark
parents:
diff changeset
311 {% if subtitle|isnotempty %}<p class="subtitle">{{subtitle}}</p>{% endif %}
71dd8d58a8e5 cleaned up re-init from net_wobblyhead_www project tooling
ark
parents:
diff changeset
312
71dd8d58a8e5 cleaned up re-init from net_wobblyhead_www project tooling
ark
parents:
diff changeset
313 Conditions:
71dd8d58a8e5 cleaned up re-init from net_wobblyhead_www project tooling
ark
parents:
diff changeset
314
71dd8d58a8e5 cleaned up re-init from net_wobblyhead_www project tooling
ark
parents:
diff changeset
315 - `isempty` -- the value is undefined, an empty string or an empty list.
71dd8d58a8e5 cleaned up re-init from net_wobblyhead_www project tooling
ark
parents:
diff changeset
316 - `isnotempty` -- the opposite.
71dd8d58a8e5 cleaned up re-init from net_wobblyhead_www project tooling
ark
parents:
diff changeset
317
71dd8d58a8e5 cleaned up re-init from net_wobblyhead_www project tooling
ark
parents:
diff changeset
318 An unknown condition is an error. A condition on an undefined value does not
71dd8d58a8e5 cleaned up re-init from net_wobblyhead_www project tooling
ark
parents:
diff changeset
319 produce a warning.
71dd8d58a8e5 cleaned up re-init from net_wobblyhead_www project tooling
ark
parents:
diff changeset
320
71dd8d58a8e5 cleaned up re-init from net_wobblyhead_www project tooling
ark
parents:
diff changeset
321 A loop renders its content once for every item in a list:
71dd8d58a8e5 cleaned up re-init from net_wobblyhead_www project tooling
ark
parents:
diff changeset
322
71dd8d58a8e5 cleaned up re-init from net_wobblyhead_www project tooling
ark
parents:
diff changeset
323 {% loop tags %}<li><a href="{{url}}">{{name}}</a></li>{% endloop %}
71dd8d58a8e5 cleaned up re-init from net_wobblyhead_www project tooling
ark
parents:
diff changeset
324
71dd8d58a8e5 cleaned up re-init from net_wobblyhead_www project tooling
ark
parents:
diff changeset
325 The list has to be a list of dictionaries. Inside the loop only the keys of
71dd8d58a8e5 cleaned up re-init from net_wobblyhead_www project tooling
ark
parents:
diff changeset
326 the current item are available; page values such as `relRoot` are not. A loop
71dd8d58a8e5 cleaned up re-init from net_wobblyhead_www project tooling
ark
parents:
diff changeset
327 over an undefined value renders nothing and produces a warning. A loop over
71dd8d58a8e5 cleaned up re-init from net_wobblyhead_www project tooling
ark
parents:
diff changeset
328 anything other than a list of dictionaries is an error, and so is a condition
71dd8d58a8e5 cleaned up re-init from net_wobblyhead_www project tooling
ark
parents:
diff changeset
329 on a loop.
71dd8d58a8e5 cleaned up re-init from net_wobblyhead_www project tooling
ark
parents:
diff changeset
330
71dd8d58a8e5 cleaned up re-init from net_wobblyhead_www project tooling
ark
parents:
diff changeset
331 A block cannot contain another block of its own kind, at any depth: the
71dd8d58a8e5 cleaned up re-init from net_wobblyhead_www project tooling
ark
parents:
diff changeset
332 inner end tag would close the outer block. A condition inside a loop, or a
71dd8d58a8e5 cleaned up re-init from net_wobblyhead_www project tooling
ark
parents:
diff changeset
333 loop inside a condition, works. A block tag that is not part of a complete
71dd8d58a8e5 cleaned up re-init from net_wobblyhead_www project tooling
ark
parents:
diff changeset
334 block is an error.
71dd8d58a8e5 cleaned up re-init from net_wobblyhead_www project tooling
ark
parents:
diff changeset
335
71dd8d58a8e5 cleaned up re-init from net_wobblyhead_www project tooling
ark
parents:
diff changeset
336 ### Page values
71dd8d58a8e5 cleaned up re-init from net_wobblyhead_www project tooling
ark
parents:
diff changeset
337
71dd8d58a8e5 cleaned up re-init from net_wobblyhead_www project tooling
ark
parents:
diff changeset
338 - `site.<key>` -- every key of the site configuration.
71dd8d58a8e5 cleaned up re-init from net_wobblyhead_www project tooling
ark
parents:
diff changeset
339 - Every header of the page, under its own name. Headers the page does not set
71dd8d58a8e5 cleaned up re-init from net_wobblyhead_www project tooling
ark
parents:
diff changeset
340 are undefined.
71dd8d58a8e5 cleaned up re-init from net_wobblyhead_www project tooling
ark
parents:
diff changeset
341 - `body` -- the HTML of the body, without the footnotes. Use with `literal`.
71dd8d58a8e5 cleaned up re-init from net_wobblyhead_www project tooling
ark
parents:
diff changeset
342 - `footnotes` -- the footnotes `div`, or empty. Use with `literal`. A template
71dd8d58a8e5 cleaned up re-init from net_wobblyhead_www project tooling
ark
parents:
diff changeset
343 without it drops the footnotes.
71dd8d58a8e5 cleaned up re-init from net_wobblyhead_www project tooling
ark
parents:
diff changeset
344 - `tags` -- the tags of the page, as a list of items with `name` and `url`.
71dd8d58a8e5 cleaned up re-init from net_wobblyhead_www project tooling
ark
parents:
diff changeset
345 The address is relative to the page. Empty for a page without tags.
71dd8d58a8e5 cleaned up re-init from net_wobblyhead_www project tooling
ark
parents:
diff changeset
346 - `crossrefUrl` -- the `crossref` header as an address relative to the page,
71dd8d58a8e5 cleaned up re-init from net_wobblyhead_www project tooling
ark
parents:
diff changeset
347 with `.md` rewritten to `.html`. Empty without the header.
71dd8d58a8e5 cleaned up re-init from net_wobblyhead_www project tooling
ark
parents:
diff changeset
348 - `relRoot` -- the relative path from the page to the site root, ending in a
71dd8d58a8e5 cleaned up re-init from net_wobblyhead_www project tooling
ark
parents:
diff changeset
349 slash. `./` at the top level. For links to assets and other pages.
71dd8d58a8e5 cleaned up re-init from net_wobblyhead_www project tooling
ark
parents:
diff changeset
350 - `absRoot` -- `/`. For error pages, which the server delivers at other
71dd8d58a8e5 cleaned up re-init from net_wobblyhead_www project tooling
ark
parents:
diff changeset
351 addresses than their own.
71dd8d58a8e5 cleaned up re-init from net_wobblyhead_www project tooling
ark
parents:
diff changeset
352 - `pageUrl` -- the absolute address of the page. An `index.html` is
71dd8d58a8e5 cleaned up re-init from net_wobblyhead_www project tooling
ark
parents:
diff changeset
353 addressed by its directory, ending in a slash.
71dd8d58a8e5 cleaned up re-init from net_wobblyhead_www project tooling
ark
parents:
diff changeset
354 - `metaDescription` -- the `description` header, or `subtitle` without one,
71dd8d58a8e5 cleaned up re-init from net_wobblyhead_www project tooling
ark
parents:
diff changeset
355 or empty.
71dd8d58a8e5 cleaned up re-init from net_wobblyhead_www project tooling
ark
parents:
diff changeset
356 - `createdDate`, `updatedDate` -- the dates of `created_at` and `updated_at`
71dd8d58a8e5 cleaned up re-init from net_wobblyhead_www project tooling
ark
parents:
diff changeset
357 as `dd.mm.yyyy`. Empty without the header. `updatedDate` is also empty when
71dd8d58a8e5 cleaned up re-init from net_wobblyhead_www project tooling
ark
parents:
diff changeset
358 it is the same date as `createdDate`.
71dd8d58a8e5 cleaned up re-init from net_wobblyhead_www project tooling
ark
parents:
diff changeset
359 - `ogImage`, `ogImageWidth`, `ogImageHeight`, `ogImageAlt` -- the link
71dd8d58a8e5 cleaned up re-init from net_wobblyhead_www project tooling
ark
parents:
diff changeset
360 preview image: its absolute address, its size in pixels, and the alt text of
71dd8d58a8e5 cleaned up re-init from net_wobblyhead_www project tooling
ark
parents:
diff changeset
361 the image it was cut from. Undefined when there is no preview image; the
71dd8d58a8e5 cleaned up re-init from net_wobblyhead_www project tooling
ark
parents:
diff changeset
362 template then names its own default or none. See [build.md](build.md).
71dd8d58a8e5 cleaned up re-init from net_wobblyhead_www project tooling
ark
parents:
diff changeset
363
71dd8d58a8e5 cleaned up re-init from net_wobblyhead_www project tooling
ark
parents:
diff changeset
364 ### Tag index pages
71dd8d58a8e5 cleaned up re-init from net_wobblyhead_www project tooling
ark
parents:
diff changeset
365
71dd8d58a8e5 cleaned up re-init from net_wobblyhead_www project tooling
ark
parents:
diff changeset
366 Tag index pages have no source. They are written to the build root as
71dd8d58a8e5 cleaned up re-init from net_wobblyhead_www project tooling
ark
parents:
diff changeset
367 `tag_<name>.html`. The name is the tag in lower case, with everything other
71dd8d58a8e5 cleaned up re-init from net_wobblyhead_www project tooling
ark
parents:
diff changeset
368 than the letters a to z and digits removed: "Model making" becomes
71dd8d58a8e5 cleaned up re-init from net_wobblyhead_www project tooling
ark
parents:
diff changeset
369 `tag_modelmaking.html`. Tags that differ only in case, spaces or punctuation
71dd8d58a8e5 cleaned up re-init from net_wobblyhead_www project tooling
ark
parents:
diff changeset
370 share one page. A source with the same name as a tag index page collides
71dd8d58a8e5 cleaned up re-init from net_wobblyhead_www project tooling
ark
parents:
diff changeset
371 with it.
71dd8d58a8e5 cleaned up re-init from net_wobblyhead_www project tooling
ark
parents:
diff changeset
372
71dd8d58a8e5 cleaned up re-init from net_wobblyhead_www project tooling
ark
parents:
diff changeset
373 Values for `tag.html`:
71dd8d58a8e5 cleaned up re-init from net_wobblyhead_www project tooling
ark
parents:
diff changeset
374
71dd8d58a8e5 cleaned up re-init from net_wobblyhead_www project tooling
ark
parents:
diff changeset
375 - `site.<key>` -- as for pages.
71dd8d58a8e5 cleaned up re-init from net_wobblyhead_www project tooling
ark
parents:
diff changeset
376 - `tag` -- the tag. Where several spellings share a page, the first one found.
71dd8d58a8e5 cleaned up re-init from net_wobblyhead_www project tooling
ark
parents:
diff changeset
377 - `relRoot` -- always `./`. `absRoot` -- `/`.
71dd8d58a8e5 cleaned up re-init from net_wobblyhead_www project tooling
ark
parents:
diff changeset
378 - `pageUrl` -- the absolute address of the tag index page.
71dd8d58a8e5 cleaned up re-init from net_wobblyhead_www project tooling
ark
parents:
diff changeset
379 - `pages` -- the pages with this tag, newest first by `created_at`, then by
71dd8d58a8e5 cleaned up re-init from net_wobblyhead_www project tooling
ark
parents:
diff changeset
380 title. Pages without `created_at` come last. Each item has the headers of
71dd8d58a8e5 cleaned up re-init from net_wobblyhead_www project tooling
ark
parents:
diff changeset
381 its page except `tags`, plus:
71dd8d58a8e5 cleaned up re-init from net_wobblyhead_www project tooling
ark
parents:
diff changeset
382 - `url` -- the address of the page, relative to the build root. It
71dd8d58a8e5 cleaned up re-init from net_wobblyhead_www project tooling
ark
parents:
diff changeset
383 replaces a header of the same name.
71dd8d58a8e5 cleaned up re-init from net_wobblyhead_www project tooling
ark
parents:
diff changeset
384 - `descOrSubtitle` -- the `description` header, or `subtitle` without
71dd8d58a8e5 cleaned up re-init from net_wobblyhead_www project tooling
ark
parents:
diff changeset
385 one, or empty.
71dd8d58a8e5 cleaned up re-init from net_wobblyhead_www project tooling
ark
parents:
diff changeset
386
71dd8d58a8e5 cleaned up re-init from net_wobblyhead_www project tooling
ark
parents:
diff changeset
387 A header that a page does not set is undefined in its item, and a marker for
71dd8d58a8e5 cleaned up re-init from net_wobblyhead_www project tooling
ark
parents:
diff changeset
388 it produces a warning. Optional headers belong in a condition.
71dd8d58a8e5 cleaned up re-init from net_wobblyhead_www project tooling
ark
parents:
diff changeset
389
71dd8d58a8e5 cleaned up re-init from net_wobblyhead_www project tooling
ark
parents:
diff changeset
390 ### Stylesheets
71dd8d58a8e5 cleaned up re-init from net_wobblyhead_www project tooling
ark
parents:
diff changeset
391
71dd8d58a8e5 cleaned up re-init from net_wobblyhead_www project tooling
ark
parents:
diff changeset
392 Every local image in the output has `width` and `height` attributes. A
71dd8d58a8e5 cleaned up re-init from net_wobblyhead_www project tooling
ark
parents:
diff changeset
393 stylesheet that limits the width of images has to set `height: auto`.