Skip to content

Commit

Permalink
Merge pull request #3997 from rust-lang/robots-infra
Browse files Browse the repository at this point in the history
infra: add robots.txt for GH Pages previews
  • Loading branch information
chriskrycho authored Jul 31, 2024
2 parents 98dd2c1 + de6e35c commit d303172
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 0 deletions.
10 changes: 10 additions & 0 deletions ADMIN_TASKS.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 changes: 4 additions & 0 deletions tools/generate-preview.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/usr/bin/env bash

mdbook build
cp ./tools/preview-robots.txt ./book/robots.txt
2 changes: 2 additions & 0 deletions tools/preview-robots.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
User-agent: *
Disallow: /

0 comments on commit d303172

Please sign in to comment.