Skip to content

Commit

Permalink
Set up docs redirects
Browse files Browse the repository at this point in the history
Create a redirects file and set up automation to apply it to the RTD
project.

The file is initialized with existing redirects, fetched with:

    rtd --json projects nextstrain-augur redirects \
      | yq '.[] | [{"type": "page", "from_url": .from_url, "to_url": .to_url}]' \
      | sed 's/"//g'
  • Loading branch information
victorlin committed Nov 7, 2022
1 parent 64ec6dc commit bb92189
Show file tree
Hide file tree
Showing 2 changed files with 87 additions and 0 deletions.
30 changes: 30 additions & 0 deletions .github/workflows/sync-redirects.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: Sync RTD redirects

on:
push:
branches:
- master
paths:
- docs/redirects.yaml
- .github/workflows/sync-redirects.yaml

# Manually triggered using GitHub's UI
workflow_dispatch:

jobs:
sync:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4

- name: Upgrade Python toolchain
run: python3 -m pip install --upgrade pip setuptools wheel

- name: Install readthedocs-cli
run: python3 -m pip install readthedocs-cli

- name: Sync redirects
run: rtd projects nextstrain-augur redirects sync -f docs/redirects.yaml --wet-run
env:
RTD_TOKEN: ${{ secrets.RTD_TOKEN }}
57 changes: 57 additions & 0 deletions docs/redirects.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
# Authoritative list of redirects we have configured in RTD. See the
# docs.nextstrain.org repo's README.md¹ for more information on maintaining
# redirects.
#
# ¹ https://github.com/nextstrain/docs.nextstrain.org#configuring-redirects
---
- type: page
from_url: /faq/augur_snakemake.html
to_url: https://docs.nextstrain.org/en/latest/guides/bioinformatics/augur_snakemake.html

- type: page
from_url: /faq/colors.html
to_url: https://docs.nextstrain.org/en/latest/guides/bioinformatics/colors.html

- type: page
from_url: /faq/community_hosting.html
to_url: https://docs.nextstrain.org/en/latest/guides/share/community-builds.html

- type: page
from_url: /faq/fasta_input.html
to_url: https://docs.nextstrain.org/en/latest/guides/bioinformatics/fasta_input.html

- type: page
from_url: /faq/import-beast.html
to_url: https://docs.nextstrain.org/en/latest/guides/bioinformatics/import-beast.html

- type: page
from_url: /faq/lat_longs.html
to_url: https://docs.nextstrain.org/en/latest/guides/bioinformatics/lat_longs.html

- type: page
from_url: /faq/seq_traits.html
to_url: https://docs.nextstrain.org/en/latest/guides/bioinformatics/seq_traits.html

- type: page
from_url: /faq/translate_ref.html
to_url: https://docs.nextstrain.org/en/latest/guides/bioinformatics/translate_ref.html

- type: page
from_url: /faq/vcf_input.html
to_url: https://docs.nextstrain.org/en/latest/guides/bioinformatics/vcf_input.html

- type: page
from_url: /tutorials/tb_tutorial.html
to_url: https://docs.nextstrain.org/en/latest/tutorials/tb_tutorial.html

- type: page
from_url: /tutorials/tutorials.html
to_url: https://docs.nextstrain.org/en/latest/tutorials/index.html

- type: page
from_url: /tutorials/zika_tutorial.html
to_url: https://docs.nextstrain.org/en/latest/tutorials/zika_tutorial.html

- type: page
from_url: /usage/augur_snakemake.html
to_url: https://docs.nextstrain.org/en/latest/guides/bioinformatics/augur_snakemake.html

0 comments on commit bb92189

Please sign in to comment.