Skip to content

Commit

Permalink
Update website setup to use latest version of Docusaurus (prettier#2614)
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
Frank Li authored and vjeux committed Aug 11, 2017
1 parent d8b5fe2 commit dace9ec
Show file tree
Hide file tree
Showing 10 changed files with 14 additions and 75 deletions.
1 change: 0 additions & 1 deletion docs/CNAME

This file was deleted.

4 changes: 0 additions & 4 deletions docs/en/editors.md → docs/editors.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
---
id: editors
title: Editor Integration
layout: docs
category: Prettier
permalink: docs/en/editors.html
previous: options
---


Expand Down
5 changes: 0 additions & 5 deletions docs/en/options.md → docs/options.md
Original file line number Diff line number Diff line change
@@ -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.
Expand Down
5 changes: 0 additions & 5 deletions docs/en/usage.md → docs/usage.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,6 @@
---
id: usage
title: Usage
layout: docs
category: Prettier
permalink: docs/en/usage.html
previous: why-prettier
next: options
---


Expand Down
4 changes: 0 additions & 4 deletions docs/en/why-prettier.md → docs/why-prettier.md
Original file line number Diff line number Diff line change
@@ -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
Expand Down
2 changes: 1 addition & 1 deletion website/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,6 @@
"publish-gh-pages": "docusaurus-publish"
},
"devDependencies": {
"docusaurus": "^1.0.0-alpha.9"
"docusaurus": "^1.0.0-alpha.35"
}
}
5 changes: 5 additions & 0 deletions website/sidebars.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"docs": {
"Prettier": ["why-prettier", "usage", "options", "editors"]
}
}
60 changes: 7 additions & 53 deletions website/siteConfig.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
"use strict";

const fs = require("fs");

const PACKAGE = require("../package");
const GITHUB_URL = `https://github.com/${PACKAGE.repository}`;

Expand All @@ -16,74 +14,30 @@ 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",
secondaryColor: "#808080",
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;
1 change: 0 additions & 1 deletion website/static/CNAME

This file was deleted.

2 changes: 1 addition & 1 deletion website/users.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
{
"caption": "Babel",
"image": "/images/babel-200x100.png",
"infoLink": "https://babeljs.jo",
"infoLink": "https://babeljs.io",
"pinned": true
},
{
Expand Down

0 comments on commit dace9ec

Please sign in to comment.