Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Redirect /docs and /help to docs.nextstrain.org #226

Merged
merged 10 commits into from
Nov 12, 2020
Merged
Show file tree
Hide file tree
Changes from 7 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions auspice-client/customisations/navbar.js
Original file line number Diff line number Diff line change
Expand Up @@ -59,9 +59,9 @@ const getStyles = ({minified=true, width}={}) => ({
}
});

const renderLink = (text, url, style) => (
<a key={text} style={style} href={url}>
{text}
const Link = (props) => (
<a key={props.text} href={props.href} style={props.style} target={props.target} rel={props.rel}>
{props.text}
</a>
);

Expand Down Expand Up @@ -92,8 +92,8 @@ class WhoAmI extends React.Component {
return (
<div>
{ this.state.user
? renderLink(`👤 ${this.state.user.username}`, "/whoami", styles.link)
: renderLink("LOGIN", "/login", styles.link) }
? <Link text={`👤 ${this.state.user.username}`} href="/whoami" style={styles.link}/>
: <Link text="LOGIN" href="/login" style={styles.link}/> }
</div>
);
}
Expand Down Expand Up @@ -123,8 +123,8 @@ const NavBar = ({sidebar, narrativeTitle, width}) => {
null : (
<div style={{...styles.flexColumns, paddingRight: "12px"}}>
<div style={{flex: 5}}/>
{renderLink("DOCS", "/docs", styles.link)}
{renderLink("HELP", "/help", styles.link)}
<Link href="https://docs.nextstrain.org/en/latest/index.html" style={styles.link} text="DOCS"/>
<Link href="https://docs.nextstrain.org/en/latest/learn/about-nextstrain.html" style={styles.link} text="HELP"/>
<WhoAmI sidebar={sidebar}/>
</div>
)
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@
"passport": "^0.4.0",
"passport-oauth2": "^1.5.0",
"query-string": "^4.2.3",
"react-icons": "^3.11.0",
"request": "^2.88.0",
"serve-favicon": "^2.5.0",
"session-file-store": "^1.3.1",
Expand Down
65 changes: 63 additions & 2 deletions redirects.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ const { parseNarrativeLanguage } = require("./src/utils");

const setup = (app) => {

/* send auspice to the auspice docs (currently hosted as github pages) */
/* send auspice to the auspice docs (currently hosted on docs.nextstrain.org) */
app.route("/auspice")
.get((req, res) => res.redirect('https://nextstrain.github.io/auspice/'));
.get((req, res) => res.redirect('https://docs.nextstrain.org/projects/auspice/en/migrate-docs/'));

/* we don't yet have a community page */
app.route("/community")
Expand Down Expand Up @@ -52,6 +52,67 @@ const setup = (app) => {
conflates a language part ("zh") with a region ("europe") so we want to keep zh out of the manifest JSON */
jameshadfield marked this conversation as resolved.
Show resolved Hide resolved
app.route("/ncov/zh").get((req, res) => res.redirect("/ncov/global/zh"));

// DOCS, HELP Redirects for docs migration:
const mainReadTheDocs = "https://docs.nextstrain.org/en/latest";
const augurReadTheDocs = "https://docs.nextstrain.org/projects/augur/en/migrate-docs";
jameshadfield marked this conversation as resolved.
Show resolved Hide resolved

const docsRedirects = {
"/docs": `${mainReadTheDocs}`,
"/help": `${mainReadTheDocs}/learn/about-nextstrain.html`,
"/docs/getting-started/introduction": `${mainReadTheDocs}/learn/about-nextstrain.html`,
"/about": `${mainReadTheDocs}/learn/about-nextstrain.html`,
"/about/overview/introduction": `${mainReadTheDocs}/learn/about-nextstrain.html`,
"/about/overview": `${mainReadTheDocs}/learn/about-nextstrain.html`,
"/about/methods/introduction": `${mainReadTheDocs}/learn/about-nextstrain.html`,
"/about/methods": `${mainReadTheDocs}/learn/about-nextstrain.html`,
"/docs/getting-started/local-installation": `${mainReadTheDocs}/guides/install/local-installation.html`,
"/docs/getting-started/installation": `${mainReadTheDocs}/guides/install/local-installation.html`,
"/docs/getting-started/local-vs-container-install": `${mainReadTheDocs}/guides/install/index.html`,
"/docs/getting-started/container-installation": `${mainReadTheDocs}/cli/doc/installation.html`,
eharkins marked this conversation as resolved.
Show resolved Hide resolved
"/docs/getting-started/quickstart": `${mainReadTheDocs}/tutorials/quickstart.html`,
"/docs/getting-started/windows-help": `${mainReadTheDocs}/guides/install/windows-help.html`,
"/docs/bioinformatics/introduction-to-augur": `${augurReadTheDocs}/faq/introduction-to-augur.html`,
"/docs/bioinformatics/introduction": `${augurReadTheDocs}/faq/introduction-to-augur.html`,
"/docs/bioinformatics/what-is-a-build": `${augurReadTheDocs}/faq/what-is-a-build.html`,
"/docs/bioinformatics/data-formats": `${mainReadTheDocs}/reference/formats/data-formats.html`,
"/docs/bioinformatics/output-jsons": `${mainReadTheDocs}/reference/formats/data-formats.html`,
"/docs/bioinformatics/augur-commands": `${augurReadTheDocs}/usage/cli/cli.html`,
"/docs/bioinformatics/customizing-a-build": `${mainReadTheDocs}/guides/bioinformatics/index.html`,
"/docs/tutorials/defining-clades": `${mainReadTheDocs}/guides/bioinformatics/defining-clades.html`,
"/docs/tutorials/zika": `${mainReadTheDocs}/tutorials/zika.html`,
"/docs/getting-started/zika-tutorial": `${mainReadTheDocs}/tutorials/zika.html`,
"/docs/tutorials/tb": `${mainReadTheDocs}/augur/docs/tutorials/tb_tutorial.html`,
"/docs/getting-started/tb-tutorial": `${mainReadTheDocs}/augur/docs/tutorials/tb_tutorial.html`,
eharkins marked this conversation as resolved.
Show resolved Hide resolved
"/docs/contributing/community-builds": `${mainReadTheDocs}/guides/share/community-builds.html`,
"/docs/contributing/documentation": `${mainReadTheDocs}/guides/contribute/documentation.html`,
"/docs/contributing/development": `${mainReadTheDocs}/guides/contribute/index.html`,
"/docs/contributing/fetch-data-from-custom-urls": `${mainReadTheDocs}/guides/share/fetch-via-urls.html`,
"/fetch": `${mainReadTheDocs}/guides/share/fetch-via-urls.html`,
"/docs/contributing/nextstrain-groups": `${mainReadTheDocs}/guides/share/nextstrain-groups.html`,
"/docs/contributing/sharing-data": `${mainReadTheDocs}/guides/share/index.html`,
"/docs/contributing/philosophy": `${mainReadTheDocs}/guides/share/index.html`,
"/docs/visualisation/download-data": `${mainReadTheDocs}/guides/share/download-data.html`,
"/docs/visualisation/map-interpretation": `${mainReadTheDocs}/learn/interpret/map-interpretation.html`,
"/docs/visualisation/narratives": `${mainReadTheDocs}/auspice/docs/narratives/introduction.html`,
"/docs/narratives/introduction": `${mainReadTheDocs}/auspice/docs/narratives/introduction.html`,
eharkins marked this conversation as resolved.
Show resolved Hide resolved
"/help/general/about-nextstrain": `${mainReadTheDocs}/learn/about-nextstrain.html`,
"/help/general/how-to-read-a-tree": `${mainReadTheDocs}/learn/interpret/how-to-read-a-tree.html`,
"/help/general/interacting-with-nextstrain": `${mainReadTheDocs}/learn/interpret/interacting-with-nextstrain.html`,
"/docs/interpretation": `${mainReadTheDocs}/learn/interpret/index.html`,
"/docs/interpretation/auspice": `${mainReadTheDocs}/learn/interpret/index.html`,
"/docs/visualisation": `${mainReadTheDocs}/learn/interpret/index.html`,
"/docs/visualisation/introduction": `${mainReadTheDocs}/learn/interpret/index.html`,
"/help/coronavirus/FAQ": `${mainReadTheDocs}/learn/pathogens/coronavirus/FAQ.html`,
"/help/coronavirus/SARS-CoV-2": `${mainReadTheDocs}/learn/pathogens/coronavirus/SARS-CoV-2.html`,
"/help/coronavirus/Technical-FAQ": `${mainReadTheDocs}/learn/pathogens/coronavirus/Technical-FAQ.html`,
"/help/coronavirus/human-CoV": `${mainReadTheDocs}/learn/pathogens/coronavirus/human-CoV.html`
};
jameshadfield marked this conversation as resolved.
Show resolved Hide resolved

for (const [from, to] of Object.entries(docsRedirects)) {
app.route([from])
.get((req, res) => res.redirect(to));
}

};

module.exports = {
Expand Down
47 changes: 7 additions & 40 deletions static-site/additional_sidebar_entries.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,43 +6,10 @@
# (for me) to do it on the react side as that's where i'm more
# comfortable.
# james, June 2020.
- section: "docs"
chapter: "getting-started"
name: "Container Installation"
url: "https://docs.nextstrain.org/projects/cli/en/latest/installation/"
- section: "docs"
chapter: "tutorials"
name: "Analysing MTb (VCF) data"
url: "https://docs.nextstrain.org/projects/augur/en/stable/tutorials/tb_tutorial.html"
- section: "docs"
chapter: "tutorials"
name: "Analysing SARS-CoV-2 data"
url: "https://nextstrain.github.io/ncov/"
- section: "docs"
chapter: "bioinformatics"
name: "Augur Commands"
url: "https://docs.nextstrain.org/projects/augur/en/stable/usage/cli/cli.html"
- section: "docs"
chapter: "bioinformatics"
name: "Frequently Asked Questions"
url: "https://docs.nextstrain.org/projects/augur/en/stable/faq/faq.html"
- section: "docs"
chapter: "tutorials"
name: "Writing a Narrative"
url: "https://nextstrain.github.io/auspice/narratives/how-to-write"
- section: "docs"
chapter: "contributing"
name: "Development"
url: "https://github.com/nextstrain/.github/blob/master/CONTRIBUTING.md"
- section: "docs"
chapter: "visualisation"
name: "Interactive Narratives"
url: "https://nextstrain.github.io/auspice/narratives/introduction"
- section: "docs"
chapter: "visualisation"
name: "Drag & Drop Metadata"
url: "https://nextstrain.github.io/auspice/advanced-functionality/drag-drop-csv-tsv"
- section: "docs"
chapter: "visualisation"
name: "Display Multiple Trees"
url: "https://nextstrain.github.io/auspice/advanced-functionality/second-trees"
# After migrating all docs to docs.nextstrain.org, we no longer use this.
# eli, October 2020.
# Here is what it would look like if you wanted to add an external link sidebar entry using this file:
# - section: "docs"
# chapter: "getting-started"
# name: "Container Installation"
# url: "https://docs.nextstrain.org/projects/cli/en/latest/installation/"
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ The only complicated aspect is deciding whether to serve auspice or Gatsby files

**The static site:** can be found [here](https://github.com/nextstrain/static) and is build using [Gatsby](https://www.gatsbyjs.org/).
This comprises the splash page and documentation (docs, about, blogs etc) all build from markdown files.
[This page](/docs/static-content/introduction) explains the structure of the static page and shows how to add content – it's really easy ;).
[This page](https://github.com/nextstrain/nextstrain.org/tree/master/static-site#nextstrain-static-site) explains the structure of the static page and shows how to add content – it's really easy ;).


**Auspice:** is the visualisation app, build as a single page javascript application ([github](https://github.com/nextstrain/auspice)).
Expand Down
1 change: 1 addition & 0 deletions static-site/content/blog/2019-10-21-auspice-v2.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
author: "James Hadfield"
date: "2019-10-21"
title: "Auspice v2 released"
anchorText: "Auspice v2"
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's necessary to have at least one instance of anchorText or else gatsby will complain.

---

## What's New
Expand Down
87 changes: 0 additions & 87 deletions static-site/content/docs/01-getting-started/01-introduction.md

This file was deleted.

Loading