Skip to content

Commit d303172

Browse files
authored
Merge pull request #3997 from rust-lang/robots-infra
infra: add robots.txt for GH Pages previews
2 parents 98dd2c1 + de6e35c commit d303172

File tree

3 files changed

+16
-0
lines changed

3 files changed

+16
-0
lines changed

ADMIN_TASKS.md

+10
Original file line numberDiff line numberDiff line change
@@ -133,3 +133,13 @@ $ dot dot/trpl04-01.dot -Tsvg > src/img/trpl04-01.svg
133133
In the generated SVG, remove the width and the height attributes from the `svg`
134134
element and set the `viewBox` attribute to `0.00 0.00 1000.00 1000.00` or other
135135
values that don't cut off the image.
136+
137+
## Publish a preview to GitHub Pages
138+
139+
We sometimes publish to GitHub Pages for in-progress previews. The recommended
140+
flow for publishing is:
141+
142+
- Install the `ghp-import` tool by running `pip install ghp-import` (or `pipx install ghp-import`, using [pipx][pipx]).
143+
- In the root, run `tools/generate-preview.sh`
144+
145+
[pipx]: https://pipx.pypa.io/stable/#install-pipx

tools/generate-preview.sh

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
#!/usr/bin/env bash
2+
3+
mdbook build
4+
cp ./tools/preview-robots.txt ./book/robots.txt

tools/preview-robots.txt

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
User-agent: *
2+
Disallow: /

0 commit comments

Comments
 (0)