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 3 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
17 changes: 9 additions & 8 deletions auspice-client/customisations/navbar.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
/* eslint-disable no-multi-spaces */
import React from "react"; // eslint-disable-line
import { FaExternalLinkAlt } from "react-icons/fa";
import LanguageSelector from "./languageSelector";

const logoPNG = require("./nextstrain-logo-small.png");
Expand Down Expand Up @@ -59,9 +60,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 All @@ -88,12 +89,12 @@ class WhoAmI extends React.Component {
const styles = getStyles({minified: this.props.sidebar});

if (this.state.user === undefined) return null;

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 +124,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} target="_blank" rel="noopener noreferrer" text={<React.Fragment>DOCS <FaExternalLinkAlt/></React.Fragment>}/>
jameshadfield marked this conversation as resolved.
Show resolved Hide resolved
<Link href="https://docs.nextstrain.org/en/latest/learn/about-nextstrain.html" style={styles.link} target="_blank" rel="noopener noreferrer" text={<React.Fragment>HELP <FaExternalLinkAlt/></React.Fragment>}/>
<WhoAmI sidebar={sidebar}/>
</div>
)
Expand Down
36 changes: 36 additions & 0 deletions redirects.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,42 @@ 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/getting-started/introduction": `${mainReadTheDocs}/learn/about-nextstrain.html`,
"/docs/getting-started/local-installation": `${mainReadTheDocs}/guides/install/local-installation.html`,
"/docs/getting-started/local-vs-container-install": `${mainReadTheDocs}/guides/install/index.html`,
"/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/what-is-a-build": `${augurReadTheDocs}/faq/what-is-a-build.html`,
"/docs/bioinformatics/data-formats": `${mainReadTheDocs}/reference/formats/data-formats.html`,
"/docs/tutorials/defining-clades": `${mainReadTheDocs}/guides/bioinformatics/defining-clades.html`,
"/docs/tutorials/zika": `${mainReadTheDocs}/tutorials/zika.html`,
"/docs/contributing/community-builds": `${mainReadTheDocs}/guides/share/community-builds.html`,
"/docs/contributing/documentation": `${mainReadTheDocs}/guides/contribute/documentation.html`,
"/docs/contributing/fetch-data-from-custom-urls": `${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/visualisation/download-data": `${mainReadTheDocs}/guides/share/download-data.html`,
"/docs/visualisation/map-interpretation": `${mainReadTheDocs}/learn/interpret/map-interpretation.html`,
"/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`,
"/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