infra: add robots.txt for GH Pages previews

Block *everything*. We do not want any of this to be indexed, because we
*only* use it for previews, and do not want its content to be cached or
(especially!) surfaced to readers, since it may have a variety of issues
ranging from pedagogical missteps to outright errors!
This commit is contained in:
Chris Krycho
2024-07-31 07:05:42 -06:00
parent 98dd2c1d7f
commit de6e35c52f
3 changed files with 16 additions and 0 deletions
+10
View File
@@ -133,3 +133,13 @@ $ dot dot/trpl04-01.dot -Tsvg > src/img/trpl04-01.svg
In the generated SVG, remove the width and the height attributes from the `svg`
element and set the `viewBox` attribute to `0.00 0.00 1000.00 1000.00` or other
values that don't cut off the image.
## Publish a preview to GitHub Pages
We sometimes publish to GitHub Pages for in-progress previews. The recommended
flow for publishing is:
- Install the `ghp-import` tool by running `pip install ghp-import` (or `pipx install ghp-import`, using [pipx][pipx]).
- In the root, run `tools/generate-preview.sh`
[pipx]: https://pipx.pypa.io/stable/#install-pipx
+4
View File
@@ -0,0 +1,4 @@
#!/usr/bin/env bash
mdbook build
cp ./tools/preview-robots.txt ./book/robots.txt
+2
View File
@@ -0,0 +1,2 @@
User-agent: *
Disallow: /