Skip to content
This repository has been archived by the owner on Feb 18, 2024. It is now read-only.

Switch documentation to mkdocs-material and host using Netlify #898

Merged
merged 1 commit into from
May 23, 2018

Conversation

edmorley
Copy link
Member

@edmorley edmorley commented May 23, 2018

After the recent Gitbook hosted beta bugs & lack of ability to customise, we're going to try using the static site generator mkdocs, along with the mkdocs-material theme:
http://www.mkdocs.org/
https://squidfunk.github.io/mkdocs-material/

The site will be hosted by Netlify, with each version of the docs being built from the respective branch, and served on different subdomains.

Notable changes with mkdocs-material compared to Gitbook:

  • Index pages must be named index.md not README.md
  • All pages are converted to pretty URLs. eg api.md becomes /api/, which makes the extra directory nesting for just one file (eg api/index.md) unnecessary.
  • External links are not supported in the sidebar, so placeholder pages have been added, for which there are redirects in netlify.yml.

Other changes:

  • Some existing links have been fixed to reference the .md file rather than the resultant URL, since otherwise mkdocs doesn't realise it's an internal link and performs no validation. (Though all links under packages/ have to stay as absolute links, since the READMEs need to work standalone when published to NPM.)
  • The duplicated content between packages/*/README.md and docs/packages/* has been resolved by making the latter symlink to the former.

Fixes #271.
Fixes #620.
Fixes #60.
Refs #892.

Copy link
Member

@eliperelman eliperelman left a comment

Choose a reason for hiding this comment

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

Feel free to merge after the netlify.yml rename.

docs/v7.md Outdated
@@ -0,0 +1,3 @@
Placeholder page to work around mkdocs/material's lack of support for
external links in the sidebar. Requests for this page will be redirected
to the URL specified in netlify.yml.
Copy link
Member

Choose a reason for hiding this comment

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

s/netlify.yml/netlify.toml/

docs/v5.md Outdated
@@ -0,0 +1,3 @@
Placeholder page to work around mkdocs/material's lack of support for
external links in the sidebar. Requests for this page will be redirected
to the URL specified in netlify.yml.
Copy link
Member

Choose a reason for hiding this comment

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

s/netlify.yml/netlify.toml/

docs/v6.md Outdated
@@ -0,0 +1,3 @@
Placeholder page to work around mkdocs/material's lack of support for
external links in the sidebar. Requests for this page will be redirected
to the URL specified in netlify.yml.
Copy link
Member

Choose a reason for hiding this comment

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

s/netlify.yml/netlify.toml/

docs/v4.md Outdated
@@ -0,0 +1,3 @@
Placeholder page to work around mkdocs/material's lack of support for
external links in the sidebar. Requests for this page will be redirected
to the URL specified in netlify.yml.
Copy link
Member

Choose a reason for hiding this comment

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

s/netlify.yml/netlify.toml/

mkdocs.yml Outdated
- style-minify: './packages/style-minify.md'
- stylelint: './packages/stylelint.md'
# External links aren't supported in the sidebar, so we link to a
# blank page that has a corresponding redirect in netlify.yml.
Copy link
Member

Choose a reason for hiding this comment

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

s/netlify.yml/netlify.toml/

@edmorley
Copy link
Member Author

edmorley commented May 23, 2018

I've updated the PR to:

  • s/netlify.yml/netlify.toml/ in comments
  • Update the redirects in netlify.toml:
    • the v4/v5/v6 redirects now target the newly created release/vN branches for consistency with v7/v8, rather than the docs-vN tags.
    • to add the https://neutrino.js.org -> https://neutrinojs.org redirect (though this won't take effect at the moment, since master isn't deployed to the Netlify "production" site yet).
  • Add a sidebar link to v8 (and corresponding redirect), since previously only v4-v7 were linked.

After the recent Gitbook hosted beta bugs & lack of ability to
customise, we're going to try using the static site generator mkdocs,
along with the mkdocs-material theme:
http://www.mkdocs.org/
https://squidfunk.github.io/mkdocs-material/

The site will be hosted by Netlify, with each version of the docs being
built from the respective branch, and served on different subdomains.

Notable changes with mkdocs-material compared to Gitbook:
* Index pages must be named `index.md` not `README.md`
* All pages are converted to pretty URLs. eg `api.md` becomes `/api/`,
  which makes the extra directory nesting for just one file
  (eg `api/index.md`) unnecessary.
* External links are not supported in the sidebar, so placeholder pages
  have been added, for which there are redirects in netlify.yml.

Other changes:
* Some existing links have been fixed to reference the `.md` file rather
  than the resultant URL, since otherwise mkdocs doesn't realise it's an
  internal link and performs no validation. (Though all links under
  `packages/` have to stay as absolute links, since the READMEs need to
  work standalone when published to NPM.)
* The duplicated content between `packages/*/README.md` and
  `docs/packages/*` has been resolved by making the latter symlink to
  the former.

Fixes #271.
Fixes #620.
Fixes #60.
Refs #892.
@edmorley edmorley merged commit 30dde2b into master May 23, 2018
@edmorley edmorley deleted the new-docs branch May 23, 2018 15:48
@edmorley
Copy link
Member Author

Now deployed at:
https://master.neutrinojs.org/

@edmorley edmorley added this to the v9 milestone May 23, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
2 participants