diff --git a/docs/doc-markdown.md b/docs/doc-markdown.md index 760d74d992..077e77fa5d 100644 --- a/docs/doc-markdown.md +++ b/docs/doc-markdown.md @@ -1,6 +1,6 @@ --- id: doc-markdown -title: Documentation Markdown Features +title: Markdown Features --- Docusaurus supports some extra features when writing documentation in markdown. diff --git a/docs/search.md b/docs/search.md index 71b78bbd66..253374ac59 100644 --- a/docs/search.md +++ b/docs/search.md @@ -1,6 +1,6 @@ --- id: search -title: Documentation Search +title: Enabling Search --- ## Algolia Search Integration @@ -19,4 +19,3 @@ const siteConfig = { ... } ``` - diff --git a/docs/site-config.md b/docs/site-config.md index 6297ebec57..af352d2086 100644 --- a/docs/site-config.md +++ b/docs/site-config.md @@ -1,6 +1,6 @@ --- id: site-config -title: Customizing siteConfig +title: siteConfig.js --- A large part of site configuration is done by editing the `siteConfig.js` file. @@ -122,10 +122,9 @@ const siteConfig = { "0f9f28b9ab9efae89810921a351753b5", indexName: "github" } - gaTrackingId: "U-A2352" + gaTrackingId: "U-A2352" }; module.exports = siteConfig; ``` - diff --git a/docs/translation.md b/docs/translation.md index 24d8ded293..c3deb7ce6c 100644 --- a/docs/translation.md +++ b/docs/translation.md @@ -1,6 +1,6 @@ --- id: translation -title: Translations with Docusaurus +title: Translations --- ## Overview diff --git a/lib/core/DocsSidebar.js b/lib/core/DocsSidebar.js index d49604028e..83ab10d5a7 100644 --- a/lib/core/DocsSidebar.js +++ b/lib/core/DocsSidebar.js @@ -18,6 +18,10 @@ class DocsSidebar extends React.Component { render() { let sidebar = this.props.metadata.sidebar; let docsCategories = readCategories(sidebar); + const categoryName = docsCategories[this.props.metadata.language][0].name; + if (!categoryName) { + return null; + } return ( { @@ -123,18 +123,20 @@ function processMetadata(file) { const order = readSidebar(); const id = metadata.localized_id; - metadata.sidebar = order[id].sidebar; - metadata.category = order[id].category; + if (order[id]) { + metadata.sidebar = order[id].sidebar; + metadata.category = order[id].category; - if (order[id].next) { - metadata.next_id = order[id].next; - metadata.next = language + "-" + order[id].next; + if (order[id].next) { + metadata.next_id = order[id].next; + metadata.next = language + "-" + order[id].next; + } + if (order[id].previous) { + metadata.previous_id = order[id].previous; + metadata.previous = language + "-" + order[id].previous; + } } - if (order[id].previous) { - metadata.previous_id = order[id].previous; - metadata.previous = language + "-" + order[id].previous; - } - + return { metadata, rawContent: rawContent }; } diff --git a/lib/write-translations.js b/lib/write-translations.js index 24c46f1514..d0e4533a48 100755 --- a/lib/write-translations.js +++ b/lib/write-translations.js @@ -20,7 +20,7 @@ const path = require("path"); const siteConfig = require(CWD + "/siteConfig.js"); const babylon = require("babylon"); const traverse = require("babel-traverse").default; -const sidebar = require(CWD + "/sidebar.json"); +const sidebars = require(CWD + "/sidebars.json"); function writeFileAndCreateFolder(file, content) { mkdirp.sync(file.replace(new RegExp("/[^/]*$"), "")); @@ -67,8 +67,8 @@ function execute() { } /* find sidebar category titles to translate */ - Object.keys(sidebar).forEach(sb => { - const categories = sidebar[sb]; + Object.keys(sidebars).forEach(sb => { + const categories = sidebars[sb]; Object.keys(categories).forEach(category => { translations["localized-strings"][category] = category; }); diff --git a/website/pages/en/index.js b/website/pages/en/index.js index 9f3e9534e3..eb3b21740c 100755 --- a/website/pages/en/index.js +++ b/website/pages/en/index.js @@ -94,24 +94,24 @@ class Index extends React.Component { contents={[ { content: - "Write all of your documentation and blog posts in Markdown and have it built into a website you can publish", + "Save time and focus on your project's documentation. Simply write docs and blog posts with Markdown and Docusaurus will publish a set of static html files ready to serve.", image: `${siteConfig.baseUrl}img/markdown.png`, imageAlign: "top", - title: "Markdown Documentation" + title: "Powered by Markdown" }, { content: - "Write the content of your main pages as React components that automatically share a header and footer", + "Extend or customize your project's layout by reusing React. Docusaurus can be extended while reusing the same header and footer.", image: `${siteConfig.baseUrl}img/react.svg`, imageAlign: "top", - title: "React Main Pages" + title: "Built Using React" }, { content: - "Translate your docs and your website using Crowdin integration", + "Localization comes pre-configured. Use Crowdin to translate your docs into over 70 languages.", image: `${siteConfig.baseUrl}img/translation.svg`, imageAlign: "top", - title: "Translations" + title: "Ready for Translations" } ]} layout="threeColumn" @@ -123,14 +123,14 @@ class Index extends React.Component { contents={[ { content: - "Support users of all versions by easily providing documentation for each version of your program", + "Support users on all versions of your project. Document Versioning helps you keep documentation in sync with project releases.", image: `${siteConfig.baseUrl}img/docusaurus.svg`, imageAlign: "top", - title: "Versioning" + title: "Document Versioning" }, { content: - "Provide search for your documentation using Algolia DocSearch integration", + "Make it easy for your community to find what they need in your documentation. Currently supports Algolia DocSearch.", image: `${siteConfig.baseUrl}img/docusaurus.svg`, imageAlign: "top", title: "Document Search" @@ -144,7 +144,7 @@ class Index extends React.Component { contents={[ { content: - "The provided site template lets you get a website for your project up and running quickly without having having to worry about all the site design. Provided example files help you configure your site.", + "Get up and running quickly without having having to worry about site design.", imageAlign: "right", image: `${siteConfig.baseUrl}img/docusaurus.svg`, title: "Quick Setup" @@ -158,10 +158,10 @@ class Index extends React.Component { contents={[ { content: - "Use a local server to see how file changes affect your website without having to reload the server. Publish your site to GitHub pages manually using a script or with continuous integration like CircleCI.", + "Make design and documentation changes by using the included live server. Publish your site to GitHub pages or other static file hosts manually, using a script, or with continuous integration like CircleCI.", imageAlign: "left", - image: `${siteConfig.baseUrl}img/docusaurus.svg`, - title: "Development and Deployment" + image: `${siteConfig.baseUrl}img/docusaurus_live.webp`, + title: "Develop and Deploy" } ]} layout="twoColumn" diff --git a/website/sidebar.json b/website/sidebars.json similarity index 100% rename from website/sidebar.json rename to website/sidebars.json diff --git a/website/static/img/docusaurus_live.webp b/website/static/img/docusaurus_live.webp new file mode 100644 index 0000000000..9b221d705e Binary files /dev/null and b/website/static/img/docusaurus_live.webp differ