Update website setup to use latest version of Docusaurus (#2614)

* Update website to new docusaurus API

* Fix missing comma

* Fix link typo in users.json

* Update docusaurus to version 1.0.0-alpha.35

* Clean up siteConfig.js
master
Frank Li 2017-08-11 12:34:32 -07:00 committed by Christopher Chedeau
parent d8b5fe2de9
commit dace9ecded
10 changed files with 14 additions and 75 deletions

View File

@ -1 +0,0 @@
prettier.io

View File

@ -1,10 +1,6 @@
---
id: editors
title: Editor Integration
layout: docs
category: Prettier
permalink: docs/en/editors.html
previous: options
---

View File

@ -1,11 +1,6 @@
---
id: options
title: Options
layout: docs
category: Prettier
permalink: docs/en/options.html
previous: usage
next: editors
---
Prettier ships with a handful of customizable format options, usable in both the CLI and API.

View File

@ -1,11 +1,6 @@
---
id: usage
title: Usage
layout: docs
category: Prettier
permalink: docs/en/usage.html
previous: why-prettier
next: options
---

View File

@ -1,10 +1,6 @@
---
id: why-prettier
title: Why Prettier?
layout: docs
category: Prettier
permalink: docs/en/why-prettier.html
next: usage
---
## Building and enforcing a style guide

View File

@ -5,6 +5,6 @@
"publish-gh-pages": "docusaurus-publish"
},
"devDependencies": {
"docusaurus": "^1.0.0-alpha.9"
"docusaurus": "^1.0.0-alpha.35"
}
}

5
website/sidebars.json Normal file
View File

@ -0,0 +1,5 @@
{
"docs": {
"Prettier": ["why-prettier", "usage", "options", "editors"]
}
}

View File

@ -1,7 +1,5 @@
"use strict";
const fs = require("fs");
const PACKAGE = require("../package");
const GITHUB_URL = `https://github.com/${PACKAGE.repository}`;
@ -16,45 +14,21 @@ const siteConfig = {
baseUrl: "/",
projectName: PACKAGE.name,
repo: PACKAGE.repository,
cname: "prettier.io",
users,
editors,
supportedLanguages,
/* base url for editing docs, usage example: editUrl + 'en/doc1.md' */
editUrl: `${GITHUB_URL}/edit/master/docs/`,
/* header links for links on this site, 'LANGUAGE' will be replaced by whatever
language the page is for, ex: 'en' */
headerLinksInternal: [
{
section: "docs",
href: "/docs/LANGUAGE/why-prettier.html",
text: "Docs"
},
// { section: "help", href: "/LANGUAGE/help/", text: "Help" },
// {section: 'blog', href: '/test-site/blog', text: 'Blog'},
{
section: "playground",
href: "/playground/",
text: "Playground"
}
],
/* header links for links outside the site */
headerLinksExternal: [
{
section: "github",
href: GITHUB_URL,
text: "GitHub"
}
headerLinks: [
{ doc: "why-prettier", label: "Docs" },
{ href: "/playground/", label: "Playground" },
{ href: GITHUB_URL, label: "GitHub" }
],
/* path to images for header/footer */
headerIcon: "icon.png",
footerIcon: "icon.png",
favicon: "icon.png",
/* default link for docsSidebar */
docsSidebarDefaults: {
layout: "docs",
root: "/docs/en/why-prettier.html",
title: "Docs"
},
/* colors for website */
colors: {
primaryColor: "#1A2B34",
@ -62,28 +36,8 @@ const siteConfig = {
prismColor:
"rgba(26, 43, 52, 0.03)" /* primaryColor in rgba form, with 0.03 alpha */
},
tagline: "Opinionated Code Formatter"
tagline: "Opinionated Code Formatter",
useEnglishUrl: true
};
let languages;
if (fs.existsSync("./languages.js")) {
languages = require("./languages.js");
siteConfig["en"] = require("./i18n/en.js");
} else {
languages = [
{
enabled: true,
name: "English",
tag: "en"
}
];
}
const enabledLanguages = languages.filter(lang => lang.enabled);
siteConfig.languages = enabledLanguages;
/* INJECT LOCALIZED FILES BEGIN */
/* INJECT LOCALIZED FILES END */
module.exports = siteConfig;

View File

@ -1 +0,0 @@
prettier.io

View File

@ -20,7 +20,7 @@
{
"caption": "Babel",
"image": "/images/babel-200x100.png",
"infoLink": "https://babeljs.jo",
"infoLink": "https://babeljs.io",
"pinned": true
},
{