annotate doc/build.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 # How a build works
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 what `make_site.py` does. Its command line is in
71dd8d58a8e5 cleaned up re-init from net_wobblyhead_www project tooling
ark
parents:
diff changeset
4 [tools.md](tools.md), the formats it reads are in [format.md](format.md).
71dd8d58a8e5 cleaned up re-init from net_wobblyhead_www project tooling
ark
parents:
diff changeset
5
71dd8d58a8e5 cleaned up re-init from net_wobblyhead_www project tooling
ark
parents:
diff changeset
6 ## Order of work
71dd8d58a8e5 cleaned up re-init from net_wobblyhead_www project tooling
ark
parents:
diff changeset
7
71dd8d58a8e5 cleaned up re-init from net_wobblyhead_www project tooling
ark
parents:
diff changeset
8 1. Read `config.txt`. Create the build directory, after emptying it if a
71dd8d58a8e5 cleaned up re-init from net_wobblyhead_www project tooling
ark
parents:
diff changeset
9 clean build was asked for.
71dd8d58a8e5 cleaned up re-init from net_wobblyhead_www project tooling
ark
parents:
diff changeset
10 2. Copy the files of `static/` and the non-HTML files of `tpl/` that are
71dd8d58a8e5 cleaned up re-init from net_wobblyhead_www project tooling
ark
parents:
diff changeset
11 newer than their copies in the build directory.
71dd8d58a8e5 cleaned up re-init from net_wobblyhead_www project tooling
ark
parents:
diff changeset
12 3. Build each selected page, by default every `.md` file below `src/`:
71dd8d58a8e5 cleaned up re-init from net_wobblyhead_www project tooling
ark
parents:
diff changeset
13 - Skip the page if its output exists and is not older than the source.
71dd8d58a8e5 cleaned up re-init from net_wobblyhead_www project tooling
ark
parents:
diff changeset
14 - Read the header block. Skip an unpublished page, unless draft mode is
71dd8d58a8e5 cleaned up re-init from net_wobblyhead_www project tooling
ark
parents:
diff changeset
15 on.
71dd8d58a8e5 cleaned up re-init from net_wobblyhead_www project tooling
ark
parents:
diff changeset
16 - Convert the Markdown body to HTML.
71dd8d58a8e5 cleaned up re-init from net_wobblyhead_www project tooling
ark
parents:
diff changeset
17 - Rewrite links, copy referenced files, place images and add their
71dd8d58a8e5 cleaned up re-init from net_wobblyhead_www project tooling
ark
parents:
diff changeset
18 dimensions, turn captioned images into figures.
71dd8d58a8e5 cleaned up re-init from net_wobblyhead_www project tooling
ark
parents:
diff changeset
19 - Split off the footnotes.
71dd8d58a8e5 cleaned up re-init from net_wobblyhead_www project tooling
ark
parents:
diff changeset
20 - Pick the link preview image and write it if needed.
71dd8d58a8e5 cleaned up re-init from net_wobblyhead_www project tooling
ark
parents:
diff changeset
21 - Render the template and write the page.
71dd8d58a8e5 cleaned up re-init from net_wobblyhead_www project tooling
ark
parents:
diff changeset
22 4. Write the tag index pages, if they are being rebuilt.
71dd8d58a8e5 cleaned up re-init from net_wobblyhead_www project tooling
ark
parents:
diff changeset
23 5. Check the links of all pages built in this run.
71dd8d58a8e5 cleaned up re-init from net_wobblyhead_www project tooling
ark
parents:
diff changeset
24
71dd8d58a8e5 cleaned up re-init from net_wobblyhead_www project tooling
ark
parents:
diff changeset
25 Tag index pages are rebuilt with `--tags`, and always with `--clean`. Then
71dd8d58a8e5 cleaned up re-init from net_wobblyhead_www project tooling
ark
parents:
diff changeset
26 the header block of every selected page is read before the date check, so
71dd8d58a8e5 cleaned up re-init from net_wobblyhead_www project tooling
ark
parents:
diff changeset
27 pages that are up to date are listed too.
71dd8d58a8e5 cleaned up re-init from net_wobblyhead_www project tooling
ark
parents:
diff changeset
28
71dd8d58a8e5 cleaned up re-init from net_wobblyhead_www project tooling
ark
parents:
diff changeset
29 Output paths mirror source paths. The build directory is `build_dir` from
71dd8d58a8e5 cleaned up re-init from net_wobblyhead_www project tooling
ark
parents:
diff changeset
30 `config.txt`, or the directory given with `--build-dir`.
71dd8d58a8e5 cleaned up re-init from net_wobblyhead_www project tooling
ark
parents:
diff changeset
31
71dd8d58a8e5 cleaned up re-init from net_wobblyhead_www project tooling
ark
parents:
diff changeset
32 ## Incremental builds
71dd8d58a8e5 cleaned up re-init from net_wobblyhead_www project tooling
ark
parents:
diff changeset
33
71dd8d58a8e5 cleaned up re-init from net_wobblyhead_www project tooling
ark
parents:
diff changeset
34 Without `--clean`, the build compares modification times only: a page with
71dd8d58a8e5 cleaned up re-init from net_wobblyhead_www project tooling
ark
parents:
diff changeset
35 its source, a generated image with its original, a copied file with its
71dd8d58a8e5 cleaned up re-init from net_wobblyhead_www project tooling
ark
parents:
diff changeset
36 source. Nothing else is tracked, and nothing is removed. As a result:
71dd8d58a8e5 cleaned up re-init from net_wobblyhead_www project tooling
ark
parents:
diff changeset
37
71dd8d58a8e5 cleaned up re-init from net_wobblyhead_www project tooling
ark
parents:
diff changeset
38 - A changed template or configuration rebuilds nothing.
71dd8d58a8e5 cleaned up re-init from net_wobblyhead_www project tooling
ark
parents:
diff changeset
39 - A page that is unpublished or deleted keeps its old output.
71dd8d58a8e5 cleaned up re-init from net_wobblyhead_www project tooling
ark
parents:
diff changeset
40 - Link preview images from earlier versions of an image stay.
71dd8d58a8e5 cleaned up re-init from net_wobblyhead_www project tooling
ark
parents:
diff changeset
41
71dd8d58a8e5 cleaned up re-init from net_wobblyhead_www project tooling
ark
parents:
diff changeset
42 A clean build fixes all of these, and is the normal way to build for
71dd8d58a8e5 cleaned up re-init from net_wobblyhead_www project tooling
ark
parents:
diff changeset
43 publishing.
71dd8d58a8e5 cleaned up re-init from net_wobblyhead_www project tooling
ark
parents:
diff changeset
44
71dd8d58a8e5 cleaned up re-init from net_wobblyhead_www project tooling
ark
parents:
diff changeset
45 ## Unpublished pages
71dd8d58a8e5 cleaned up re-init from net_wobblyhead_www project tooling
ark
parents:
diff changeset
46
71dd8d58a8e5 cleaned up re-init from net_wobblyhead_www project tooling
ark
parents:
diff changeset
47 A page without `is_published: 1` is skipped with a warning. In draft mode,
71dd8d58a8e5 cleaned up re-init from net_wobblyhead_www project tooling
ark
parents:
diff changeset
48 `--draft`, it is built, and the warning says so.
71dd8d58a8e5 cleaned up re-init from net_wobblyhead_www project tooling
ark
parents:
diff changeset
49
71dd8d58a8e5 cleaned up re-init from net_wobblyhead_www project tooling
ark
parents:
diff changeset
50 ## Reporting
71dd8d58a8e5 cleaned up re-init from net_wobblyhead_www project tooling
ark
parents:
diff changeset
51
71dd8d58a8e5 cleaned up re-init from net_wobblyhead_www project tooling
ark
parents:
diff changeset
52 Messages have three severities. All of them go to standard error.
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 - Error -- no correct output is possible. The build stops. Examples: a
71dd8d58a8e5 cleaned up re-init from net_wobblyhead_www project tooling
ark
parents:
diff changeset
55 missing `config.txt` or `site_url`, a source that does not start with a
71dd8d58a8e5 cleaned up re-init from net_wobblyhead_www project tooling
ark
parents:
diff changeset
56 header block, a page without a title, a missing template, a template
71dd8d58a8e5 cleaned up re-init from net_wobblyhead_www project tooling
ark
parents:
diff changeset
57 syntax error.
71dd8d58a8e5 cleaned up re-init from net_wobblyhead_www project tooling
ark
parents:
diff changeset
58 - Warning -- output is produced but is probably wrong. Examples: a broken
71dd8d58a8e5 cleaned up re-init from net_wobblyhead_www project tooling
ark
parents:
diff changeset
59 link, an unknown image size, an unknown or duplicate header key, an unknown
71dd8d58a8e5 cleaned up re-init from net_wobblyhead_www project tooling
ark
parents:
diff changeset
60 configuration key, an original smaller than the size asked for, a skipped
71dd8d58a8e5 cleaned up re-init from net_wobblyhead_www project tooling
ark
parents:
diff changeset
61 unpublished page, a page rendered as a draft, a page with no body, two
71dd8d58a8e5 cleaned up re-init from net_wobblyhead_www project tooling
ark
parents:
diff changeset
62 spellings of a tag sharing one index page, a date that is not an ISO date,
71dd8d58a8e5 cleaned up re-init from net_wobblyhead_www project tooling
ark
parents:
diff changeset
63 an `image` header that points nowhere or at an image that is not 1200x630,
71dd8d58a8e5 cleaned up re-init from net_wobblyhead_www project tooling
ark
parents:
diff changeset
64 an image that cannot be cropped for the link preview.
71dd8d58a8e5 cleaned up re-init from net_wobblyhead_www project tooling
ark
parents:
diff changeset
65 - Notice -- normal events. A page skipped because it is up to date, an image
71dd8d58a8e5 cleaned up re-init from net_wobblyhead_www project tooling
ark
parents:
diff changeset
66 copied or generated, a tag index page written with its tag and number of
71dd8d58a8e5 cleaned up re-init from net_wobblyhead_www project tooling
ark
parents:
diff changeset
67 pages, a link preview image generated or found up to date.
71dd8d58a8e5 cleaned up re-init from net_wobblyhead_www project tooling
ark
parents:
diff changeset
68
71dd8d58a8e5 cleaned up re-init from net_wobblyhead_www project tooling
ark
parents:
diff changeset
69 Errors and warnings are printed by default. `--quiet` prints errors only.
71dd8d58a8e5 cleaned up re-init from net_wobblyhead_www project tooling
ark
parents:
diff changeset
70 `--verbose` adds notices.
71dd8d58a8e5 cleaned up re-init from net_wobblyhead_www project tooling
ark
parents:
diff changeset
71
71dd8d58a8e5 cleaned up re-init from net_wobblyhead_www project tooling
ark
parents:
diff changeset
72 The summary counts the files created and updated, the images generated and
71dd8d58a8e5 cleaned up re-init from net_wobblyhead_www project tooling
ark
parents:
diff changeset
73 the warnings. When tag index pages were written, a second line lists their
71dd8d58a8e5 cleaned up re-init from net_wobblyhead_www project tooling
ark
parents:
diff changeset
74 tags. The summary goes to standard output, with `--report` or `--verbose`.
71dd8d58a8e5 cleaned up re-init from net_wobblyhead_www project tooling
ark
parents:
diff changeset
75
71dd8d58a8e5 cleaned up re-init from net_wobblyhead_www project tooling
ark
parents:
diff changeset
76 The exit code is 0 on success, 1 when an error stopped the build, and 2 for
71dd8d58a8e5 cleaned up re-init from net_wobblyhead_www project tooling
ark
parents:
diff changeset
77 a usage error. Warnings do not change the exit code.
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 ## Images
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 ### Resolving a reference
71dd8d58a8e5 cleaned up re-init from net_wobblyhead_www project tooling
ark
parents:
diff changeset
82
71dd8d58a8e5 cleaned up re-init from net_wobblyhead_www project tooling
ark
parents:
diff changeset
83 An image reference names either a file in the source tree or a smaller copy
71dd8d58a8e5 cleaned up re-init from net_wobblyhead_www project tooling
ark
parents:
diff changeset
84 to be generated:
71dd8d58a8e5 cleaned up re-init from net_wobblyhead_www project tooling
ark
parents:
diff changeset
85
71dd8d58a8e5 cleaned up re-init from net_wobblyhead_www project tooling
ark
parents:
diff changeset
86 1. If the path exists as a source file, it is copied as it is.
71dd8d58a8e5 cleaned up re-init from net_wobblyhead_www project tooling
ark
parents:
diff changeset
87 2. Otherwise, for formats that can be scaled, the last dot-separated part
71dd8d58a8e5 cleaned up re-init from net_wobblyhead_www project tooling
ark
parents:
diff changeset
88 before the extension is taken as a size. If the name without that part
71dd8d58a8e5 cleaned up re-init from net_wobblyhead_www project tooling
ark
parents:
diff changeset
89 exists, the copy is generated from it.
71dd8d58a8e5 cleaned up re-init from net_wobblyhead_www project tooling
ark
parents:
diff changeset
90 3. Otherwise the reference is broken and produces a warning.
71dd8d58a8e5 cleaned up re-init from net_wobblyhead_www project tooling
ark
parents:
diff changeset
91
71dd8d58a8e5 cleaned up re-init from net_wobblyhead_www project tooling
ark
parents:
diff changeset
92 A size that is neither a number nor a name from `image_sizes` produces a
71dd8d58a8e5 cleaned up re-init from net_wobblyhead_www project tooling
ark
parents:
diff changeset
93 warning, and the original is copied under the requested name.
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 Each output file is placed once per build. Further references to it, from the
71dd8d58a8e5 cleaned up re-init from net_wobblyhead_www project tooling
ark
parents:
diff changeset
96 same page or another, are not checked or reported again. A broken reference
71dd8d58a8e5 cleaned up re-init from net_wobblyhead_www project tooling
ark
parents:
diff changeset
97 produces a warning on every page that has it.
71dd8d58a8e5 cleaned up re-init from net_wobblyhead_www project tooling
ark
parents:
diff changeset
98
71dd8d58a8e5 cleaned up re-init from net_wobblyhead_www project tooling
ark
parents:
diff changeset
99 ### Formats
71dd8d58a8e5 cleaned up re-init from net_wobblyhead_www project tooling
ark
parents:
diff changeset
100
71dd8d58a8e5 cleaned up re-init from net_wobblyhead_www project tooling
ark
parents:
diff changeset
101 PNG and JPEG can be scaled. WebP can be scaled where the local Pillow
71dd8d58a8e5 cleaned up re-init from net_wobblyhead_www project tooling
ark
parents:
diff changeset
102 supports it, so the same site can build differently on another machine. An
71dd8d58a8e5 cleaned up re-init from net_wobblyhead_www project tooling
ark
parents:
diff changeset
103 MPO file, a JPEG with further images appended as some cameras write it, is
71dd8d58a8e5 cleaned up re-init from net_wobblyhead_www project tooling
ark
parents:
diff changeset
104 treated as a JPEG.
71dd8d58a8e5 cleaned up re-init from net_wobblyhead_www project tooling
ark
parents:
diff changeset
105
71dd8d58a8e5 cleaned up re-init from net_wobblyhead_www project tooling
ark
parents:
diff changeset
106 The format is read from the content of the original. A PNG named `.gif` is
71dd8d58a8e5 cleaned up re-init from net_wobblyhead_www project tooling
ark
parents:
diff changeset
107 handled as a PNG, and its scaled copy is written as a PNG too, whatever the
71dd8d58a8e5 cleaned up re-init from net_wobblyhead_www project tooling
ark
parents:
diff changeset
108 extension says.
71dd8d58a8e5 cleaned up re-init from net_wobblyhead_www project tooling
ark
parents:
diff changeset
109
71dd8d58a8e5 cleaned up re-init from net_wobblyhead_www project tooling
ark
parents:
diff changeset
110 ### Scaled copies
71dd8d58a8e5 cleaned up re-init from net_wobblyhead_www project tooling
ark
parents:
diff changeset
111
71dd8d58a8e5 cleaned up re-init from net_wobblyhead_www project tooling
ark
parents:
diff changeset
112 Only the width is given; the aspect ratio is kept. The image is resampled
71dd8d58a8e5 cleaned up re-init from net_wobblyhead_www project tooling
ark
parents:
diff changeset
113 with the Lanczos filter.
71dd8d58a8e5 cleaned up re-init from net_wobblyhead_www project tooling
ark
parents:
diff changeset
114
71dd8d58a8e5 cleaned up re-init from net_wobblyhead_www project tooling
ark
parents:
diff changeset
115 A scaled copy keeps the colour profile of the original. The Exif orientation
71dd8d58a8e5 cleaned up re-init from net_wobblyhead_www project tooling
ark
parents:
diff changeset
116 is applied to the pixels first, then the Exif data is dropped. JPEG copies
71dd8d58a8e5 cleaned up re-init from net_wobblyhead_www project tooling
ark
parents:
diff changeset
117 are written at quality 85; other formats use the Pillow defaults.
71dd8d58a8e5 cleaned up re-init from net_wobblyhead_www project tooling
ark
parents:
diff changeset
118
71dd8d58a8e5 cleaned up re-init from net_wobblyhead_www project tooling
ark
parents:
diff changeset
119 An original narrower than the requested width is not scaled up. It is copied
71dd8d58a8e5 cleaned up re-init from net_wobblyhead_www project tooling
ark
parents:
diff changeset
120 unchanged under the requested name, with all its metadata, and the build
71dd8d58a8e5 cleaned up re-init from net_wobblyhead_www project tooling
ark
parents:
diff changeset
121 produces a warning.
71dd8d58a8e5 cleaned up re-init from net_wobblyhead_www project tooling
ark
parents:
diff changeset
122
71dd8d58a8e5 cleaned up re-init from net_wobblyhead_www project tooling
ark
parents:
diff changeset
123 ### Dimensions
71dd8d58a8e5 cleaned up re-init from net_wobblyhead_www project tooling
ark
parents:
diff changeset
124
71dd8d58a8e5 cleaned up re-init from net_wobblyhead_www project tooling
ark
parents:
diff changeset
125 Every local `img` in a page body, from Markdown or from HTML, gets `width`
71dd8d58a8e5 cleaned up re-init from net_wobblyhead_www project tooling
ark
parents:
diff changeset
126 and `height` attributes from the file that was placed. Images that already
71dd8d58a8e5 cleaned up re-init from net_wobblyhead_www project tooling
ark
parents:
diff changeset
127 have a `width` attribute, and images Pillow cannot open, such as SVG, are
71dd8d58a8e5 cleaned up re-init from net_wobblyhead_www project tooling
ark
parents:
diff changeset
128 left alone.
71dd8d58a8e5 cleaned up re-init from net_wobblyhead_www project tooling
ark
parents:
diff changeset
129
71dd8d58a8e5 cleaned up re-init from net_wobblyhead_www project tooling
ark
parents:
diff changeset
130 ## Link preview
71dd8d58a8e5 cleaned up re-init from net_wobblyhead_www project tooling
ark
parents:
diff changeset
131
71dd8d58a8e5 cleaned up re-init from net_wobblyhead_www project tooling
ark
parents:
diff changeset
132 ### The image
71dd8d58a8e5 cleaned up re-init from net_wobblyhead_www project tooling
ark
parents:
diff changeset
133
71dd8d58a8e5 cleaned up re-init from net_wobblyhead_www project tooling
ark
parents:
diff changeset
134 The preview image of a page is picked in this order:
71dd8d58a8e5 cleaned up re-init from net_wobblyhead_www project tooling
ark
parents:
diff changeset
135
71dd8d58a8e5 cleaned up re-init from net_wobblyhead_www project tooling
ark
parents:
diff changeset
136 1. The `image` header. An image of exactly 1200x630 is copied. Any other size
71dd8d58a8e5 cleaned up re-init from net_wobblyhead_www project tooling
ark
parents:
diff changeset
137 is cropped as described below, with a warning. A header that points
71dd8d58a8e5 cleaned up re-init from net_wobblyhead_www project tooling
ark
parents:
diff changeset
138 nowhere produces a warning, and the search goes on.
71dd8d58a8e5 cleaned up re-init from net_wobblyhead_www project tooling
ark
parents:
diff changeset
139 2. The first local image in the body that can be scaled and whose original is
71dd8d58a8e5 cleaned up re-init from net_wobblyhead_www project tooling
ark
parents:
diff changeset
140 at least 600x315. The original is used, not the scaled copy the page
71dd8d58a8e5 cleaned up re-init from net_wobblyhead_www project tooling
ark
parents:
diff changeset
141 shows. Its alt text becomes the alt text of the preview.
71dd8d58a8e5 cleaned up re-init from net_wobblyhead_www project tooling
ark
parents:
diff changeset
142 3. None. The template names a default image, or writes no image tags.
71dd8d58a8e5 cleaned up re-init from net_wobblyhead_www project tooling
ark
parents:
diff changeset
143
71dd8d58a8e5 cleaned up re-init from net_wobblyhead_www project tooling
ark
parents:
diff changeset
144 600x315 is the smallest size Facebook still shows as a large card.
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 Cropping cuts the largest centred area with an aspect ratio of 1200:630 out
71dd8d58a8e5 cleaned up re-init from net_wobblyhead_www project tooling
ark
parents:
diff changeset
147 of the image. If that area is larger than 1200x630, it is scaled down to that
71dd8d58a8e5 cleaned up re-init from net_wobblyhead_www project tooling
ark
parents:
diff changeset
148 size; it is never scaled up. A portrait photo loses its top and bottom. Where
71dd8d58a8e5 cleaned up re-init from net_wobblyhead_www project tooling
ark
parents:
diff changeset
149 that cuts off the subject, a prepared image in the `image` header avoids it.
71dd8d58a8e5 cleaned up re-init from net_wobblyhead_www project tooling
ark
parents:
diff changeset
150 The preview keeps the format and colour profile of the original and loses
71dd8d58a8e5 cleaned up re-init from net_wobblyhead_www project tooling
ark
parents:
diff changeset
151 its Exif data, like a scaled copy.
71dd8d58a8e5 cleaned up re-init from net_wobblyhead_www project tooling
ark
parents:
diff changeset
152
71dd8d58a8e5 cleaned up re-init from net_wobblyhead_www project tooling
ark
parents:
diff changeset
153 The image is written next to the page output, in the directory `img`, as
71dd8d58a8e5 cleaned up re-init from net_wobblyhead_www project tooling
ark
parents:
diff changeset
154 `og_<source name>_<modification time><extension>`. For `first_steps.md` with
71dd8d58a8e5 cleaned up re-init from net_wobblyhead_www project tooling
ark
parents:
diff changeset
155 a JPEG this is, for example, `img/og_first_steps_1772371200.jpg`. The
71dd8d58a8e5 cleaned up re-init from net_wobblyhead_www project tooling
ark
parents:
diff changeset
156 modification time is that of the original image, in whole seconds since
71dd8d58a8e5 cleaned up re-init from net_wobblyhead_www project tooling
ark
parents:
diff changeset
157 1970. Consumers cache preview images by address, so a changed image gets a
71dd8d58a8e5 cleaned up re-init from net_wobblyhead_www project tooling
ark
parents:
diff changeset
158 new address. An existing file of that name is not written again.
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 ### Page head
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 The generator supplies the values; the templates write the tags. The example
71dd8d58a8e5 cleaned up re-init from net_wobblyhead_www project tooling
ark
parents:
diff changeset
163 template writes:
71dd8d58a8e5 cleaned up re-init from net_wobblyhead_www project tooling
ark
parents:
diff changeset
164
71dd8d58a8e5 cleaned up re-init from net_wobblyhead_www project tooling
ark
parents:
diff changeset
165 - `meta name="description"` from `metaDescription`
71dd8d58a8e5 cleaned up re-init from net_wobblyhead_www project tooling
ark
parents:
diff changeset
166 - `link rel="canonical"` from `pageUrl`
71dd8d58a8e5 cleaned up re-init from net_wobblyhead_www project tooling
ark
parents:
diff changeset
167 - `og:type` (`website`), `og:site_name`, `og:title`, `og:description`,
71dd8d58a8e5 cleaned up re-init from net_wobblyhead_www project tooling
ark
parents:
diff changeset
168 `og:url`
71dd8d58a8e5 cleaned up re-init from net_wobblyhead_www project tooling
ark
parents:
diff changeset
169 - `og:image`, `og:image:width`, `og:image:height`, `og:image:alt`
71dd8d58a8e5 cleaned up re-init from net_wobblyhead_www project tooling
ark
parents:
diff changeset
170 - `twitter:card` (`summary_large_image`)
71dd8d58a8e5 cleaned up re-init from net_wobblyhead_www project tooling
ark
parents:
diff changeset
171
71dd8d58a8e5 cleaned up re-init from net_wobblyhead_www project tooling
ark
parents:
diff changeset
172 The addresses are absolute and built from `site_url`. A page named
71dd8d58a8e5 cleaned up re-init from net_wobblyhead_www project tooling
ark
parents:
diff changeset
173 `index.html` is addressed by its directory: `src/index.md` becomes
71dd8d58a8e5 cleaned up re-init from net_wobblyhead_www project tooling
ark
parents:
diff changeset
174 `https://www.example.org/`, not `https://www.example.org/index.html`. A
71dd8d58a8e5 cleaned up re-init from net_wobblyhead_www project tooling
ark
parents:
diff changeset
175 server delivers the same page either way, but consumers treat the two
71dd8d58a8e5 cleaned up re-init from net_wobblyhead_www project tooling
ark
parents:
diff changeset
176 addresses as two pages.
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 ## Tag index pages
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 There is one tag index page per tag, in the build root. It lists only pages
71dd8d58a8e5 cleaned up re-init from net_wobblyhead_www project tooling
ark
parents:
diff changeset
181 selected for this build and rendered: published pages, and unpublished ones in
71dd8d58a8e5 cleaned up re-init from net_wobblyhead_www project tooling
ark
parents:
diff changeset
182 draft mode. A build of part of the site therefore writes incomplete tag index
71dd8d58a8e5 cleaned up re-init from net_wobblyhead_www project tooling
ark
parents:
diff changeset
183 pages, and they replace complete ones from an earlier build. Tag index pages
71dd8d58a8e5 cleaned up re-init from net_wobblyhead_www project tooling
ark
parents:
diff changeset
184 are always written, without a date check.
71dd8d58a8e5 cleaned up re-init from net_wobblyhead_www project tooling
ark
parents:
diff changeset
185
71dd8d58a8e5 cleaned up re-init from net_wobblyhead_www project tooling
ark
parents:
diff changeset
186 ## Link checking
71dd8d58a8e5 cleaned up re-init from net_wobblyhead_www project tooling
ark
parents:
diff changeset
187
71dd8d58a8e5 cleaned up re-init from net_wobblyhead_www project tooling
ark
parents:
diff changeset
188 Links are checked after all pages have been written. A link is valid if its
71dd8d58a8e5 cleaned up re-init from net_wobblyhead_www project tooling
ark
parents:
diff changeset
189 target exists in the build directory, so pages built later in the same run
71dd8d58a8e5 cleaned up re-init from net_wobblyhead_www project tooling
ark
parents:
diff changeset
190 count.
71dd8d58a8e5 cleaned up re-init from net_wobblyhead_www project tooling
ark
parents:
diff changeset
191
71dd8d58a8e5 cleaned up re-init from net_wobblyhead_www project tooling
ark
parents:
diff changeset
192 Only internal links are checked: links in the body, image references, and
71dd8d58a8e5 cleaned up re-init from net_wobblyhead_www project tooling
ark
parents:
diff changeset
193 the `crossref` header.
71dd8d58a8e5 cleaned up re-init from net_wobblyhead_www project tooling
ark
parents:
diff changeset
194
71dd8d58a8e5 cleaned up re-init from net_wobblyhead_www project tooling
ark
parents:
diff changeset
195 Unpublished pages are not built, so a link to one produces a warning, as
71dd8d58a8e5 cleaned up re-init from net_wobblyhead_www project tooling
ark
parents:
diff changeset
196 does a link to a file that does not exist. In draft mode these warnings
71dd8d58a8e5 cleaned up re-init from net_wobblyhead_www project tooling
ark
parents:
diff changeset
197 disappear.
71dd8d58a8e5 cleaned up re-init from net_wobblyhead_www project tooling
ark
parents:
diff changeset
198
71dd8d58a8e5 cleaned up re-init from net_wobblyhead_www project tooling
ark
parents:
diff changeset
199 When only part of the site is built, only the links of the selected pages
71dd8d58a8e5 cleaned up re-init from net_wobblyhead_www project tooling
ark
parents:
diff changeset
200 are checked. Targets left from an earlier build count as present. Built into
71dd8d58a8e5 cleaned up re-init from net_wobblyhead_www project tooling
ark
parents:
diff changeset
201 a clean directory, a subset produces warnings for every link outside it.