mirror of
https://github.com/facebook/docusaurus.git
synced 2025-05-12 16:47:26 +02:00
parent
947e4b4fa6
commit
97e7f66c20
2075 changed files with 128594 additions and 5438 deletions
|
@ -12,7 +12,7 @@
|
|||
{"zIndex":100}
|
||||
)
|
||||
});
|
||||
</script><link rel="stylesheet" href="/css/main.css"/></head><body class="sideNavVisible doc separateOnPageNav"><div class="fixedHeaderContainer"><div class="headerWrapper wrapper"><header><a href="/en"><img class="logo" src="/img/docusaurus.svg" alt="Docusaurus"/><h2 class="headerTitleWithLogo">Docusaurus</h2></a><a href="/en/versions.html"><h3>next</h3></a><div class="navigationWrapper navigationSlider"><nav class="slidingNav"><ul class="nav-site nav-site-internal"><li class="siteNavGroupActive"><a href="/docs/en/next/installation.html" target="_self">Docs</a></li><li class=""><a href="/en/help.html" target="_self">Help</a></li><li class=""><a href="/en/users.html" target="_self">Users</a></li><li class=""><a href="/en/about-slash.html" target="_self">About /</a></li><li class=""><a href="/blog" target="_self">Blog</a></li><li class=""><a href="https://github.com/facebook/docusaurus" target="_self">GitHub</a></li><span><li><a id="languages-menu" href="#"><img class="languages-icon" src="/img/language.svg"/>English</a><div id="languages-dropdown" class="hide"><ul id="languages-dropdown-items"><li><a href="/es-ES">Español</a></li><li><a href="/ro">Română</a></li><li><a href="/tr">Türkçe</a></li><li><a href="/zh-CN">简体中文</a></li><li><a href="https://crowdin.com/project/docusaurus" target="_blank" rel="noreferrer noopener">Help Translate</a></li></ul></div></li><script>
|
||||
</script><link rel="stylesheet" href="/css/main.css"/></head><body class="sideNavVisible doc separateOnPageNav"><div class="fixedHeaderContainer"><div class="headerWrapper wrapper"><header><a href="/en"><img class="logo" src="/img/docusaurus.svg" alt="Docusaurus"/><h2 class="headerTitleWithLogo">Docusaurus</h2></a><a href="/en/versions.html"><h3>next</h3></a><div class="navigationWrapper navigationSlider"><nav class="slidingNav"><ul class="nav-site nav-site-internal"><li class="siteNavGroupActive"><a href="/docs/en/next/installation" target="_self">Docs</a></li><li class=""><a href="/en/help" target="_self">Help</a></li><li class=""><a href="/en/users" target="_self">Users</a></li><li class=""><a href="/en/about-slash" target="_self">About /</a></li><li class=""><a href="/blog" target="_self">Blog</a></li><li class=""><a href="https://github.com/facebook/docusaurus" target="_self">GitHub</a></li><span><li><a id="languages-menu" href="#"><img class="languages-icon" src="/img/language.svg"/>English</a><div id="languages-dropdown" class="hide"><ul id="languages-dropdown-items"><li><a href="/es-ES">Español</a></li><li><a href="/ro">Română</a></li><li><a href="/tr">Türkçe</a></li><li><a href="/zh-CN">简体中文</a></li><li><a href="https://crowdin.com/project/docusaurus" target="_blank" rel="noreferrer noopener">Help Translate</a></li></ul></div></li><script>
|
||||
const languagesMenuItem = document.getElementById("languages-menu");
|
||||
const languagesDropDown = document.getElementById("languages-dropdown");
|
||||
languagesMenuItem.addEventListener("click", function(){
|
||||
|
@ -22,7 +22,7 @@
|
|||
languagesDropDown.className = "hide";
|
||||
}
|
||||
});
|
||||
</script></span><li class="navSearchWrapper reactNavSearchWrapper"><input type="text" id="search_input_react" placeholder="Search" title="Search"/></li></ul></nav></div></header></div></div><div class="navPusher"><div class="docMainWrapper wrapper"><div class="container docsNavContainer" id="docsNav"><nav class="toc"><div class="toggleNav"><section class="navWrapper wrapper"><div class="navBreadcrumb wrapper"><div class="navToggle" id="navToggler"><i></i></div><h2><i>›</i><span>API</span></h2></div><div class="navGroups"><div class="navGroup navGroupActive"><h3>Getting Started</h3><ul><li class="navListItem"><a class="navItem" href="/docs/en/next/installation.html">Installation</a></li><li class="navListItem"><a class="navItem" href="/docs/en/next/site-preparation.html">Site Preparation</a></li><li class="navListItem"><a class="navItem" href="/docs/en/next/site-creation.html">Creating your site</a></li><li class="navListItem"><a class="navItem" href="/docs/en/next/publishing.html">Publishing your site</a></li></ul></div><div class="navGroup navGroupActive"><h3>Guides</h3><ul><li class="navListItem"><a class="navItem" href="/docs/en/next/blog.html">Adding a Blog</a></li><li class="navListItem"><a class="navItem" href="/docs/en/next/custom-pages.html">Custom Pages</a></li><li class="navListItem"><a class="navItem" href="/docs/en/next/search.html">Enabling Search</a></li><li class="navListItem"><a class="navItem" href="/docs/en/next/navigation.html">Navigation and Sidebars</a></li><li class="navListItem"><a class="navItem" href="/docs/en/next/translation.html">Translations & Localization</a></li><li class="navListItem"><a class="navItem" href="/docs/en/next/versioning.html">Versioning</a></li></ul></div><div class="navGroup navGroupActive"><h3>API</h3><ul><li class="navListItem"><a class="navItem" href="/docs/en/next/commands.html">CLI Commands</a></li><li class="navListItem"><a class="navItem" href="/docs/en/next/doc-markdown.html">Markdown Features</a></li><li class="navListItem navListItemActive"><a class="navItem navItemActive" href="/docs/en/next/api-pages.html">Pages and Styles</a></li><li class="navListItem"><a class="navItem" href="/docs/en/next/site-config.html">siteConfig.js</a></li></ul></div></div></section></div><script>
|
||||
</script></span><li class="navSearchWrapper reactNavSearchWrapper"><input type="text" id="search_input_react" placeholder="Search" title="Search"/></li></ul></nav></div></header></div></div><div class="navPusher"><div class="docMainWrapper wrapper"><div class="container docsNavContainer" id="docsNav"><nav class="toc"><div class="toggleNav"><section class="navWrapper wrapper"><div class="navBreadcrumb wrapper"><div class="navToggle" id="navToggler"><i></i></div><h2><i>›</i><span>API</span></h2></div><div class="navGroups"><div class="navGroup navGroupActive"><h3>Getting Started</h3><ul><li class="navListItem"><a class="navItem" href="/docs/en/next/installation">Installation</a></li><li class="navListItem"><a class="navItem" href="/docs/en/next/site-preparation">Site Preparation</a></li><li class="navListItem"><a class="navItem" href="/docs/en/next/site-creation">Creating your site</a></li><li class="navListItem"><a class="navItem" href="/docs/en/next/publishing">Publishing your site</a></li></ul></div><div class="navGroup navGroupActive"><h3>Guides</h3><ul><li class="navListItem"><a class="navItem" href="/docs/en/next/blog">Adding a Blog</a></li><li class="navListItem"><a class="navItem" href="/docs/en/next/custom-pages">Custom Pages</a></li><li class="navListItem"><a class="navItem" href="/docs/en/next/search">Enabling Search</a></li><li class="navListItem"><a class="navItem" href="/docs/en/next/navigation">Navigation and Sidebars</a></li><li class="navListItem"><a class="navItem" href="/docs/en/next/translation">Translations & Localization</a></li><li class="navListItem"><a class="navItem" href="/docs/en/next/versioning">Versioning</a></li></ul></div><div class="navGroup navGroupActive"><h3>API</h3><ul><li class="navListItem"><a class="navItem" href="/docs/en/next/commands">CLI Commands</a></li><li class="navListItem"><a class="navItem" href="/docs/en/next/doc-markdown">Markdown Features</a></li><li class="navListItem navListItemActive"><a class="navItem navItemActive" href="/docs/en/next/api-pages">Pages and Styles</a></li><li class="navListItem"><a class="navItem" href="/docs/en/next/site-config">siteConfig.js</a></li></ul></div></div></section></div><script>
|
||||
var toggler = document.getElementById('navToggler');
|
||||
var nav = document.getElementById('docsNav');
|
||||
toggler.onclick = function() {
|
||||
|
@ -30,9 +30,9 @@
|
|||
};
|
||||
</script></nav></div><div class="container mainContainer"><div class="wrapper"><div class="post"><header class="postHeader"><a class="edit-page-link button" href="https://github.com/facebook/docusaurus/edit/master/docs/api-pages.md" target="_blank" rel="noreferrer noopener">Edit</a><h1>Pages and Styles</h1></header><article><div><span><p>Docusaurus provides support for writing pages as React components inside the <code>website/pages</code> folder which will share the same header, footer, and styles as the rest of the site.</p>
|
||||
<h2><a class="anchor" aria-hidden="true" id="urls-for-pages"></a><a href="#urls-for-pages" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>URLs for Pages</h2>
|
||||
<p>Any <code>.js</code> files in <code>website/pages</code> will be rendered to static html using the path of the file after "pages". Files in <code>website/pages/en</code> will also get copied out into <code>pages</code> and will OVERRIDE any files of the same name in <code>pages</code>. For example, the page for the <code>website/pages/en/help.js</code> file will be found at the url <code>${baseUrl}en/help.js</code> as well as the url <code>${baseUrl}help.js</code>, where <code>${baseUrl}</code> is the <code>baseUrl</code> field set in your <a href="/docs/en/next/site-config.html">siteConfig.js file</a>.</p>
|
||||
<p>Any <code>.js</code> files in <code>website/pages</code> will be rendered to static html using the path of the file after "pages". Files in <code>website/pages/en</code> will also get copied out into <code>pages</code> and will OVERRIDE any files of the same name in <code>pages</code>. For example, the page for the <code>website/pages/en/help.js</code> file will be found at the url <code>${baseUrl}en/help.js</code> as well as the url <code>${baseUrl}help.js</code>, where <code>${baseUrl}</code> is the <code>baseUrl</code> field set in your <a href="/docs/en/next/site-config">siteConfig.js file</a>.</p>
|
||||
<h2><a class="anchor" aria-hidden="true" id="titles-for-pages"></a><a href="#titles-for-pages" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Titles for Pages</h2>
|
||||
<p>By default, the title of your page is <code><title> • <tagline></code> where <code>title</code> and <code>tagline</code> fields are set in <a href="/docs/en/next/site-config.html"><code>siteConfig.js</code></a>. You can exclude the tagline in the title by setting <code>disableTitleTagline</code> to <code>true</code>. If you want to set a specific title for your custom pages, add a <code>title</code> class property on your exported React component.</p>
|
||||
<p>By default, the title of your page is <code><title> • <tagline></code> where <code>title</code> and <code>tagline</code> fields are set in <a href="/docs/en/next/site-config"><code>siteConfig.js</code></a>. You can exclude the tagline in the title by setting <code>disableTitleTagline</code> to <code>true</code>. If you want to set a specific title for your custom pages, add a <code>title</code> class property on your exported React component.</p>
|
||||
<p>Example:</p>
|
||||
<pre><code class="hljs css js"><span class="hljs-keyword">const</span> React = <span class="hljs-built_in">require</span>(<span class="hljs-string">'react'</span>);
|
||||
|
||||
|
@ -136,7 +136,7 @@ MyPage.title = <span class="hljs-string">'My Custom Title'</span>;
|
|||
]}
|
||||
/>
|
||||
</code></pre>
|
||||
<p>More examples of how these components are used can be found in the <a href="/docs/en/next/site-preparation.html">generated example files</a> as well as in Docusaurus' own repo for its website set-up.</p>
|
||||
<p>More examples of how these components are used can be found in the <a href="/docs/en/next/site-preparation">generated example files</a> as well as in Docusaurus' own repo for its website set-up.</p>
|
||||
<h2><a class="anchor" aria-hidden="true" id="translating-strings"></a><a href="#translating-strings" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Translating Strings</h2>
|
||||
<p>When translations are enabled, any pages inside <code>website/pages/en</code> will be translated for all enabled languages. Urls for non-English pages will use their language tags as specified in the <code>languages.js</code> file. E.g. The url for a French page of <code>website/pages/en/help.js</code> would be found at <code>${baseUrl}fr/help.html</code>.</p>
|
||||
<p>When writing pages that you wish to translate, wrap any strings to be translated inside a <code><translate></code> tag. e.g.,</p>
|
||||
|
@ -158,10 +158,10 @@ MyPage.title = <span class="hljs-string">'My Custom Title'</span>;
|
|||
<h2><a class="anchor" aria-hidden="true" id="using-static-assets"></a><a href="#using-static-assets" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Using Static Assets</h2>
|
||||
<p>Static assets should be placed into the <code>website/static</code> folder. They can be accessed by their paths, excluding <code>static</code>. For example, if the site's <code>baseUrl</code> is <code>/docusaurus/</code>, an image in <code>website/static/img/logo.png</code> is available at <code>/docusaurus/img/logo.png</code>.</p>
|
||||
<h2><a class="anchor" aria-hidden="true" id="styles"></a><a href="#styles" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Styles</h2>
|
||||
<p>You should configure your site's primary, secondary, and code block colors using the <code>colors</code> field in <code>siteConfig</code> as specified <a href="/docs/en/next/site-config.html">here</a>. You can also configure other colors in the same way as described in the <code>siteConfig</code> doc.</p>
|
||||
<p>You should configure your site's primary, secondary, and code block colors using the <code>colors</code> field in <code>siteConfig</code> as specified <a href="/docs/en/next/site-config">here</a>. You can also configure other colors in the same way as described in the <code>siteConfig</code> doc.</p>
|
||||
<p>You can provide your own custom styles by adding them anywhere in the <code>website/static</code> folder. Any <code>.css</code> files you provide in the <code>static</code> folder will get concatenated to the end of Docusaurus' provided styles, allowing you to add to or override Docusaurus default styles as you wish.</p>
|
||||
<p>An easy way to figure out what classes you wish to override or add to is to <a href="/docs/en/next/commands.html">start your server locally</a> and use your browser's inspect element tool.</p>
|
||||
</span></div></article></div><div class="docs-prevnext"><a class="docs-prev button" href="doc-markdown.html">← Markdown Features</a><a class="docs-next button" href="site-config.html">siteConfig.js →</a></div></div></div><nav class="onPageNav"><ul class="toc-headings"><li><a href="#urls-for-pages">URLs for Pages</a></li><li><a href="#titles-for-pages">Titles for Pages</a></li><li><a href="#page-require-paths">Page Require Paths</a></li><li><a href="#provided-components">Provided Components</a><ul class="toc-headings"><li><a href="#complibrarymarkdownblock"><code>CompLibrary.MarkdownBlock</code></a></li><li><a href="#complibrarycontainer"><code>CompLibrary.Container</code></a></li><li><a href="#complibrarygridblock"><code>CompLibrary.GridBlock</code></a></li></ul></li><li><a href="#translating-strings">Translating Strings</a></li><li><a href="#using-static-assets">Using Static Assets</a></li><li><a href="#styles">Styles</a></li></ul></nav></div><footer class="nav-footer" id="footer"><section class="sitemap"><a href="/" class="nav-home"><img src="/img/docusaurus_monochrome.svg" alt="Docusaurus" width="66" height="58"/></a><div><h5>Docs</h5><a href="
|
||||
<p>An easy way to figure out what classes you wish to override or add to is to <a href="/docs/en/next/commands">start your server locally</a> and use your browser's inspect element tool.</p>
|
||||
</span></div></article></div><div class="docs-prevnext"><a class="docs-prev button" href="doc-markdown">← Markdown Features</a><a class="docs-next button" href="site-config">siteConfig.js →</a></div></div></div><nav class="onPageNav"><ul class="toc-headings"><li><a href="#urls-for-pages">URLs for Pages</a></li><li><a href="#titles-for-pages">Titles for Pages</a></li><li><a href="#page-require-paths">Page Require Paths</a></li><li><a href="#provided-components">Provided Components</a><ul class="toc-headings"><li><a href="#complibrarymarkdownblock"><code>CompLibrary.MarkdownBlock</code></a></li><li><a href="#complibrarycontainer"><code>CompLibrary.Container</code></a></li><li><a href="#complibrarygridblock"><code>CompLibrary.GridBlock</code></a></li></ul></li><li><a href="#translating-strings">Translating Strings</a></li><li><a href="#using-static-assets">Using Static Assets</a></li><li><a href="#styles">Styles</a></li></ul></nav></div><footer class="nav-footer" id="footer"><section class="sitemap"><a href="/" class="nav-home"><img src="/img/docusaurus_monochrome.svg" alt="Docusaurus" width="66" height="58"/></a><div><h5>Docs</h5><a href="
|
||||
/docs/en/installation.html">Getting Started</a><a href="
|
||||
/docs/en/versioning.html">Versioning</a><a href="
|
||||
/docs/en/translation.html">Localization</a><a href="
|
||||
|
|
176
docs/en/next/api-pages/index.html
Normal file
176
docs/en/next/api-pages/index.html
Normal file
|
@ -0,0 +1,176 @@
|
|||
<!DOCTYPE html><html lang="en"><head><meta charSet="utf-8"/><meta http-equiv="X-UA-Compatible" content="IE=edge"/><title>Pages and Styles · Docusaurus</title><meta name="viewport" content="width=device-width"/><meta name="generator" content="Docusaurus"/><meta property="og:title" content="Pages and Styles · Docusaurus"/><meta property="og:type" content="website"/><meta property="og:url" content="https://docusaurus.io/index.html"/><meta property="og:description" content="Docusaurus provides support for writing pages as React components inside the `website/pages` folder which will share the same header, footer, and styles as the rest of the site."/><meta property="og:image" content="https://docusaurus.io/img/docusaurus.png"/><meta name="twitter:card" content="summary"/><meta name="twitter:image" content="https://docusaurus.io/img/docusaurus.png"/><link rel="shortcut icon" href="/img/docusaurus.ico"/><link rel="stylesheet" href="https://cdn.jsdelivr.net/docsearch.js/1/docsearch.min.css"/><link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/highlight.js/9.12.0/styles/atom-one-dark.min.css"/><link rel="alternate" type="application/atom+xml" href="https://docusaurus.io/blog/atom.xml" title="Docusaurus Blog ATOM Feed"/><link rel="alternate" type="application/rss+xml" href="https://docusaurus.io/blog/feed.xml" title="Docusaurus Blog RSS Feed"/><script>
|
||||
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
|
||||
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
|
||||
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
|
||||
})(window,document,'script','https://www.google-analytics.com/analytics.js','ga');
|
||||
|
||||
ga('create', 'UA-44373548-31', 'auto');
|
||||
ga('send', 'pageview');
|
||||
</script><link rel="stylesheet" href="/css/code-blocks-buttons.css"/><script type="text/javascript" src="https://buttons.github.io/buttons.js"></script><script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/clipboard.js/2.0.0/clipboard.min.js"></script><script type="text/javascript" src="/js/code-blocks-buttons.js"></script><script src="https://unpkg.com/vanilla-back-to-top@7.1.14/dist/vanilla-back-to-top.min.js"></script><script>
|
||||
document.addEventListener("DOMContentLoaded", function(){
|
||||
addBackToTop(
|
||||
{"zIndex":100}
|
||||
)
|
||||
});
|
||||
</script><link rel="stylesheet" href="/css/main.css"/></head><body class="sideNavVisible doc separateOnPageNav"><div class="fixedHeaderContainer"><div class="headerWrapper wrapper"><header><a href="/en"><img class="logo" src="/img/docusaurus.svg" alt="Docusaurus"/><h2 class="headerTitleWithLogo">Docusaurus</h2></a><a href="/en/versions.html"><h3>next</h3></a><div class="navigationWrapper navigationSlider"><nav class="slidingNav"><ul class="nav-site nav-site-internal"><li class="siteNavGroupActive"><a href="/docs/en/next/installation" target="_self">Docs</a></li><li class=""><a href="/en/help" target="_self">Help</a></li><li class=""><a href="/en/users" target="_self">Users</a></li><li class=""><a href="/en/about-slash" target="_self">About /</a></li><li class=""><a href="/blog" target="_self">Blog</a></li><li class=""><a href="https://github.com/facebook/docusaurus" target="_self">GitHub</a></li><span><li><a id="languages-menu" href="#"><img class="languages-icon" src="/img/language.svg"/>English</a><div id="languages-dropdown" class="hide"><ul id="languages-dropdown-items"><li><a href="/es-ES">Español</a></li><li><a href="/ro">Română</a></li><li><a href="/tr">Türkçe</a></li><li><a href="/zh-CN">简体中文</a></li><li><a href="https://crowdin.com/project/docusaurus" target="_blank" rel="noreferrer noopener">Help Translate</a></li></ul></div></li><script>
|
||||
const languagesMenuItem = document.getElementById("languages-menu");
|
||||
const languagesDropDown = document.getElementById("languages-dropdown");
|
||||
languagesMenuItem.addEventListener("click", function(){
|
||||
if(languagesDropDown.className == "hide") {
|
||||
languagesDropDown.className = "visible";
|
||||
} else {
|
||||
languagesDropDown.className = "hide";
|
||||
}
|
||||
});
|
||||
</script></span><li class="navSearchWrapper reactNavSearchWrapper"><input type="text" id="search_input_react" placeholder="Search" title="Search"/></li></ul></nav></div></header></div></div><div class="navPusher"><div class="docMainWrapper wrapper"><div class="container docsNavContainer" id="docsNav"><nav class="toc"><div class="toggleNav"><section class="navWrapper wrapper"><div class="navBreadcrumb wrapper"><div class="navToggle" id="navToggler"><i></i></div><h2><i>›</i><span>API</span></h2></div><div class="navGroups"><div class="navGroup navGroupActive"><h3>Getting Started</h3><ul><li class="navListItem"><a class="navItem" href="/docs/en/next/installation">Installation</a></li><li class="navListItem"><a class="navItem" href="/docs/en/next/site-preparation">Site Preparation</a></li><li class="navListItem"><a class="navItem" href="/docs/en/next/site-creation">Creating your site</a></li><li class="navListItem"><a class="navItem" href="/docs/en/next/publishing">Publishing your site</a></li></ul></div><div class="navGroup navGroupActive"><h3>Guides</h3><ul><li class="navListItem"><a class="navItem" href="/docs/en/next/blog">Adding a Blog</a></li><li class="navListItem"><a class="navItem" href="/docs/en/next/custom-pages">Custom Pages</a></li><li class="navListItem"><a class="navItem" href="/docs/en/next/search">Enabling Search</a></li><li class="navListItem"><a class="navItem" href="/docs/en/next/navigation">Navigation and Sidebars</a></li><li class="navListItem"><a class="navItem" href="/docs/en/next/translation">Translations & Localization</a></li><li class="navListItem"><a class="navItem" href="/docs/en/next/versioning">Versioning</a></li></ul></div><div class="navGroup navGroupActive"><h3>API</h3><ul><li class="navListItem"><a class="navItem" href="/docs/en/next/commands">CLI Commands</a></li><li class="navListItem"><a class="navItem" href="/docs/en/next/doc-markdown">Markdown Features</a></li><li class="navListItem navListItemActive"><a class="navItem navItemActive" href="/docs/en/next/api-pages">Pages and Styles</a></li><li class="navListItem"><a class="navItem" href="/docs/en/next/site-config">siteConfig.js</a></li></ul></div></div></section></div><script>
|
||||
var toggler = document.getElementById('navToggler');
|
||||
var nav = document.getElementById('docsNav');
|
||||
toggler.onclick = function() {
|
||||
nav.classList.toggle('docsSliderActive');
|
||||
};
|
||||
</script></nav></div><div class="container mainContainer"><div class="wrapper"><div class="post"><header class="postHeader"><a class="edit-page-link button" href="https://github.com/facebook/docusaurus/edit/master/docs/api-pages.md" target="_blank" rel="noreferrer noopener">Edit</a><h1>Pages and Styles</h1></header><article><div><span><p>Docusaurus provides support for writing pages as React components inside the <code>website/pages</code> folder which will share the same header, footer, and styles as the rest of the site.</p>
|
||||
<h2><a class="anchor" aria-hidden="true" id="urls-for-pages"></a><a href="#urls-for-pages" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>URLs for Pages</h2>
|
||||
<p>Any <code>.js</code> files in <code>website/pages</code> will be rendered to static html using the path of the file after "pages". Files in <code>website/pages/en</code> will also get copied out into <code>pages</code> and will OVERRIDE any files of the same name in <code>pages</code>. For example, the page for the <code>website/pages/en/help.js</code> file will be found at the url <code>${baseUrl}en/help.js</code> as well as the url <code>${baseUrl}help.js</code>, where <code>${baseUrl}</code> is the <code>baseUrl</code> field set in your <a href="/docs/en/next/site-config">siteConfig.js file</a>.</p>
|
||||
<h2><a class="anchor" aria-hidden="true" id="titles-for-pages"></a><a href="#titles-for-pages" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Titles for Pages</h2>
|
||||
<p>By default, the title of your page is <code><title> • <tagline></code> where <code>title</code> and <code>tagline</code> fields are set in <a href="/docs/en/next/site-config"><code>siteConfig.js</code></a>. You can exclude the tagline in the title by setting <code>disableTitleTagline</code> to <code>true</code>. If you want to set a specific title for your custom pages, add a <code>title</code> class property on your exported React component.</p>
|
||||
<p>Example:</p>
|
||||
<pre><code class="hljs css js"><span class="hljs-keyword">const</span> React = <span class="hljs-built_in">require</span>(<span class="hljs-string">'react'</span>);
|
||||
|
||||
<span class="hljs-class"><span class="hljs-keyword">class</span> <span class="hljs-title">MyPage</span> <span class="hljs-keyword">extends</span> <span class="hljs-title">React</span>.<span class="hljs-title">Component</span> </span>{
|
||||
render() {
|
||||
<span class="hljs-comment">// ... your rendering code</span>
|
||||
}
|
||||
}
|
||||
|
||||
MyPage.title = <span class="hljs-string">'My Custom Title'</span>;
|
||||
|
||||
<span class="hljs-built_in">module</span>.exports = MyPage;
|
||||
</code></pre>
|
||||
<h2><a class="anchor" aria-hidden="true" id="page-require-paths"></a><a href="#page-require-paths" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Page Require Paths</h2>
|
||||
<p>Docusaurus provides a few useful React components for users to write their own pages, found in the <code>CompLibrary</code> module. This module is provided as part of Docusaurus in <code>node_modules/docusaurus</code>, so to access it, pages in the <code>pages</code> folder are temporarily copied into <code>node_modules/docusaurus</code> when rendering to static html. As seen in the example files, this means that a user page at <code>pages/en/index.js</code> uses a require path to <code>'../../core/CompLibrary.js'</code> to import the provided components.</p>
|
||||
<p>What this means to the user is that if you wish to use the <code>CompLibrary</code> module, make sure the require path is set correctly. For example, a page at <code>page/mypage.js</code> would use a path <code>'../core/CompLibrary.js'</code>.</p>
|
||||
<p>If you wish to use your own components inside the website folder, use <code>process.cwd()</code> which will refer to the <code>website</code> folder to construct require paths. For example, if you add a component to <code>website/core/mycomponent.js</code>, you can use the require path, <code>'process.cwd() + /core/mycomponent.js'</code>.</p>
|
||||
<h2><a class="anchor" aria-hidden="true" id="provided-components"></a><a href="#provided-components" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Provided Components</h2>
|
||||
<p>Docusaurus provides the following components in <code>CompLibrary</code>:</p>
|
||||
<h3><a class="anchor" aria-hidden="true" id="complibrarymarkdownblock"></a><a href="#complibrarymarkdownblock" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a><code>CompLibrary.MarkdownBlock</code></h3>
|
||||
<p>A React component that parses markdown and renders to HTML.</p>
|
||||
<p>Example:</p>
|
||||
<pre><code class="hljs css jsx"><span class="hljs-keyword">const</span> MarkdownBlock = CompLibrary.MarkdownBlock;
|
||||
|
||||
<span class="xml"><span class="hljs-tag"><<span class="hljs-name">MarkdownBlock</span>></span>
|
||||
[Markdown syntax for a link](http://www.example.com)
|
||||
<span class="hljs-tag"></<span class="hljs-name">MarkdownBlock</span>></span></span>;
|
||||
</code></pre>
|
||||
<h3><a class="anchor" aria-hidden="true" id="complibrarycontainer"></a><a href="#complibrarycontainer" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a><code>CompLibrary.Container</code></h3>
|
||||
<p>A React container component using Docusaurus styles. Has optional padding and background color props that you can configure.</p>
|
||||
<p><strong>Props</strong></p>
|
||||
<table>
|
||||
<thead>
|
||||
<tr><th>Prop</th><th>Type</th><th>Default</th><th>Description</th></tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr><td><code>padding</code></td><td>Array of <code>'all'</code>, <code>'bottom'</code>, <code>'left'</code>, <code>'right'</code>, <code>'top'</code></td><td><code>[]</code></td><td>Positions of the padding.</td></tr>
|
||||
<tr><td><code>background</code></td><td>One of <code>'dark'</code>, <code>'highlight'</code>, <code>'light'</code></td><td><code>null</code></td><td>Background styling of the element.</td></tr>
|
||||
<tr><td><code>className</code></td><td>String</td><td>-</td><td>Custom class to add to the element.</td></tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<p><strong>Example</strong></p>
|
||||
<pre><code class="hljs css jsx"><Container
|
||||
padding={['bottom', 'top']}
|
||||
background="light"
|
||||
className="myCustomClass">
|
||||
...
|
||||
</Container>
|
||||
</code></pre>
|
||||
<h3><a class="anchor" aria-hidden="true" id="complibrarygridblock"></a><a href="#complibrarygridblock" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a><code>CompLibrary.GridBlock</code></h3>
|
||||
<p>A React component to organize text and images.</p>
|
||||
<p><strong>Props</strong></p>
|
||||
<table>
|
||||
<thead>
|
||||
<tr><th>Prop</th><th>Type</th><th>Default</th><th>Description</th></tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr><td><code>align</code></td><td>One of <code>'left'</code>, <code>'center'</code>, <code>'right'</code></td><td><code>'left'</code></td><td>Text alignment of content.</td></tr>
|
||||
<tr><td><code>layout</code></td><td>One of <code>'twoColumn'</code>, <code>'threeColumn'</code>, <code>'fourColumn'</code></td><td><code>'twoColumn'</code></td><td>Number of column sections in the <code>GridBlock</code>.</td></tr>
|
||||
<tr><td><code>className</code></td><td>String</td><td>-</td><td>Custom class to add to the element.</td></tr>
|
||||
<tr><td><code>contents</code></td><td>Array of content objects</td><td><code>[]</code></td><td>Contents of each section of the GridBlock. Refer to the next table for the fields available on a content object.</td></tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<p><strong>Content Object</strong></p>
|
||||
<table>
|
||||
<thead>
|
||||
<tr><th>Key</th><th>Type</th><th>Default</th><th>Description</th></tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr><td><code>title</code></td><td>String</td><td>-</td><td>The display title of this section, which is parsed using Markdown</td></tr>
|
||||
<tr><td><code>content</code></td><td>String</td><td>-</td><td>The text of this section, which is parsed using Markdown</td></tr>
|
||||
<tr><td><code>image</code></td><td>String</td><td>-</td><td>The path of the display image</td></tr>
|
||||
<tr><td><code>imageAlt</code></td><td>String</td><td>-</td><td>The text that will be shown in case the image is not available</td></tr>
|
||||
<tr><td><code>imageAlign</code></td><td>One of <code>'top'</code>, <code>'left'</code>, <code>'bottom'</code>, <code>'right'</code></td><td><code>'left'</code></td><td>Image alignment relative to the text</td></tr>
|
||||
<tr><td><code>imageLink</code></td><td>String</td><td>-</td><td>Link destination from clicking the image</td></tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<p><strong>Example</strong></p>
|
||||
<pre><code class="hljs css jsx"><GridBlock
|
||||
align=<span class="hljs-string">"center"</span>
|
||||
layout=<span class="hljs-string">"threeColumn"</span>
|
||||
className=<span class="hljs-string">"myCustomClass"</span>
|
||||
contents={[
|
||||
{
|
||||
<span class="hljs-attr">title</span>: <span class="hljs-string">`[Learn](<span class="hljs-subst">${siteConfig.baseUrl}</span>docs/tutorial.html)`</span>,
|
||||
<span class="hljs-attr">content</span>: <span class="hljs-string">'Learn how to use this project'</span>,
|
||||
<span class="hljs-attr">image</span>: siteConfig.baseUrl + <span class="hljs-string">'img/learn.png'</span>,
|
||||
<span class="hljs-attr">imageAlt</span>: <span class="hljs-string">'Learn how to use this project'</span>,
|
||||
<span class="hljs-attr">imageLink</span>: siteConfig.baseUrl + <span class="hljs-string">'docs/tutorial.html'</span>,
|
||||
},
|
||||
{
|
||||
<span class="hljs-attr">title</span>: <span class="hljs-string">'Frequently Asked Questions'</span>,
|
||||
<span class="hljs-attr">content</span>: <span class="hljs-string">'Questions gathered from the community'</span>,
|
||||
<span class="hljs-attr">image</span>: siteConfig.baseUrl + <span class="hljs-string">'img/faq.png'</span>,
|
||||
<span class="hljs-attr">imageAlign</span>: <span class="hljs-string">'top'</span>,
|
||||
},
|
||||
{
|
||||
<span class="hljs-attr">title</span>: <span class="hljs-string">'More'</span>,
|
||||
<span class="hljs-attr">content</span>: <span class="hljs-string">'Lots of documentation is on this site'</span>,
|
||||
},
|
||||
]}
|
||||
/>
|
||||
</code></pre>
|
||||
<p>More examples of how these components are used can be found in the <a href="/docs/en/next/site-preparation">generated example files</a> as well as in Docusaurus' own repo for its website set-up.</p>
|
||||
<h2><a class="anchor" aria-hidden="true" id="translating-strings"></a><a href="#translating-strings" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Translating Strings</h2>
|
||||
<p>When translations are enabled, any pages inside <code>website/pages/en</code> will be translated for all enabled languages. Urls for non-English pages will use their language tags as specified in the <code>languages.js</code> file. E.g. The url for a French page of <code>website/pages/en/help.js</code> would be found at <code>${baseUrl}fr/help.html</code>.</p>
|
||||
<p>When writing pages that you wish to translate, wrap any strings to be translated inside a <code><translate></code> tag. e.g.,</p>
|
||||
<pre><code class="hljs css jsx"><p>
|
||||
<translate>I like translations</translate>
|
||||
</p>
|
||||
</code></pre>
|
||||
<p>You can also provide an optional description attribute to provide context for translators. e.g,</p>
|
||||
<pre><code class="hljs css jsx"><a href="/community">
|
||||
<translate desc="Footer link to page referring to community GitHub and Slack">
|
||||
Community
|
||||
</translate>
|
||||
</a>
|
||||
</code></pre>
|
||||
<p>Add the following require statement as well:</p>
|
||||
<pre><code class="hljs css js"><span class="hljs-keyword">const</span> translate = <span class="hljs-built_in">require</span>(<span class="hljs-string">'../../server/translate.js'</span>).translate;
|
||||
</code></pre>
|
||||
<p>Note that this path is valid for files inside <code>pages/en</code> and should be adjusted accordingly if files are in different locations, as discussed <a href="#page-require-paths">above</a>.</p>
|
||||
<h2><a class="anchor" aria-hidden="true" id="using-static-assets"></a><a href="#using-static-assets" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Using Static Assets</h2>
|
||||
<p>Static assets should be placed into the <code>website/static</code> folder. They can be accessed by their paths, excluding <code>static</code>. For example, if the site's <code>baseUrl</code> is <code>/docusaurus/</code>, an image in <code>website/static/img/logo.png</code> is available at <code>/docusaurus/img/logo.png</code>.</p>
|
||||
<h2><a class="anchor" aria-hidden="true" id="styles"></a><a href="#styles" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Styles</h2>
|
||||
<p>You should configure your site's primary, secondary, and code block colors using the <code>colors</code> field in <code>siteConfig</code> as specified <a href="/docs/en/next/site-config">here</a>. You can also configure other colors in the same way as described in the <code>siteConfig</code> doc.</p>
|
||||
<p>You can provide your own custom styles by adding them anywhere in the <code>website/static</code> folder. Any <code>.css</code> files you provide in the <code>static</code> folder will get concatenated to the end of Docusaurus' provided styles, allowing you to add to or override Docusaurus default styles as you wish.</p>
|
||||
<p>An easy way to figure out what classes you wish to override or add to is to <a href="/docs/en/next/commands">start your server locally</a> and use your browser's inspect element tool.</p>
|
||||
</span></div></article></div><div class="docs-prevnext"><a class="docs-prev button" href="doc-markdown">← Markdown Features</a><a class="docs-next button" href="site-config">siteConfig.js →</a></div></div></div><nav class="onPageNav"><ul class="toc-headings"><li><a href="#urls-for-pages">URLs for Pages</a></li><li><a href="#titles-for-pages">Titles for Pages</a></li><li><a href="#page-require-paths">Page Require Paths</a></li><li><a href="#provided-components">Provided Components</a><ul class="toc-headings"><li><a href="#complibrarymarkdownblock"><code>CompLibrary.MarkdownBlock</code></a></li><li><a href="#complibrarycontainer"><code>CompLibrary.Container</code></a></li><li><a href="#complibrarygridblock"><code>CompLibrary.GridBlock</code></a></li></ul></li><li><a href="#translating-strings">Translating Strings</a></li><li><a href="#using-static-assets">Using Static Assets</a></li><li><a href="#styles">Styles</a></li></ul></nav></div><footer class="nav-footer" id="footer"><section class="sitemap"><a href="/" class="nav-home"><img src="/img/docusaurus_monochrome.svg" alt="Docusaurus" width="66" height="58"/></a><div><h5>Docs</h5><a href="
|
||||
/docs/en/installation.html">Getting Started</a><a href="
|
||||
/docs/en/versioning.html">Versioning</a><a href="
|
||||
/docs/en/translation.html">Localization</a><a href="
|
||||
/docs/en/search.html">Adding Search</a></div><div><h5>Community</h5><a href="/en/users.html">User Showcase</a></div><div><h5>More</h5><div class="social"><a class="github-button" href="https://github.com/facebook/Docusaurus" data-count-href="/facebook/Docusaurus/stargazers" data-show-count="true" data-count-aria-label="# stargazers on GitHub" aria-label="Star this project on GitHub">Docusaurus</a></div><div class="social"><a href="https://twitter.com/docusaurus" class="twitter-follow-button">Follow @docusaurus</a></div><div class="social"><div class="fb-like" data-href="https://docusaurus.io" data-layout="standard" data-share="true" data-width="225" data-show-faces="false"></div></div></div></section><a href="https://code.facebook.com/projects/" target="_blank" rel="noreferrer noopener" class="fbOpenSource"><img src="/img/oss_logo.png" alt="Facebook Open Source" width="170" height="45"/></a><section class="copyright"><span>Copyright © 2018 Facebook Inc.</span></section></footer></div><script type="text/javascript" src="https://cdn.jsdelivr.net/docsearch.js/1/docsearch.min.js"></script><script>window.fbAsyncInit = function() {FB.init({appId:'199138890728411',xfbml:true,version:'v2.7'});};(function(d, s, id){var js, fjs = d.getElementsByTagName(s)[0];if (d.getElementById(id)) {return;}js = d.createElement(s); js.id = id;js.src = '//connect.facebook.net/en_US/sdk.js';fjs.parentNode.insertBefore(js, fjs);}(document, 'script','facebook-jssdk'));
|
||||
</script><script>window.twttr=(function(d,s, id){var js,fjs=d.getElementsByTagName(s)[0],t=window.twttr||{};if(d.getElementById(id))return t;js=d.createElement(s);js.id=id;js.src='https://platform.twitter.com/widgets.js';fjs.parentNode.insertBefore(js, fjs);t._e = [];t.ready = function(f) {t._e.push(f);};return t;}(document, 'script', 'twitter-wjs'));</script><script>
|
||||
var search = docsearch({
|
||||
|
||||
apiKey: '3eb9507824b8be89e7a199ecaa1a9d2c',
|
||||
indexName: 'docusaurus',
|
||||
inputSelector: '#search_input_react'
|
||||
});
|
||||
</script></body></html>
|
|
@ -12,7 +12,7 @@
|
|||
{"zIndex":100}
|
||||
)
|
||||
});
|
||||
</script><link rel="stylesheet" href="/css/main.css"/></head><body class="sideNavVisible doc separateOnPageNav"><div class="fixedHeaderContainer"><div class="headerWrapper wrapper"><header><a href="/en"><img class="logo" src="/img/docusaurus.svg" alt="Docusaurus"/><h2 class="headerTitleWithLogo">Docusaurus</h2></a><a href="/en/versions.html"><h3>next</h3></a><div class="navigationWrapper navigationSlider"><nav class="slidingNav"><ul class="nav-site nav-site-internal"><li class="siteNavGroupActive"><a href="/docs/en/next/installation.html" target="_self">Docs</a></li><li class=""><a href="/en/help.html" target="_self">Help</a></li><li class=""><a href="/en/users.html" target="_self">Users</a></li><li class=""><a href="/en/about-slash.html" target="_self">About /</a></li><li class=""><a href="/blog" target="_self">Blog</a></li><li class=""><a href="https://github.com/facebook/docusaurus" target="_self">GitHub</a></li><span><li><a id="languages-menu" href="#"><img class="languages-icon" src="/img/language.svg"/>English</a><div id="languages-dropdown" class="hide"><ul id="languages-dropdown-items"><li><a href="/es-ES">Español</a></li><li><a href="/ro">Română</a></li><li><a href="/tr">Türkçe</a></li><li><a href="/zh-CN">简体中文</a></li><li><a href="https://crowdin.com/project/docusaurus" target="_blank" rel="noreferrer noopener">Help Translate</a></li></ul></div></li><script>
|
||||
</script><link rel="stylesheet" href="/css/main.css"/></head><body class="sideNavVisible doc separateOnPageNav"><div class="fixedHeaderContainer"><div class="headerWrapper wrapper"><header><a href="/en"><img class="logo" src="/img/docusaurus.svg" alt="Docusaurus"/><h2 class="headerTitleWithLogo">Docusaurus</h2></a><a href="/en/versions.html"><h3>next</h3></a><div class="navigationWrapper navigationSlider"><nav class="slidingNav"><ul class="nav-site nav-site-internal"><li class="siteNavGroupActive"><a href="/docs/en/next/installation" target="_self">Docs</a></li><li class=""><a href="/en/help" target="_self">Help</a></li><li class=""><a href="/en/users" target="_self">Users</a></li><li class=""><a href="/en/about-slash" target="_self">About /</a></li><li class=""><a href="/blog" target="_self">Blog</a></li><li class=""><a href="https://github.com/facebook/docusaurus" target="_self">GitHub</a></li><span><li><a id="languages-menu" href="#"><img class="languages-icon" src="/img/language.svg"/>English</a><div id="languages-dropdown" class="hide"><ul id="languages-dropdown-items"><li><a href="/es-ES">Español</a></li><li><a href="/ro">Română</a></li><li><a href="/tr">Türkçe</a></li><li><a href="/zh-CN">简体中文</a></li><li><a href="https://crowdin.com/project/docusaurus" target="_blank" rel="noreferrer noopener">Help Translate</a></li></ul></div></li><script>
|
||||
const languagesMenuItem = document.getElementById("languages-menu");
|
||||
const languagesDropDown = document.getElementById("languages-dropdown");
|
||||
languagesMenuItem.addEventListener("click", function(){
|
||||
|
@ -22,7 +22,7 @@
|
|||
languagesDropDown.className = "hide";
|
||||
}
|
||||
});
|
||||
</script></span><li class="navSearchWrapper reactNavSearchWrapper"><input type="text" id="search_input_react" placeholder="Search" title="Search"/></li></ul></nav></div></header></div></div><div class="navPusher"><div class="docMainWrapper wrapper"><div class="container docsNavContainer" id="docsNav"><nav class="toc"><div class="toggleNav"><section class="navWrapper wrapper"><div class="navBreadcrumb wrapper"><div class="navToggle" id="navToggler"><i></i></div><h2><i>›</i><span>Guides</span></h2></div><div class="navGroups"><div class="navGroup navGroupActive"><h3>Getting Started</h3><ul><li class="navListItem"><a class="navItem" href="/docs/en/next/installation.html">Installation</a></li><li class="navListItem"><a class="navItem" href="/docs/en/next/site-preparation.html">Site Preparation</a></li><li class="navListItem"><a class="navItem" href="/docs/en/next/site-creation.html">Creating your site</a></li><li class="navListItem"><a class="navItem" href="/docs/en/next/publishing.html">Publishing your site</a></li></ul></div><div class="navGroup navGroupActive"><h3>Guides</h3><ul><li class="navListItem navListItemActive"><a class="navItem navItemActive" href="/docs/en/next/blog.html">Adding a Blog</a></li><li class="navListItem"><a class="navItem" href="/docs/en/next/custom-pages.html">Custom Pages</a></li><li class="navListItem"><a class="navItem" href="/docs/en/next/search.html">Enabling Search</a></li><li class="navListItem"><a class="navItem" href="/docs/en/next/navigation.html">Navigation and Sidebars</a></li><li class="navListItem"><a class="navItem" href="/docs/en/next/translation.html">Translations & Localization</a></li><li class="navListItem"><a class="navItem" href="/docs/en/next/versioning.html">Versioning</a></li></ul></div><div class="navGroup navGroupActive"><h3>API</h3><ul><li class="navListItem"><a class="navItem" href="/docs/en/next/commands.html">CLI Commands</a></li><li class="navListItem"><a class="navItem" href="/docs/en/next/doc-markdown.html">Markdown Features</a></li><li class="navListItem"><a class="navItem" href="/docs/en/next/api-pages.html">Pages and Styles</a></li><li class="navListItem"><a class="navItem" href="/docs/en/next/site-config.html">siteConfig.js</a></li></ul></div></div></section></div><script>
|
||||
</script></span><li class="navSearchWrapper reactNavSearchWrapper"><input type="text" id="search_input_react" placeholder="Search" title="Search"/></li></ul></nav></div></header></div></div><div class="navPusher"><div class="docMainWrapper wrapper"><div class="container docsNavContainer" id="docsNav"><nav class="toc"><div class="toggleNav"><section class="navWrapper wrapper"><div class="navBreadcrumb wrapper"><div class="navToggle" id="navToggler"><i></i></div><h2><i>›</i><span>Guides</span></h2></div><div class="navGroups"><div class="navGroup navGroupActive"><h3>Getting Started</h3><ul><li class="navListItem"><a class="navItem" href="/docs/en/next/installation">Installation</a></li><li class="navListItem"><a class="navItem" href="/docs/en/next/site-preparation">Site Preparation</a></li><li class="navListItem"><a class="navItem" href="/docs/en/next/site-creation">Creating your site</a></li><li class="navListItem"><a class="navItem" href="/docs/en/next/publishing">Publishing your site</a></li></ul></div><div class="navGroup navGroupActive"><h3>Guides</h3><ul><li class="navListItem navListItemActive"><a class="navItem navItemActive" href="/docs/en/next/blog">Adding a Blog</a></li><li class="navListItem"><a class="navItem" href="/docs/en/next/custom-pages">Custom Pages</a></li><li class="navListItem"><a class="navItem" href="/docs/en/next/search">Enabling Search</a></li><li class="navListItem"><a class="navItem" href="/docs/en/next/navigation">Navigation and Sidebars</a></li><li class="navListItem"><a class="navItem" href="/docs/en/next/translation">Translations & Localization</a></li><li class="navListItem"><a class="navItem" href="/docs/en/next/versioning">Versioning</a></li></ul></div><div class="navGroup navGroupActive"><h3>API</h3><ul><li class="navListItem"><a class="navItem" href="/docs/en/next/commands">CLI Commands</a></li><li class="navListItem"><a class="navItem" href="/docs/en/next/doc-markdown">Markdown Features</a></li><li class="navListItem"><a class="navItem" href="/docs/en/next/api-pages">Pages and Styles</a></li><li class="navListItem"><a class="navItem" href="/docs/en/next/site-config">siteConfig.js</a></li></ul></div></div></section></div><script>
|
||||
var toggler = document.getElementById('navToggler');
|
||||
var nav = document.getElementById('docsNav');
|
||||
toggler.onclick = function() {
|
||||
|
@ -87,7 +87,7 @@
|
|||
<p>Docusaurus provides a simple RSS feed for your blog posts. Both RSS and Atom feed formats are supported. This data is automatically to your website page's HTML <HEAD> tag.</p>
|
||||
<p>A summary of the post's text is provided in the RSS feed up to the <code><!--truncate--></code>. If no <code><!--truncate--></code> tag is found, then all text up 250 characters are used.</p>
|
||||
<h2><a class="anchor" aria-hidden="true" id="social-buttons"></a><a href="#social-buttons" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Social Buttons</h2>
|
||||
<p>If you want Facebook and/or Twitter social buttons at the bottom of your blog posts, set the <code>facebookAppId</code> and/or <code>twitter</code> <a href="/docs/en/next/site-config.html">site configuration</a> options in <code>siteConfig.js</code>.</p>
|
||||
<p>If you want Facebook and/or Twitter social buttons at the bottom of your blog posts, set the <code>facebookAppId</code> and/or <code>twitter</code> <a href="/docs/en/next/site-config">site configuration</a> options in <code>siteConfig.js</code>.</p>
|
||||
<h2><a class="anchor" aria-hidden="true" id="advanced-topics"></a><a href="#advanced-topics" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Advanced Topics</h2>
|
||||
<h3><a class="anchor" aria-hidden="true" id="i-want-to-run-in-blog-only-mode"></a><a href="#i-want-to-run-in-blog-only-mode" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>I want to run in "Blog Only" mode.</h3>
|
||||
<p>You can run your Docusaurus site without a landing page and instead have your blog load first.</p>
|
||||
|
@ -117,7 +117,7 @@
|
|||
<span class="hljs-tag"></<span class="hljs-name">body</span>></span>
|
||||
<span class="hljs-tag"></<span class="hljs-name">html</span>></span>
|
||||
</code></pre>
|
||||
</span></div></article></div><div class="docs-prevnext"><a class="docs-prev button" href="publishing.html">← Publishing your site</a><a class="docs-next button" href="custom-pages.html">Custom Pages →</a></div></div></div><nav class="onPageNav"><ul class="toc-headings"><li><a href="#initial-setup">Initial Setup</a></li><li><a href="#adding-posts">Adding Posts</a></li><li><a href="#header-options">Header Options</a></li><li><a href="#summary-truncation">Summary Truncation</a></li><li><a href="#changing-how-many-blog-posts-show-on-sidebar">Changing How Many Blog Posts Show on Sidebar</a></li><li><a href="#rss-feed">RSS Feed</a></li><li><a href="#social-buttons">Social Buttons</a></li><li><a href="#advanced-topics">Advanced Topics</a><ul class="toc-headings"><li><a href="#i-want-to-run-in-blog-only-mode">I want to run in "Blog Only" mode.</a></li></ul></li></ul></nav></div><footer class="nav-footer" id="footer"><section class="sitemap"><a href="/" class="nav-home"><img src="/img/docusaurus_monochrome.svg" alt="Docusaurus" width="66" height="58"/></a><div><h5>Docs</h5><a href="
|
||||
</span></div></article></div><div class="docs-prevnext"><a class="docs-prev button" href="publishing">← Publishing your site</a><a class="docs-next button" href="custom-pages">Custom Pages →</a></div></div></div><nav class="onPageNav"><ul class="toc-headings"><li><a href="#initial-setup">Initial Setup</a></li><li><a href="#adding-posts">Adding Posts</a></li><li><a href="#header-options">Header Options</a></li><li><a href="#summary-truncation">Summary Truncation</a></li><li><a href="#changing-how-many-blog-posts-show-on-sidebar">Changing How Many Blog Posts Show on Sidebar</a></li><li><a href="#rss-feed">RSS Feed</a></li><li><a href="#social-buttons">Social Buttons</a></li><li><a href="#advanced-topics">Advanced Topics</a><ul class="toc-headings"><li><a href="#i-want-to-run-in-blog-only-mode">I want to run in "Blog Only" mode.</a></li></ul></li></ul></nav></div><footer class="nav-footer" id="footer"><section class="sitemap"><a href="/" class="nav-home"><img src="/img/docusaurus_monochrome.svg" alt="Docusaurus" width="66" height="58"/></a><div><h5>Docs</h5><a href="
|
||||
/docs/en/installation.html">Getting Started</a><a href="
|
||||
/docs/en/versioning.html">Versioning</a><a href="
|
||||
/docs/en/translation.html">Localization</a><a href="
|
||||
|
|
132
docs/en/next/blog/index.html
Normal file
132
docs/en/next/blog/index.html
Normal file
|
@ -0,0 +1,132 @@
|
|||
<!DOCTYPE html><html lang="en"><head><meta charSet="utf-8"/><meta http-equiv="X-UA-Compatible" content="IE=edge"/><title>Adding a Blog · Docusaurus</title><meta name="viewport" content="width=device-width"/><meta name="generator" content="Docusaurus"/><meta property="og:title" content="Adding a Blog · Docusaurus"/><meta property="og:type" content="website"/><meta property="og:url" content="https://docusaurus.io/index.html"/><meta property="og:description" content="## Initial Setup"/><meta property="og:image" content="https://docusaurus.io/img/docusaurus.png"/><meta name="twitter:card" content="summary"/><meta name="twitter:image" content="https://docusaurus.io/img/docusaurus.png"/><link rel="shortcut icon" href="/img/docusaurus.ico"/><link rel="stylesheet" href="https://cdn.jsdelivr.net/docsearch.js/1/docsearch.min.css"/><link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/highlight.js/9.12.0/styles/atom-one-dark.min.css"/><link rel="alternate" type="application/atom+xml" href="https://docusaurus.io/blog/atom.xml" title="Docusaurus Blog ATOM Feed"/><link rel="alternate" type="application/rss+xml" href="https://docusaurus.io/blog/feed.xml" title="Docusaurus Blog RSS Feed"/><script>
|
||||
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
|
||||
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
|
||||
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
|
||||
})(window,document,'script','https://www.google-analytics.com/analytics.js','ga');
|
||||
|
||||
ga('create', 'UA-44373548-31', 'auto');
|
||||
ga('send', 'pageview');
|
||||
</script><link rel="stylesheet" href="/css/code-blocks-buttons.css"/><script type="text/javascript" src="https://buttons.github.io/buttons.js"></script><script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/clipboard.js/2.0.0/clipboard.min.js"></script><script type="text/javascript" src="/js/code-blocks-buttons.js"></script><script src="https://unpkg.com/vanilla-back-to-top@7.1.14/dist/vanilla-back-to-top.min.js"></script><script>
|
||||
document.addEventListener("DOMContentLoaded", function(){
|
||||
addBackToTop(
|
||||
{"zIndex":100}
|
||||
)
|
||||
});
|
||||
</script><link rel="stylesheet" href="/css/main.css"/></head><body class="sideNavVisible doc separateOnPageNav"><div class="fixedHeaderContainer"><div class="headerWrapper wrapper"><header><a href="/en"><img class="logo" src="/img/docusaurus.svg" alt="Docusaurus"/><h2 class="headerTitleWithLogo">Docusaurus</h2></a><a href="/en/versions.html"><h3>next</h3></a><div class="navigationWrapper navigationSlider"><nav class="slidingNav"><ul class="nav-site nav-site-internal"><li class="siteNavGroupActive"><a href="/docs/en/next/installation" target="_self">Docs</a></li><li class=""><a href="/en/help" target="_self">Help</a></li><li class=""><a href="/en/users" target="_self">Users</a></li><li class=""><a href="/en/about-slash" target="_self">About /</a></li><li class=""><a href="/blog" target="_self">Blog</a></li><li class=""><a href="https://github.com/facebook/docusaurus" target="_self">GitHub</a></li><span><li><a id="languages-menu" href="#"><img class="languages-icon" src="/img/language.svg"/>English</a><div id="languages-dropdown" class="hide"><ul id="languages-dropdown-items"><li><a href="/es-ES">Español</a></li><li><a href="/ro">Română</a></li><li><a href="/tr">Türkçe</a></li><li><a href="/zh-CN">简体中文</a></li><li><a href="https://crowdin.com/project/docusaurus" target="_blank" rel="noreferrer noopener">Help Translate</a></li></ul></div></li><script>
|
||||
const languagesMenuItem = document.getElementById("languages-menu");
|
||||
const languagesDropDown = document.getElementById("languages-dropdown");
|
||||
languagesMenuItem.addEventListener("click", function(){
|
||||
if(languagesDropDown.className == "hide") {
|
||||
languagesDropDown.className = "visible";
|
||||
} else {
|
||||
languagesDropDown.className = "hide";
|
||||
}
|
||||
});
|
||||
</script></span><li class="navSearchWrapper reactNavSearchWrapper"><input type="text" id="search_input_react" placeholder="Search" title="Search"/></li></ul></nav></div></header></div></div><div class="navPusher"><div class="docMainWrapper wrapper"><div class="container docsNavContainer" id="docsNav"><nav class="toc"><div class="toggleNav"><section class="navWrapper wrapper"><div class="navBreadcrumb wrapper"><div class="navToggle" id="navToggler"><i></i></div><h2><i>›</i><span>Guides</span></h2></div><div class="navGroups"><div class="navGroup navGroupActive"><h3>Getting Started</h3><ul><li class="navListItem"><a class="navItem" href="/docs/en/next/installation">Installation</a></li><li class="navListItem"><a class="navItem" href="/docs/en/next/site-preparation">Site Preparation</a></li><li class="navListItem"><a class="navItem" href="/docs/en/next/site-creation">Creating your site</a></li><li class="navListItem"><a class="navItem" href="/docs/en/next/publishing">Publishing your site</a></li></ul></div><div class="navGroup navGroupActive"><h3>Guides</h3><ul><li class="navListItem navListItemActive"><a class="navItem navItemActive" href="/docs/en/next/blog">Adding a Blog</a></li><li class="navListItem"><a class="navItem" href="/docs/en/next/custom-pages">Custom Pages</a></li><li class="navListItem"><a class="navItem" href="/docs/en/next/search">Enabling Search</a></li><li class="navListItem"><a class="navItem" href="/docs/en/next/navigation">Navigation and Sidebars</a></li><li class="navListItem"><a class="navItem" href="/docs/en/next/translation">Translations & Localization</a></li><li class="navListItem"><a class="navItem" href="/docs/en/next/versioning">Versioning</a></li></ul></div><div class="navGroup navGroupActive"><h3>API</h3><ul><li class="navListItem"><a class="navItem" href="/docs/en/next/commands">CLI Commands</a></li><li class="navListItem"><a class="navItem" href="/docs/en/next/doc-markdown">Markdown Features</a></li><li class="navListItem"><a class="navItem" href="/docs/en/next/api-pages">Pages and Styles</a></li><li class="navListItem"><a class="navItem" href="/docs/en/next/site-config">siteConfig.js</a></li></ul></div></div></section></div><script>
|
||||
var toggler = document.getElementById('navToggler');
|
||||
var nav = document.getElementById('docsNav');
|
||||
toggler.onclick = function() {
|
||||
nav.classList.toggle('docsSliderActive');
|
||||
};
|
||||
</script></nav></div><div class="container mainContainer"><div class="wrapper"><div class="post"><header class="postHeader"><a class="edit-page-link button" href="https://github.com/facebook/docusaurus/edit/master/docs/guides-blog.md" target="_blank" rel="noreferrer noopener">Edit</a><h1>Adding a Blog</h1></header><article><div><span><h2><a class="anchor" aria-hidden="true" id="initial-setup"></a><a href="#initial-setup" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Initial Setup</h2>
|
||||
<p>To setup your site's blog, start by creating a <code>blog</code> folder within your repo's <code>website</code> directory.</p>
|
||||
<p>Then, add a header link to your blog within <code>siteConfig.js</code>:</p>
|
||||
<pre><code class="hljs css js">headerLinks: [
|
||||
...
|
||||
{ <span class="hljs-attr">blog</span>: <span class="hljs-literal">true</span>, <span class="hljs-attr">label</span>: <span class="hljs-string">'Blog'</span> },
|
||||
...
|
||||
]
|
||||
</code></pre>
|
||||
<h2><a class="anchor" aria-hidden="true" id="adding-posts"></a><a href="#adding-posts" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Adding Posts</h2>
|
||||
<p>To publish in the blog, create a file within the blog folder with a formatted name of <code>YYYY-MM-DD-My-Blog-Post-Title.md</code>. The post date is extracted from the file name.</p>
|
||||
<p>For example, at <code>website/blog/2017-08-18-Introducing-Docusaurus.md</code>:</p>
|
||||
<pre><code class="hljs css yml"><span class="hljs-meta">---</span>
|
||||
<span class="hljs-attr">author:</span> <span class="hljs-string">Frank</span> <span class="hljs-string">Li</span>
|
||||
<span class="hljs-attr">authorURL:</span> <span class="hljs-attr">https://twitter.com/foobarbaz</span>
|
||||
<span class="hljs-attr">authorFBID:</span> <span class="hljs-number">503283835</span>
|
||||
<span class="hljs-attr">title:</span> <span class="hljs-string">Introducing</span> <span class="hljs-string">Docusaurus</span>
|
||||
<span class="hljs-meta">---</span>
|
||||
|
||||
<span class="hljs-string">Lorem</span> <span class="hljs-string">Ipsum...</span>
|
||||
</code></pre>
|
||||
<h2><a class="anchor" aria-hidden="true" id="header-options"></a><a href="#header-options" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Header Options</h2>
|
||||
<p>The only required field is <code>title</code>; however, we provide options to add author information to your blog post as well.</p>
|
||||
<ul>
|
||||
<li><code>author</code> - The text label of the author byline.</li>
|
||||
<li><code>authorURL</code> - The URL associated with the author. This could be a Twitter, GitHub, Facebook account, etc.</li>
|
||||
<li><code>authorFBID</code> - The Facebook profile ID that is used to fetch the profile picture.</li>
|
||||
<li><code>authorImageURL</code> - The URL to the author's image. (Note: If you use both <code>authorFBID</code> and <code>authorImageURL</code>, <code>authorFBID</code> will take precedence. Don't include <code>authorFBID</code> if you want <code>authorImageURL</code> to appear.)</li>
|
||||
<li><code>title</code> - The blog post title.</li>
|
||||
</ul>
|
||||
<h2><a class="anchor" aria-hidden="true" id="summary-truncation"></a><a href="#summary-truncation" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Summary Truncation</h2>
|
||||
<p>Use the <code><!--truncate--></code> marker in your blog post to represent what will be shown as the summary when viewing all blog published blog posts. Anything above <code><!--truncate--></code> will be part of the summary. For example:</p>
|
||||
<pre><code class="hljs css yaml"><span class="hljs-meta">---</span>
|
||||
<span class="hljs-attr">title:</span> <span class="hljs-string">Truncation</span> <span class="hljs-string">Example</span>
|
||||
<span class="hljs-meta">---</span>
|
||||
|
||||
<span class="hljs-string">All</span> <span class="hljs-string">this</span> <span class="hljs-string">will</span> <span class="hljs-string">be</span> <span class="hljs-string">part</span> <span class="hljs-string">of</span> <span class="hljs-string">the</span> <span class="hljs-string">blog</span> <span class="hljs-string">post</span> <span class="hljs-string">summary.</span>
|
||||
|
||||
<span class="hljs-string">Even</span> <span class="hljs-string">this.</span>
|
||||
|
||||
<span class="hljs-string"><!--truncate--></span>
|
||||
|
||||
<span class="hljs-string">But</span> <span class="hljs-string">anything</span> <span class="hljs-string">from</span> <span class="hljs-string">here</span> <span class="hljs-string">on</span> <span class="hljs-string">down</span> <span class="hljs-string">will</span> <span class="hljs-string">not</span> <span class="hljs-string">be.</span>
|
||||
|
||||
<span class="hljs-string">Not</span> <span class="hljs-string">this.</span>
|
||||
|
||||
<span class="hljs-string">Or</span> <span class="hljs-string">this.</span>
|
||||
</code></pre>
|
||||
<h2><a class="anchor" aria-hidden="true" id="changing-how-many-blog-posts-show-on-sidebar"></a><a href="#changing-how-many-blog-posts-show-on-sidebar" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Changing How Many Blog Posts Show on Sidebar</h2>
|
||||
<p>By default, 5 recent blog posts are shown on the sidebar.</p>
|
||||
<p>You can configure a specific amount of blog posts to show by adding a <code>blogSidebarCount</code> setting to your <code>siteConfig.js</code>.</p>
|
||||
<p>The available options are an integer representing the number of posts you wish to show or a string with the value 'ALL'.</p>
|
||||
<p>Example:</p>
|
||||
<pre><code class="hljs css js">blogSidebarCount: <span class="hljs-string">'ALL'</span>
|
||||
</code></pre>
|
||||
<h2><a class="anchor" aria-hidden="true" id="rss-feed"></a><a href="#rss-feed" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>RSS Feed</h2>
|
||||
<p>Docusaurus provides a simple RSS feed for your blog posts. Both RSS and Atom feed formats are supported. This data is automatically to your website page's HTML <HEAD> tag.</p>
|
||||
<p>A summary of the post's text is provided in the RSS feed up to the <code><!--truncate--></code>. If no <code><!--truncate--></code> tag is found, then all text up 250 characters are used.</p>
|
||||
<h2><a class="anchor" aria-hidden="true" id="social-buttons"></a><a href="#social-buttons" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Social Buttons</h2>
|
||||
<p>If you want Facebook and/or Twitter social buttons at the bottom of your blog posts, set the <code>facebookAppId</code> and/or <code>twitter</code> <a href="/docs/en/next/site-config">site configuration</a> options in <code>siteConfig.js</code>.</p>
|
||||
<h2><a class="anchor" aria-hidden="true" id="advanced-topics"></a><a href="#advanced-topics" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Advanced Topics</h2>
|
||||
<h3><a class="anchor" aria-hidden="true" id="i-want-to-run-in-blog-only-mode"></a><a href="#i-want-to-run-in-blog-only-mode" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>I want to run in "Blog Only" mode.</h3>
|
||||
<p>You can run your Docusaurus site without a landing page and instead have your blog load first.</p>
|
||||
<p>To do this:</p>
|
||||
<ol>
|
||||
<li>Create a file <code>index.html</code> in <code>website/static/</code>.</li>
|
||||
<li>Place the contents of the template below into <code>website/static/index.html</code></li>
|
||||
<li>Customize the <code><title></code> of <code>website/static/index.html</code></li>
|
||||
<li>Delete the dynamic landing page <code>website/pages/en/index.js</code></li>
|
||||
</ol>
|
||||
<blockquote>
|
||||
<p>Now, when Docusaurus generates or builds your site, it will copy the file from <code>static/index.html</code> and place it in the site's main folder. The static file is served when a visitor arrives on your page. When the page loads it will redirect the visitor to <code>/blog</code>.</p>
|
||||
</blockquote>
|
||||
<p>You can use this template:</p>
|
||||
<pre><code class="hljs css html"><span class="hljs-meta"><!DOCTYPE HTML></span>
|
||||
<span class="hljs-tag"><<span class="hljs-name">html</span> <span class="hljs-attr">lang</span>=<span class="hljs-string">"en-US"</span>></span>
|
||||
<span class="hljs-tag"><<span class="hljs-name">head</span>></span>
|
||||
<span class="hljs-tag"><<span class="hljs-name">meta</span> <span class="hljs-attr">charset</span>=<span class="hljs-string">"UTF-8"</span>></span>
|
||||
<span class="hljs-tag"><<span class="hljs-name">meta</span> <span class="hljs-attr">http-equiv</span>=<span class="hljs-string">"refresh"</span> <span class="hljs-attr">content</span>=<span class="hljs-string">"0; url=blog/"</span>></span>
|
||||
<span class="hljs-tag"><<span class="hljs-name">script</span> <span class="hljs-attr">type</span>=<span class="hljs-string">"text/javascript"</span>></span><span class="javascript">
|
||||
<span class="hljs-built_in">window</span>.location.href = <span class="hljs-string">'blog/'</span>;
|
||||
</span><span class="hljs-tag"></<span class="hljs-name">script</span>></span>
|
||||
<span class="hljs-tag"><<span class="hljs-name">title</span>></span>Title of Your Blog<span class="hljs-tag"></<span class="hljs-name">title</span>></span>
|
||||
<span class="hljs-tag"></<span class="hljs-name">head</span>></span>
|
||||
<span class="hljs-tag"><<span class="hljs-name">body</span>></span>
|
||||
If you are not redirected automatically, follow this <span class="hljs-tag"><<span class="hljs-name">a</span> <span class="hljs-attr">href</span>=<span class="hljs-string">"blog/"</span>></span>link<span class="hljs-tag"></<span class="hljs-name">a</span>></span>.
|
||||
<span class="hljs-tag"></<span class="hljs-name">body</span>></span>
|
||||
<span class="hljs-tag"></<span class="hljs-name">html</span>></span>
|
||||
</code></pre>
|
||||
</span></div></article></div><div class="docs-prevnext"><a class="docs-prev button" href="publishing">← Publishing your site</a><a class="docs-next button" href="custom-pages">Custom Pages →</a></div></div></div><nav class="onPageNav"><ul class="toc-headings"><li><a href="#initial-setup">Initial Setup</a></li><li><a href="#adding-posts">Adding Posts</a></li><li><a href="#header-options">Header Options</a></li><li><a href="#summary-truncation">Summary Truncation</a></li><li><a href="#changing-how-many-blog-posts-show-on-sidebar">Changing How Many Blog Posts Show on Sidebar</a></li><li><a href="#rss-feed">RSS Feed</a></li><li><a href="#social-buttons">Social Buttons</a></li><li><a href="#advanced-topics">Advanced Topics</a><ul class="toc-headings"><li><a href="#i-want-to-run-in-blog-only-mode">I want to run in "Blog Only" mode.</a></li></ul></li></ul></nav></div><footer class="nav-footer" id="footer"><section class="sitemap"><a href="/" class="nav-home"><img src="/img/docusaurus_monochrome.svg" alt="Docusaurus" width="66" height="58"/></a><div><h5>Docs</h5><a href="
|
||||
/docs/en/installation.html">Getting Started</a><a href="
|
||||
/docs/en/versioning.html">Versioning</a><a href="
|
||||
/docs/en/translation.html">Localization</a><a href="
|
||||
/docs/en/search.html">Adding Search</a></div><div><h5>Community</h5><a href="/en/users.html">User Showcase</a></div><div><h5>More</h5><div class="social"><a class="github-button" href="https://github.com/facebook/Docusaurus" data-count-href="/facebook/Docusaurus/stargazers" data-show-count="true" data-count-aria-label="# stargazers on GitHub" aria-label="Star this project on GitHub">Docusaurus</a></div><div class="social"><a href="https://twitter.com/docusaurus" class="twitter-follow-button">Follow @docusaurus</a></div><div class="social"><div class="fb-like" data-href="https://docusaurus.io" data-layout="standard" data-share="true" data-width="225" data-show-faces="false"></div></div></div></section><a href="https://code.facebook.com/projects/" target="_blank" rel="noreferrer noopener" class="fbOpenSource"><img src="/img/oss_logo.png" alt="Facebook Open Source" width="170" height="45"/></a><section class="copyright"><span>Copyright © 2018 Facebook Inc.</span></section></footer></div><script type="text/javascript" src="https://cdn.jsdelivr.net/docsearch.js/1/docsearch.min.js"></script><script>window.fbAsyncInit = function() {FB.init({appId:'199138890728411',xfbml:true,version:'v2.7'});};(function(d, s, id){var js, fjs = d.getElementsByTagName(s)[0];if (d.getElementById(id)) {return;}js = d.createElement(s); js.id = id;js.src = '//connect.facebook.net/en_US/sdk.js';fjs.parentNode.insertBefore(js, fjs);}(document, 'script','facebook-jssdk'));
|
||||
</script><script>window.twttr=(function(d,s, id){var js,fjs=d.getElementsByTagName(s)[0],t=window.twttr||{};if(d.getElementById(id))return t;js=d.createElement(s);js.id=id;js.src='https://platform.twitter.com/widgets.js';fjs.parentNode.insertBefore(js, fjs);t._e = [];t.ready = function(f) {t._e.push(f);};return t;}(document, 'script', 'twitter-wjs'));</script><script>
|
||||
var search = docsearch({
|
||||
|
||||
apiKey: '3eb9507824b8be89e7a199ecaa1a9d2c',
|
||||
indexName: 'docusaurus',
|
||||
inputSelector: '#search_input_react'
|
||||
});
|
||||
</script></body></html>
|
|
@ -12,7 +12,7 @@
|
|||
{"zIndex":100}
|
||||
)
|
||||
});
|
||||
</script><link rel="stylesheet" href="/css/main.css"/></head><body class="sideNavVisible doc separateOnPageNav"><div class="fixedHeaderContainer"><div class="headerWrapper wrapper"><header><a href="/en"><img class="logo" src="/img/docusaurus.svg" alt="Docusaurus"/><h2 class="headerTitleWithLogo">Docusaurus</h2></a><a href="/en/versions.html"><h3>next</h3></a><div class="navigationWrapper navigationSlider"><nav class="slidingNav"><ul class="nav-site nav-site-internal"><li class="siteNavGroupActive"><a href="/docs/en/next/installation.html" target="_self">Docs</a></li><li class=""><a href="/en/help.html" target="_self">Help</a></li><li class=""><a href="/en/users.html" target="_self">Users</a></li><li class=""><a href="/en/about-slash.html" target="_self">About /</a></li><li class=""><a href="/blog" target="_self">Blog</a></li><li class=""><a href="https://github.com/facebook/docusaurus" target="_self">GitHub</a></li><span><li><a id="languages-menu" href="#"><img class="languages-icon" src="/img/language.svg"/>English</a><div id="languages-dropdown" class="hide"><ul id="languages-dropdown-items"><li><a href="/es-ES">Español</a></li><li><a href="/ro">Română</a></li><li><a href="/tr">Türkçe</a></li><li><a href="/zh-CN">简体中文</a></li><li><a href="https://crowdin.com/project/docusaurus" target="_blank" rel="noreferrer noopener">Help Translate</a></li></ul></div></li><script>
|
||||
</script><link rel="stylesheet" href="/css/main.css"/></head><body class="sideNavVisible doc separateOnPageNav"><div class="fixedHeaderContainer"><div class="headerWrapper wrapper"><header><a href="/en"><img class="logo" src="/img/docusaurus.svg" alt="Docusaurus"/><h2 class="headerTitleWithLogo">Docusaurus</h2></a><a href="/en/versions.html"><h3>next</h3></a><div class="navigationWrapper navigationSlider"><nav class="slidingNav"><ul class="nav-site nav-site-internal"><li class="siteNavGroupActive"><a href="/docs/en/next/installation" target="_self">Docs</a></li><li class=""><a href="/en/help" target="_self">Help</a></li><li class=""><a href="/en/users" target="_self">Users</a></li><li class=""><a href="/en/about-slash" target="_self">About /</a></li><li class=""><a href="/blog" target="_self">Blog</a></li><li class=""><a href="https://github.com/facebook/docusaurus" target="_self">GitHub</a></li><span><li><a id="languages-menu" href="#"><img class="languages-icon" src="/img/language.svg"/>English</a><div id="languages-dropdown" class="hide"><ul id="languages-dropdown-items"><li><a href="/es-ES">Español</a></li><li><a href="/ro">Română</a></li><li><a href="/tr">Türkçe</a></li><li><a href="/zh-CN">简体中文</a></li><li><a href="https://crowdin.com/project/docusaurus" target="_blank" rel="noreferrer noopener">Help Translate</a></li></ul></div></li><script>
|
||||
const languagesMenuItem = document.getElementById("languages-menu");
|
||||
const languagesDropDown = document.getElementById("languages-dropdown");
|
||||
languagesMenuItem.addEventListener("click", function(){
|
||||
|
@ -22,7 +22,7 @@
|
|||
languagesDropDown.className = "hide";
|
||||
}
|
||||
});
|
||||
</script></span><li class="navSearchWrapper reactNavSearchWrapper"><input type="text" id="search_input_react" placeholder="Search" title="Search"/></li></ul></nav></div></header></div></div><div class="navPusher"><div class="docMainWrapper wrapper"><div class="container docsNavContainer" id="docsNav"><nav class="toc"><div class="toggleNav"><section class="navWrapper wrapper"><div class="navBreadcrumb wrapper"><div class="navToggle" id="navToggler"><i></i></div><h2><i>›</i><span>API</span></h2></div><div class="navGroups"><div class="navGroup navGroupActive"><h3>Getting Started</h3><ul><li class="navListItem"><a class="navItem" href="/docs/en/next/installation.html">Installation</a></li><li class="navListItem"><a class="navItem" href="/docs/en/next/site-preparation.html">Site Preparation</a></li><li class="navListItem"><a class="navItem" href="/docs/en/next/site-creation.html">Creating your site</a></li><li class="navListItem"><a class="navItem" href="/docs/en/next/publishing.html">Publishing your site</a></li></ul></div><div class="navGroup navGroupActive"><h3>Guides</h3><ul><li class="navListItem"><a class="navItem" href="/docs/en/next/blog.html">Adding a Blog</a></li><li class="navListItem"><a class="navItem" href="/docs/en/next/custom-pages.html">Custom Pages</a></li><li class="navListItem"><a class="navItem" href="/docs/en/next/search.html">Enabling Search</a></li><li class="navListItem"><a class="navItem" href="/docs/en/next/navigation.html">Navigation and Sidebars</a></li><li class="navListItem"><a class="navItem" href="/docs/en/next/translation.html">Translations & Localization</a></li><li class="navListItem"><a class="navItem" href="/docs/en/next/versioning.html">Versioning</a></li></ul></div><div class="navGroup navGroupActive"><h3>API</h3><ul><li class="navListItem navListItemActive"><a class="navItem navItemActive" href="/docs/en/next/commands.html">CLI Commands</a></li><li class="navListItem"><a class="navItem" href="/docs/en/next/doc-markdown.html">Markdown Features</a></li><li class="navListItem"><a class="navItem" href="/docs/en/next/api-pages.html">Pages and Styles</a></li><li class="navListItem"><a class="navItem" href="/docs/en/next/site-config.html">siteConfig.js</a></li></ul></div></div></section></div><script>
|
||||
</script></span><li class="navSearchWrapper reactNavSearchWrapper"><input type="text" id="search_input_react" placeholder="Search" title="Search"/></li></ul></nav></div></header></div></div><div class="navPusher"><div class="docMainWrapper wrapper"><div class="container docsNavContainer" id="docsNav"><nav class="toc"><div class="toggleNav"><section class="navWrapper wrapper"><div class="navBreadcrumb wrapper"><div class="navToggle" id="navToggler"><i></i></div><h2><i>›</i><span>API</span></h2></div><div class="navGroups"><div class="navGroup navGroupActive"><h3>Getting Started</h3><ul><li class="navListItem"><a class="navItem" href="/docs/en/next/installation">Installation</a></li><li class="navListItem"><a class="navItem" href="/docs/en/next/site-preparation">Site Preparation</a></li><li class="navListItem"><a class="navItem" href="/docs/en/next/site-creation">Creating your site</a></li><li class="navListItem"><a class="navItem" href="/docs/en/next/publishing">Publishing your site</a></li></ul></div><div class="navGroup navGroupActive"><h3>Guides</h3><ul><li class="navListItem"><a class="navItem" href="/docs/en/next/blog">Adding a Blog</a></li><li class="navListItem"><a class="navItem" href="/docs/en/next/custom-pages">Custom Pages</a></li><li class="navListItem"><a class="navItem" href="/docs/en/next/search">Enabling Search</a></li><li class="navListItem"><a class="navItem" href="/docs/en/next/navigation">Navigation and Sidebars</a></li><li class="navListItem"><a class="navItem" href="/docs/en/next/translation">Translations & Localization</a></li><li class="navListItem"><a class="navItem" href="/docs/en/next/versioning">Versioning</a></li></ul></div><div class="navGroup navGroupActive"><h3>API</h3><ul><li class="navListItem navListItemActive"><a class="navItem navItemActive" href="/docs/en/next/commands">CLI Commands</a></li><li class="navListItem"><a class="navItem" href="/docs/en/next/doc-markdown">Markdown Features</a></li><li class="navListItem"><a class="navItem" href="/docs/en/next/api-pages">Pages and Styles</a></li><li class="navListItem"><a class="navItem" href="/docs/en/next/site-config">siteConfig.js</a></li></ul></div></div></section></div><script>
|
||||
var toggler = document.getElementById('navToggler');
|
||||
var nav = document.getElementById('docsNav');
|
||||
toggler.onclick = function() {
|
||||
|
@ -30,8 +30,8 @@
|
|||
};
|
||||
</script></nav></div><div class="container mainContainer"><div class="wrapper"><div class="post"><header class="postHeader"><a class="edit-page-link button" href="https://github.com/facebook/docusaurus/edit/master/docs/api-commands.md" target="_blank" rel="noreferrer noopener">Edit</a><h1>CLI Commands</h1></header><article><div><span><p>Docusaurus provides a set of scripts to help you generate, serve, and deploy your website. These scripts can be invoked with the <code>run</code> command when using Yarn or npm. Some common commands are:</p>
|
||||
<ul>
|
||||
<li><a href="/docs/en/next/commands.html#docusaurus-start-port-number"><code>yarn run start</code></a>: build and serve the website from a local server</li>
|
||||
<li><a href="/docs/en/next/commands.html#docusaurus-examples"><code>yarn run examples</code></a>: create example configuration files</li>
|
||||
<li><a href="/docs/en/next/commands#docusaurus-start-port-number"><code>yarn run start</code></a>: build and serve the website from a local server</li>
|
||||
<li><a href="/docs/en/next/commands#docusaurus-examples"><code>yarn run examples</code></a>: create example configuration files</li>
|
||||
</ul>
|
||||
<h2><a class="anchor" aria-hidden="true" id="running-from-the-command-line"></a><a href="#running-from-the-command-line" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Running from the command line</h2>
|
||||
<p>The scripts can be run using either Yarn or npm. If you've already gone through our Getting Started guide, you may already be familiar with the <code>start</code> command. It's the command that tells Docusaurus to run the <code>docusaurus-start</code> script which generates the site and starts up a server, and it's usually invoked like so:</p>
|
||||
|
@ -49,7 +49,7 @@
|
|||
<pre><code class="hljs css bash">npm run start -- --port 8080
|
||||
</code></pre>
|
||||
<h2><a class="anchor" aria-hidden="true" id="configuration"></a><a href="#configuration" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Configuration</h2>
|
||||
<p>These scripts are set up under the <code>"scripts"</code> key in your <code>website/package.json</code> file as part of the installation process. If you need help setting them up again, please refer to the <a href="/docs/en/next/installation.html">Installation guide</a>.</p>
|
||||
<p>These scripts are set up under the <code>"scripts"</code> key in your <code>website/package.json</code> file as part of the installation process. If you need help setting them up again, please refer to the <a href="/docs/en/next/installation">Installation guide</a>.</p>
|
||||
<p>Docusaurus provides some default mappings to allow you to run commands following Node conventions. Instead of typing <code>docusaurus-start</code> every time, you can type <code>yarn run start</code> or <code>npm start</code> to achieve the same.</p>
|
||||
<h2><a class="anchor" aria-hidden="true" id="commands"></a><a href="#commands" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Commands</h2>
|
||||
<ul>
|
||||
|
@ -74,7 +74,7 @@
|
|||
</tbody>
|
||||
</table>
|
||||
<p>Generates the static website, applying translations if necessary. Useful for building the website prior to deployment.</p>
|
||||
<p>See also <a href="/docs/en/next/commands.html#docusaurus-start"><code>docusaurus-start</code></a>.</p>
|
||||
<p>See also <a href="/docs/en/next/commands#docusaurus-start"><code>docusaurus-start</code></a>.</p>
|
||||
<hr>
|
||||
<h3><a class="anchor" aria-hidden="true" id="docusaurus-examples"></a><a href="#docusaurus-examples" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a><code>docusaurus-examples</code></h3>
|
||||
<p>Alias: <code>examples</code></p>
|
||||
|
@ -89,11 +89,11 @@
|
|||
<p><strong>Example</strong></p>
|
||||
<pre><code class="hljs css bash">docusaurus-examples <feature>
|
||||
</code></pre>
|
||||
<p>When no feature is specified, sets up a minimally configured example website in your project. This command is covered in depth in the <a href="/docs/en/next/site-preparation.html">Site Preparation guide</a>.</p>
|
||||
<p>When no feature is specified, sets up a minimally configured example website in your project. This command is covered in depth in the <a href="/docs/en/next/site-preparation">Site Preparation guide</a>.</p>
|
||||
<hr>
|
||||
<h3><a class="anchor" aria-hidden="true" id="docusaurus-publish"></a><a href="#docusaurus-publish" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a><code>docusaurus-publish</code></h3>
|
||||
<p>Alias: <code>publish-gh-pages</code></p>
|
||||
<p><a href="/docs/en/next/commands.html#docusaurus-build">Builds</a>, then deploys the static website to GitHub Pages. This command is meant to be run during the deployment step in Circle CI, and therefore expects a few environment variables to be defined:</p>
|
||||
<p><a href="/docs/en/next/commands#docusaurus-build">Builds</a>, then deploys the static website to GitHub Pages. This command is meant to be run during the deployment step in Circle CI, and therefore expects a few environment variables to be defined:</p>
|
||||
<p>The following environment variables are generally set manually by the user in the CircleCI <code>config.yml</code> file.</p>
|
||||
<ul>
|
||||
<li><code>GIT_USER</code>: The git user to be associated with the deploy commit.</li>
|
||||
|
@ -112,7 +112,7 @@
|
|||
<li><code>CIRCLE_PROJECT_USERNAME</code>: The GitHub username or organization name that hosts the Git repo, e.g. "facebook".</li>
|
||||
<li><code>CIRCLE_PROJECT_REPONAME</code>: The name of the Git repo, e.g. "Docusaurus".</li>
|
||||
</ul>
|
||||
<p>You can learn more about configuring automatic deployments with CircleCI in the <a href="/docs/en/next/publishing.html">Publishing guide</a>.</p>
|
||||
<p>You can learn more about configuring automatic deployments with CircleCI in the <a href="/docs/en/next/publishing">Publishing guide</a>.</p>
|
||||
<hr>
|
||||
<h3><a class="anchor" aria-hidden="true" id="docusaurus-rename-version"></a><a href="#docusaurus-rename-version" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a><code>docusaurus-rename-version</code></h3>
|
||||
<p>Alias: <code>rename-version</code></p>
|
||||
|
@ -129,7 +129,7 @@
|
|||
<p><strong>Example</strong></p>
|
||||
<pre><code class="hljs css bash">docusaurus-rename-version <currentVersion> <newVersion>
|
||||
</code></pre>
|
||||
<p>See the <a href="/docs/en/next/versioning.html#renaming-existing-versions">Versioning guide</a> to learn more.</p>
|
||||
<p>See the <a href="/docs/en/next/versioning#renaming-existing-versions">Versioning guide</a> to learn more.</p>
|
||||
<hr>
|
||||
<h3><a class="anchor" aria-hidden="true" id="docusaurus-start"></a><a href="#docusaurus-start" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a><code>docusaurus-start</code></h3>
|
||||
<p>Alias: <code>start</code>.</p>
|
||||
|
@ -146,12 +146,12 @@
|
|||
<h3><a class="anchor" aria-hidden="true" id="docusaurus-version-version"></a><a href="#docusaurus-version-version" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a><code>docusaurus-version <version></code></h3>
|
||||
<p>Alias: <code>version</code></p>
|
||||
<p>Generates a new version of the docs. This will result in a new copy of your site being generated and stored in its own versioned folder. Useful for capturing snapshots of API docs that map to specific versions of your software. Accepts any string as a version number.</p>
|
||||
<p>See the <a href="/docs/en/next/versioning.html">Versioning guide</a> to learn more.</p>
|
||||
<p>See the <a href="/docs/en/next/versioning">Versioning guide</a> to learn more.</p>
|
||||
<hr>
|
||||
<h3><a class="anchor" aria-hidden="true" id="docusaurus-write-translations"></a><a href="#docusaurus-write-translations" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a><code>docusaurus-write-translations</code></h3>
|
||||
<p>Alias: <code>write-translations</code></p>
|
||||
<p>Writes the English for any strings that need to be translated into an <code>website/i18n/en.json</code> file. The script will go through every file in <code>website/pages/en</code> and through the <code>siteConfig.js</code> file and other config files to fetch English strings that will then be translated on Crowdin. See the <a href="/docs/en/next/translation.html">Translation guide</a> to learn more.</p>
|
||||
</span></div></article></div><div class="docs-prevnext"><a class="docs-prev button" href="versioning.html">← Versioning</a><a class="docs-next button" href="doc-markdown.html">Markdown Features →</a></div></div></div><nav class="onPageNav"><ul class="toc-headings"><li><a href="#running-from-the-command-line">Running from the command line</a></li><li><a href="#using-arguments">Using arguments</a></li><li><a href="#configuration">Configuration</a></li><li><a href="#commands">Commands</a></li><li><a href="#reference">Reference</a><ul class="toc-headings"><li><a href="#docusaurus-build"><code>docusaurus-build</code></a></li><li><a href="#docusaurus-examples"><code>docusaurus-examples</code></a></li><li><a href="#docusaurus-publish"><code>docusaurus-publish</code></a></li><li><a href="#docusaurus-rename-version"><code>docusaurus-rename-version</code></a></li><li><a href="#docusaurus-start"><code>docusaurus-start</code></a></li><li><a href="#docusaurus-version-version"><code>docusaurus-version</code></a></li><li><a href="#docusaurus-write-translations"><code>docusaurus-write-translations</code></a></li></ul></li></ul></nav></div><footer class="nav-footer" id="footer"><section class="sitemap"><a href="/" class="nav-home"><img src="/img/docusaurus_monochrome.svg" alt="Docusaurus" width="66" height="58"/></a><div><h5>Docs</h5><a href="
|
||||
<p>Writes the English for any strings that need to be translated into an <code>website/i18n/en.json</code> file. The script will go through every file in <code>website/pages/en</code> and through the <code>siteConfig.js</code> file and other config files to fetch English strings that will then be translated on Crowdin. See the <a href="/docs/en/next/translation">Translation guide</a> to learn more.</p>
|
||||
</span></div></article></div><div class="docs-prevnext"><a class="docs-prev button" href="versioning">← Versioning</a><a class="docs-next button" href="doc-markdown">Markdown Features →</a></div></div></div><nav class="onPageNav"><ul class="toc-headings"><li><a href="#running-from-the-command-line">Running from the command line</a></li><li><a href="#using-arguments">Using arguments</a></li><li><a href="#configuration">Configuration</a></li><li><a href="#commands">Commands</a></li><li><a href="#reference">Reference</a><ul class="toc-headings"><li><a href="#docusaurus-build"><code>docusaurus-build</code></a></li><li><a href="#docusaurus-examples"><code>docusaurus-examples</code></a></li><li><a href="#docusaurus-publish"><code>docusaurus-publish</code></a></li><li><a href="#docusaurus-rename-version"><code>docusaurus-rename-version</code></a></li><li><a href="#docusaurus-start"><code>docusaurus-start</code></a></li><li><a href="#docusaurus-version-version"><code>docusaurus-version</code></a></li><li><a href="#docusaurus-write-translations"><code>docusaurus-write-translations</code></a></li></ul></li></ul></nav></div><footer class="nav-footer" id="footer"><section class="sitemap"><a href="/" class="nav-home"><img src="/img/docusaurus_monochrome.svg" alt="Docusaurus" width="66" height="58"/></a><div><h5>Docs</h5><a href="
|
||||
/docs/en/installation.html">Getting Started</a><a href="
|
||||
/docs/en/versioning.html">Versioning</a><a href="
|
||||
/docs/en/translation.html">Localization</a><a href="
|
||||
|
|
166
docs/en/next/commands/index.html
Normal file
166
docs/en/next/commands/index.html
Normal file
|
@ -0,0 +1,166 @@
|
|||
<!DOCTYPE html><html lang="en"><head><meta charSet="utf-8"/><meta http-equiv="X-UA-Compatible" content="IE=edge"/><title>CLI Commands · Docusaurus</title><meta name="viewport" content="width=device-width"/><meta name="generator" content="Docusaurus"/><meta property="og:title" content="CLI Commands · Docusaurus"/><meta property="og:type" content="website"/><meta property="og:url" content="https://docusaurus.io/index.html"/><meta property="og:description" content="Docusaurus provides a set of scripts to help you generate, serve, and deploy your website. These scripts can be invoked with the `run` command when using Yarn or npm. Some common commands are:"/><meta property="og:image" content="https://docusaurus.io/img/docusaurus.png"/><meta name="twitter:card" content="summary"/><meta name="twitter:image" content="https://docusaurus.io/img/docusaurus.png"/><link rel="shortcut icon" href="/img/docusaurus.ico"/><link rel="stylesheet" href="https://cdn.jsdelivr.net/docsearch.js/1/docsearch.min.css"/><link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/highlight.js/9.12.0/styles/atom-one-dark.min.css"/><link rel="alternate" type="application/atom+xml" href="https://docusaurus.io/blog/atom.xml" title="Docusaurus Blog ATOM Feed"/><link rel="alternate" type="application/rss+xml" href="https://docusaurus.io/blog/feed.xml" title="Docusaurus Blog RSS Feed"/><script>
|
||||
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
|
||||
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
|
||||
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
|
||||
})(window,document,'script','https://www.google-analytics.com/analytics.js','ga');
|
||||
|
||||
ga('create', 'UA-44373548-31', 'auto');
|
||||
ga('send', 'pageview');
|
||||
</script><link rel="stylesheet" href="/css/code-blocks-buttons.css"/><script type="text/javascript" src="https://buttons.github.io/buttons.js"></script><script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/clipboard.js/2.0.0/clipboard.min.js"></script><script type="text/javascript" src="/js/code-blocks-buttons.js"></script><script src="https://unpkg.com/vanilla-back-to-top@7.1.14/dist/vanilla-back-to-top.min.js"></script><script>
|
||||
document.addEventListener("DOMContentLoaded", function(){
|
||||
addBackToTop(
|
||||
{"zIndex":100}
|
||||
)
|
||||
});
|
||||
</script><link rel="stylesheet" href="/css/main.css"/></head><body class="sideNavVisible doc separateOnPageNav"><div class="fixedHeaderContainer"><div class="headerWrapper wrapper"><header><a href="/en"><img class="logo" src="/img/docusaurus.svg" alt="Docusaurus"/><h2 class="headerTitleWithLogo">Docusaurus</h2></a><a href="/en/versions.html"><h3>next</h3></a><div class="navigationWrapper navigationSlider"><nav class="slidingNav"><ul class="nav-site nav-site-internal"><li class="siteNavGroupActive"><a href="/docs/en/next/installation" target="_self">Docs</a></li><li class=""><a href="/en/help" target="_self">Help</a></li><li class=""><a href="/en/users" target="_self">Users</a></li><li class=""><a href="/en/about-slash" target="_self">About /</a></li><li class=""><a href="/blog" target="_self">Blog</a></li><li class=""><a href="https://github.com/facebook/docusaurus" target="_self">GitHub</a></li><span><li><a id="languages-menu" href="#"><img class="languages-icon" src="/img/language.svg"/>English</a><div id="languages-dropdown" class="hide"><ul id="languages-dropdown-items"><li><a href="/es-ES">Español</a></li><li><a href="/ro">Română</a></li><li><a href="/tr">Türkçe</a></li><li><a href="/zh-CN">简体中文</a></li><li><a href="https://crowdin.com/project/docusaurus" target="_blank" rel="noreferrer noopener">Help Translate</a></li></ul></div></li><script>
|
||||
const languagesMenuItem = document.getElementById("languages-menu");
|
||||
const languagesDropDown = document.getElementById("languages-dropdown");
|
||||
languagesMenuItem.addEventListener("click", function(){
|
||||
if(languagesDropDown.className == "hide") {
|
||||
languagesDropDown.className = "visible";
|
||||
} else {
|
||||
languagesDropDown.className = "hide";
|
||||
}
|
||||
});
|
||||
</script></span><li class="navSearchWrapper reactNavSearchWrapper"><input type="text" id="search_input_react" placeholder="Search" title="Search"/></li></ul></nav></div></header></div></div><div class="navPusher"><div class="docMainWrapper wrapper"><div class="container docsNavContainer" id="docsNav"><nav class="toc"><div class="toggleNav"><section class="navWrapper wrapper"><div class="navBreadcrumb wrapper"><div class="navToggle" id="navToggler"><i></i></div><h2><i>›</i><span>API</span></h2></div><div class="navGroups"><div class="navGroup navGroupActive"><h3>Getting Started</h3><ul><li class="navListItem"><a class="navItem" href="/docs/en/next/installation">Installation</a></li><li class="navListItem"><a class="navItem" href="/docs/en/next/site-preparation">Site Preparation</a></li><li class="navListItem"><a class="navItem" href="/docs/en/next/site-creation">Creating your site</a></li><li class="navListItem"><a class="navItem" href="/docs/en/next/publishing">Publishing your site</a></li></ul></div><div class="navGroup navGroupActive"><h3>Guides</h3><ul><li class="navListItem"><a class="navItem" href="/docs/en/next/blog">Adding a Blog</a></li><li class="navListItem"><a class="navItem" href="/docs/en/next/custom-pages">Custom Pages</a></li><li class="navListItem"><a class="navItem" href="/docs/en/next/search">Enabling Search</a></li><li class="navListItem"><a class="navItem" href="/docs/en/next/navigation">Navigation and Sidebars</a></li><li class="navListItem"><a class="navItem" href="/docs/en/next/translation">Translations & Localization</a></li><li class="navListItem"><a class="navItem" href="/docs/en/next/versioning">Versioning</a></li></ul></div><div class="navGroup navGroupActive"><h3>API</h3><ul><li class="navListItem navListItemActive"><a class="navItem navItemActive" href="/docs/en/next/commands">CLI Commands</a></li><li class="navListItem"><a class="navItem" href="/docs/en/next/doc-markdown">Markdown Features</a></li><li class="navListItem"><a class="navItem" href="/docs/en/next/api-pages">Pages and Styles</a></li><li class="navListItem"><a class="navItem" href="/docs/en/next/site-config">siteConfig.js</a></li></ul></div></div></section></div><script>
|
||||
var toggler = document.getElementById('navToggler');
|
||||
var nav = document.getElementById('docsNav');
|
||||
toggler.onclick = function() {
|
||||
nav.classList.toggle('docsSliderActive');
|
||||
};
|
||||
</script></nav></div><div class="container mainContainer"><div class="wrapper"><div class="post"><header class="postHeader"><a class="edit-page-link button" href="https://github.com/facebook/docusaurus/edit/master/docs/api-commands.md" target="_blank" rel="noreferrer noopener">Edit</a><h1>CLI Commands</h1></header><article><div><span><p>Docusaurus provides a set of scripts to help you generate, serve, and deploy your website. These scripts can be invoked with the <code>run</code> command when using Yarn or npm. Some common commands are:</p>
|
||||
<ul>
|
||||
<li><a href="/docs/en/next/commands#docusaurus-start-port-number"><code>yarn run start</code></a>: build and serve the website from a local server</li>
|
||||
<li><a href="/docs/en/next/commands#docusaurus-examples"><code>yarn run examples</code></a>: create example configuration files</li>
|
||||
</ul>
|
||||
<h2><a class="anchor" aria-hidden="true" id="running-from-the-command-line"></a><a href="#running-from-the-command-line" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Running from the command line</h2>
|
||||
<p>The scripts can be run using either Yarn or npm. If you've already gone through our Getting Started guide, you may already be familiar with the <code>start</code> command. It's the command that tells Docusaurus to run the <code>docusaurus-start</code> script which generates the site and starts up a server, and it's usually invoked like so:</p>
|
||||
<pre><code class="hljs css bash">yarn run start
|
||||
</code></pre>
|
||||
<p>The same script can be invoked using npm:</p>
|
||||
<pre><code class="hljs css bash">npm run start
|
||||
</code></pre>
|
||||
<p>To run a particular script, just replace the <code>start</code> command in the examples above with the command associated with your script.</p>
|
||||
<h2><a class="anchor" aria-hidden="true" id="using-arguments"></a><a href="#using-arguments" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Using arguments</h2>
|
||||
<p>Some commands support optional arguments. For example, to start a server on port 8080, you can specify the <code>--port</code> argument when running <code>start</code>:</p>
|
||||
<pre><code class="hljs css bash">yarn run start --port 8080
|
||||
</code></pre>
|
||||
<p>If you run Docusaurus using npm, you can still use the command line arguments by inserting a <code>--</code> between <code>npm run <command></code> and the command arguments:</p>
|
||||
<pre><code class="hljs css bash">npm run start -- --port 8080
|
||||
</code></pre>
|
||||
<h2><a class="anchor" aria-hidden="true" id="configuration"></a><a href="#configuration" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Configuration</h2>
|
||||
<p>These scripts are set up under the <code>"scripts"</code> key in your <code>website/package.json</code> file as part of the installation process. If you need help setting them up again, please refer to the <a href="/docs/en/next/installation">Installation guide</a>.</p>
|
||||
<p>Docusaurus provides some default mappings to allow you to run commands following Node conventions. Instead of typing <code>docusaurus-start</code> every time, you can type <code>yarn run start</code> or <code>npm start</code> to achieve the same.</p>
|
||||
<h2><a class="anchor" aria-hidden="true" id="commands"></a><a href="#commands" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Commands</h2>
|
||||
<ul>
|
||||
<li><a href="#docusaurus-build"><code>docusaurus-build</code></a></li>
|
||||
<li><a href="#docusaurus-examples"><code>docusaurus-examples</code></a></li>
|
||||
<li><a href="#docusaurus-publish"><code>docusaurus-publish</code></a></li>
|
||||
<li><a href="#docusaurus-rename-version"><code>docusaurus-rename-version</code></a></li>
|
||||
<li><a href="#docusaurus-start"><code>docusaurus-start</code></a></li>
|
||||
<li><a href="#docusaurus-version-version"><code>docusaurus-version</code></a></li>
|
||||
<li><a href="#docusaurus-write-translations"><code>docusaurus-write-translations</code></a></li>
|
||||
</ul>
|
||||
<hr>
|
||||
<h2><a class="anchor" aria-hidden="true" id="reference"></a><a href="#reference" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Reference</h2>
|
||||
<h3><a class="anchor" aria-hidden="true" id="docusaurus-build"></a><a href="#docusaurus-build" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a><code>docusaurus-build</code></h3>
|
||||
<p>Alias: <code>build</code>.</p>
|
||||
<table>
|
||||
<thead>
|
||||
<tr><th>Options</th><th>Default</th><th>Description</th></tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr><td><code>--skip-image-compression</code></td><td><code>false</code></td><td>Skip compression of image assets. You usually won't want to skip this unless your images have already been optimized.</td></tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<p>Generates the static website, applying translations if necessary. Useful for building the website prior to deployment.</p>
|
||||
<p>See also <a href="/docs/en/next/commands#docusaurus-start"><code>docusaurus-start</code></a>.</p>
|
||||
<hr>
|
||||
<h3><a class="anchor" aria-hidden="true" id="docusaurus-examples"></a><a href="#docusaurus-examples" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a><code>docusaurus-examples</code></h3>
|
||||
<p>Alias: <code>examples</code></p>
|
||||
<table>
|
||||
<thead>
|
||||
<tr><th>Arguments</th><th>Default</th><th>Description</th></tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr><td><code><feature></code></td><td>-</td><td>Specify a feature <code>translations</code> or <code>versions</code> to generate the extra example files for that feature.</td></tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<p><strong>Example</strong></p>
|
||||
<pre><code class="hljs css bash">docusaurus-examples <feature>
|
||||
</code></pre>
|
||||
<p>When no feature is specified, sets up a minimally configured example website in your project. This command is covered in depth in the <a href="/docs/en/next/site-preparation">Site Preparation guide</a>.</p>
|
||||
<hr>
|
||||
<h3><a class="anchor" aria-hidden="true" id="docusaurus-publish"></a><a href="#docusaurus-publish" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a><code>docusaurus-publish</code></h3>
|
||||
<p>Alias: <code>publish-gh-pages</code></p>
|
||||
<p><a href="/docs/en/next/commands#docusaurus-build">Builds</a>, then deploys the static website to GitHub Pages. This command is meant to be run during the deployment step in Circle CI, and therefore expects a few environment variables to be defined:</p>
|
||||
<p>The following environment variables are generally set manually by the user in the CircleCI <code>config.yml</code> file.</p>
|
||||
<ul>
|
||||
<li><code>GIT_USER</code>: The git user to be associated with the deploy commit.</li>
|
||||
<li><code>USE_SSH</code>: Whether to use SSH instead of HTTPS for your connection to the GitHub repo.</li>
|
||||
</ul>
|
||||
<p><strong>Example</strong></p>
|
||||
<pre><code class="hljs css bash">GIT_USER=docusaurus-bot USE_SSH=<span class="hljs-literal">true</span> yarn run publish-gh-pages
|
||||
</code></pre>
|
||||
<p>The following environment variables are <a href="https://circleci.com/docs/1.0/environment-variables/">set by CircleCI</a> during the build process.</p>
|
||||
<ul>
|
||||
<li><code>CIRCLE_BRANCH</code>: The git branch associated with the commit that triggered the CI run.</li>
|
||||
<li><code>CI_PULL_REQUEST</code>: Expected to be truthy if the current CI run was triggered by a commit in a pull request.</li>
|
||||
</ul>
|
||||
<p>The following should be set by you in <code>siteConfig.js</code> as <code>organizationName</code> and <code>projectName</code>, respectively. If they are not set in your site configuration, they fall back to the <a href="https://circleci.com/docs/1.0/environment-variables/">CircleCI environment</a>.</p>
|
||||
<ul>
|
||||
<li><code>CIRCLE_PROJECT_USERNAME</code>: The GitHub username or organization name that hosts the Git repo, e.g. "facebook".</li>
|
||||
<li><code>CIRCLE_PROJECT_REPONAME</code>: The name of the Git repo, e.g. "Docusaurus".</li>
|
||||
</ul>
|
||||
<p>You can learn more about configuring automatic deployments with CircleCI in the <a href="/docs/en/next/publishing">Publishing guide</a>.</p>
|
||||
<hr>
|
||||
<h3><a class="anchor" aria-hidden="true" id="docusaurus-rename-version"></a><a href="#docusaurus-rename-version" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a><code>docusaurus-rename-version</code></h3>
|
||||
<p>Alias: <code>rename-version</code></p>
|
||||
<p>Renames an existing version of the docs to a new version name.</p>
|
||||
<table>
|
||||
<thead>
|
||||
<tr><th>Arguments</th><th>Default</th><th>Description</th></tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr><td><code><currentVersion></code></td><td>-</td><td>Version to be renamed.</td></tr>
|
||||
<tr><td><code><newVersion></code></td><td>-</td><td>Version to be renamed to.</td></tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<p><strong>Example</strong></p>
|
||||
<pre><code class="hljs css bash">docusaurus-rename-version <currentVersion> <newVersion>
|
||||
</code></pre>
|
||||
<p>See the <a href="/docs/en/next/versioning#renaming-existing-versions">Versioning guide</a> to learn more.</p>
|
||||
<hr>
|
||||
<h3><a class="anchor" aria-hidden="true" id="docusaurus-start"></a><a href="#docusaurus-start" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a><code>docusaurus-start</code></h3>
|
||||
<p>Alias: <code>start</code>.</p>
|
||||
<p>This script will build the static website, apply translations if necessary, and then start a local server.</p>
|
||||
<table>
|
||||
<thead>
|
||||
<tr><th>Options</th><th>Default</th><th>Description</th></tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr><td><code>--port <number></code></td><td><code>3000</code></td><td>The website will be served from port 3000 by default, but if the port is taken up, Docusaurus will attempt to find an available one.</td></tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<hr>
|
||||
<h3><a class="anchor" aria-hidden="true" id="docusaurus-version-version"></a><a href="#docusaurus-version-version" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a><code>docusaurus-version <version></code></h3>
|
||||
<p>Alias: <code>version</code></p>
|
||||
<p>Generates a new version of the docs. This will result in a new copy of your site being generated and stored in its own versioned folder. Useful for capturing snapshots of API docs that map to specific versions of your software. Accepts any string as a version number.</p>
|
||||
<p>See the <a href="/docs/en/next/versioning">Versioning guide</a> to learn more.</p>
|
||||
<hr>
|
||||
<h3><a class="anchor" aria-hidden="true" id="docusaurus-write-translations"></a><a href="#docusaurus-write-translations" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a><code>docusaurus-write-translations</code></h3>
|
||||
<p>Alias: <code>write-translations</code></p>
|
||||
<p>Writes the English for any strings that need to be translated into an <code>website/i18n/en.json</code> file. The script will go through every file in <code>website/pages/en</code> and through the <code>siteConfig.js</code> file and other config files to fetch English strings that will then be translated on Crowdin. See the <a href="/docs/en/next/translation">Translation guide</a> to learn more.</p>
|
||||
</span></div></article></div><div class="docs-prevnext"><a class="docs-prev button" href="versioning">← Versioning</a><a class="docs-next button" href="doc-markdown">Markdown Features →</a></div></div></div><nav class="onPageNav"><ul class="toc-headings"><li><a href="#running-from-the-command-line">Running from the command line</a></li><li><a href="#using-arguments">Using arguments</a></li><li><a href="#configuration">Configuration</a></li><li><a href="#commands">Commands</a></li><li><a href="#reference">Reference</a><ul class="toc-headings"><li><a href="#docusaurus-build"><code>docusaurus-build</code></a></li><li><a href="#docusaurus-examples"><code>docusaurus-examples</code></a></li><li><a href="#docusaurus-publish"><code>docusaurus-publish</code></a></li><li><a href="#docusaurus-rename-version"><code>docusaurus-rename-version</code></a></li><li><a href="#docusaurus-start"><code>docusaurus-start</code></a></li><li><a href="#docusaurus-version-version"><code>docusaurus-version</code></a></li><li><a href="#docusaurus-write-translations"><code>docusaurus-write-translations</code></a></li></ul></li></ul></nav></div><footer class="nav-footer" id="footer"><section class="sitemap"><a href="/" class="nav-home"><img src="/img/docusaurus_monochrome.svg" alt="Docusaurus" width="66" height="58"/></a><div><h5>Docs</h5><a href="
|
||||
/docs/en/installation.html">Getting Started</a><a href="
|
||||
/docs/en/versioning.html">Versioning</a><a href="
|
||||
/docs/en/translation.html">Localization</a><a href="
|
||||
/docs/en/search.html">Adding Search</a></div><div><h5>Community</h5><a href="/en/users.html">User Showcase</a></div><div><h5>More</h5><div class="social"><a class="github-button" href="https://github.com/facebook/Docusaurus" data-count-href="/facebook/Docusaurus/stargazers" data-show-count="true" data-count-aria-label="# stargazers on GitHub" aria-label="Star this project on GitHub">Docusaurus</a></div><div class="social"><a href="https://twitter.com/docusaurus" class="twitter-follow-button">Follow @docusaurus</a></div><div class="social"><div class="fb-like" data-href="https://docusaurus.io" data-layout="standard" data-share="true" data-width="225" data-show-faces="false"></div></div></div></section><a href="https://code.facebook.com/projects/" target="_blank" rel="noreferrer noopener" class="fbOpenSource"><img src="/img/oss_logo.png" alt="Facebook Open Source" width="170" height="45"/></a><section class="copyright"><span>Copyright © 2018 Facebook Inc.</span></section></footer></div><script type="text/javascript" src="https://cdn.jsdelivr.net/docsearch.js/1/docsearch.min.js"></script><script>window.fbAsyncInit = function() {FB.init({appId:'199138890728411',xfbml:true,version:'v2.7'});};(function(d, s, id){var js, fjs = d.getElementsByTagName(s)[0];if (d.getElementById(id)) {return;}js = d.createElement(s); js.id = id;js.src = '//connect.facebook.net/en_US/sdk.js';fjs.parentNode.insertBefore(js, fjs);}(document, 'script','facebook-jssdk'));
|
||||
</script><script>window.twttr=(function(d,s, id){var js,fjs=d.getElementsByTagName(s)[0],t=window.twttr||{};if(d.getElementById(id))return t;js=d.createElement(s);js.id=id;js.src='https://platform.twitter.com/widgets.js';fjs.parentNode.insertBefore(js, fjs);t._e = [];t.ready = function(f) {t._e.push(f);};return t;}(document, 'script', 'twitter-wjs'));</script><script>
|
||||
var search = docsearch({
|
||||
|
||||
apiKey: '3eb9507824b8be89e7a199ecaa1a9d2c',
|
||||
indexName: 'docusaurus',
|
||||
inputSelector: '#search_input_react'
|
||||
});
|
||||
</script></body></html>
|
|
@ -12,7 +12,7 @@
|
|||
{"zIndex":100}
|
||||
)
|
||||
});
|
||||
</script><link rel="stylesheet" href="/css/main.css"/></head><body class="sideNavVisible doc separateOnPageNav"><div class="fixedHeaderContainer"><div class="headerWrapper wrapper"><header><a href="/en"><img class="logo" src="/img/docusaurus.svg" alt="Docusaurus"/><h2 class="headerTitleWithLogo">Docusaurus</h2></a><a href="/en/versions.html"><h3>next</h3></a><div class="navigationWrapper navigationSlider"><nav class="slidingNav"><ul class="nav-site nav-site-internal"><li class="siteNavGroupActive"><a href="/docs/en/next/installation.html" target="_self">Docs</a></li><li class=""><a href="/en/help.html" target="_self">Help</a></li><li class=""><a href="/en/users.html" target="_self">Users</a></li><li class=""><a href="/en/about-slash.html" target="_self">About /</a></li><li class=""><a href="/blog" target="_self">Blog</a></li><li class=""><a href="https://github.com/facebook/docusaurus" target="_self">GitHub</a></li><span><li><a id="languages-menu" href="#"><img class="languages-icon" src="/img/language.svg"/>English</a><div id="languages-dropdown" class="hide"><ul id="languages-dropdown-items"><li><a href="/es-ES">Español</a></li><li><a href="/ro">Română</a></li><li><a href="/tr">Türkçe</a></li><li><a href="/zh-CN">简体中文</a></li><li><a href="https://crowdin.com/project/docusaurus" target="_blank" rel="noreferrer noopener">Help Translate</a></li></ul></div></li><script>
|
||||
</script><link rel="stylesheet" href="/css/main.css"/></head><body class="sideNavVisible doc separateOnPageNav"><div class="fixedHeaderContainer"><div class="headerWrapper wrapper"><header><a href="/en"><img class="logo" src="/img/docusaurus.svg" alt="Docusaurus"/><h2 class="headerTitleWithLogo">Docusaurus</h2></a><a href="/en/versions.html"><h3>next</h3></a><div class="navigationWrapper navigationSlider"><nav class="slidingNav"><ul class="nav-site nav-site-internal"><li class="siteNavGroupActive"><a href="/docs/en/next/installation" target="_self">Docs</a></li><li class=""><a href="/en/help" target="_self">Help</a></li><li class=""><a href="/en/users" target="_self">Users</a></li><li class=""><a href="/en/about-slash" target="_self">About /</a></li><li class=""><a href="/blog" target="_self">Blog</a></li><li class=""><a href="https://github.com/facebook/docusaurus" target="_self">GitHub</a></li><span><li><a id="languages-menu" href="#"><img class="languages-icon" src="/img/language.svg"/>English</a><div id="languages-dropdown" class="hide"><ul id="languages-dropdown-items"><li><a href="/es-ES">Español</a></li><li><a href="/ro">Română</a></li><li><a href="/tr">Türkçe</a></li><li><a href="/zh-CN">简体中文</a></li><li><a href="https://crowdin.com/project/docusaurus" target="_blank" rel="noreferrer noopener">Help Translate</a></li></ul></div></li><script>
|
||||
const languagesMenuItem = document.getElementById("languages-menu");
|
||||
const languagesDropDown = document.getElementById("languages-dropdown");
|
||||
languagesMenuItem.addEventListener("click", function(){
|
||||
|
@ -22,7 +22,7 @@
|
|||
languagesDropDown.className = "hide";
|
||||
}
|
||||
});
|
||||
</script></span><li class="navSearchWrapper reactNavSearchWrapper"><input type="text" id="search_input_react" placeholder="Search" title="Search"/></li></ul></nav></div></header></div></div><div class="navPusher"><div class="docMainWrapper wrapper"><div class="container docsNavContainer" id="docsNav"><nav class="toc"><div class="toggleNav"><section class="navWrapper wrapper"><div class="navBreadcrumb wrapper"><div class="navToggle" id="navToggler"><i></i></div><h2><i>›</i><span>Guides</span></h2></div><div class="navGroups"><div class="navGroup navGroupActive"><h3>Getting Started</h3><ul><li class="navListItem"><a class="navItem" href="/docs/en/next/installation.html">Installation</a></li><li class="navListItem"><a class="navItem" href="/docs/en/next/site-preparation.html">Site Preparation</a></li><li class="navListItem"><a class="navItem" href="/docs/en/next/site-creation.html">Creating your site</a></li><li class="navListItem"><a class="navItem" href="/docs/en/next/publishing.html">Publishing your site</a></li></ul></div><div class="navGroup navGroupActive"><h3>Guides</h3><ul><li class="navListItem"><a class="navItem" href="/docs/en/next/blog.html">Adding a Blog</a></li><li class="navListItem navListItemActive"><a class="navItem navItemActive" href="/docs/en/next/custom-pages.html">Custom Pages</a></li><li class="navListItem"><a class="navItem" href="/docs/en/next/search.html">Enabling Search</a></li><li class="navListItem"><a class="navItem" href="/docs/en/next/navigation.html">Navigation and Sidebars</a></li><li class="navListItem"><a class="navItem" href="/docs/en/next/translation.html">Translations & Localization</a></li><li class="navListItem"><a class="navItem" href="/docs/en/next/versioning.html">Versioning</a></li></ul></div><div class="navGroup navGroupActive"><h3>API</h3><ul><li class="navListItem"><a class="navItem" href="/docs/en/next/commands.html">CLI Commands</a></li><li class="navListItem"><a class="navItem" href="/docs/en/next/doc-markdown.html">Markdown Features</a></li><li class="navListItem"><a class="navItem" href="/docs/en/next/api-pages.html">Pages and Styles</a></li><li class="navListItem"><a class="navItem" href="/docs/en/next/site-config.html">siteConfig.js</a></li></ul></div></div></section></div><script>
|
||||
</script></span><li class="navSearchWrapper reactNavSearchWrapper"><input type="text" id="search_input_react" placeholder="Search" title="Search"/></li></ul></nav></div></header></div></div><div class="navPusher"><div class="docMainWrapper wrapper"><div class="container docsNavContainer" id="docsNav"><nav class="toc"><div class="toggleNav"><section class="navWrapper wrapper"><div class="navBreadcrumb wrapper"><div class="navToggle" id="navToggler"><i></i></div><h2><i>›</i><span>Guides</span></h2></div><div class="navGroups"><div class="navGroup navGroupActive"><h3>Getting Started</h3><ul><li class="navListItem"><a class="navItem" href="/docs/en/next/installation">Installation</a></li><li class="navListItem"><a class="navItem" href="/docs/en/next/site-preparation">Site Preparation</a></li><li class="navListItem"><a class="navItem" href="/docs/en/next/site-creation">Creating your site</a></li><li class="navListItem"><a class="navItem" href="/docs/en/next/publishing">Publishing your site</a></li></ul></div><div class="navGroup navGroupActive"><h3>Guides</h3><ul><li class="navListItem"><a class="navItem" href="/docs/en/next/blog">Adding a Blog</a></li><li class="navListItem navListItemActive"><a class="navItem navItemActive" href="/docs/en/next/custom-pages">Custom Pages</a></li><li class="navListItem"><a class="navItem" href="/docs/en/next/search">Enabling Search</a></li><li class="navListItem"><a class="navItem" href="/docs/en/next/navigation">Navigation and Sidebars</a></li><li class="navListItem"><a class="navItem" href="/docs/en/next/translation">Translations & Localization</a></li><li class="navListItem"><a class="navItem" href="/docs/en/next/versioning">Versioning</a></li></ul></div><div class="navGroup navGroupActive"><h3>API</h3><ul><li class="navListItem"><a class="navItem" href="/docs/en/next/commands">CLI Commands</a></li><li class="navListItem"><a class="navItem" href="/docs/en/next/doc-markdown">Markdown Features</a></li><li class="navListItem"><a class="navItem" href="/docs/en/next/api-pages">Pages and Styles</a></li><li class="navListItem"><a class="navItem" href="/docs/en/next/site-config">siteConfig.js</a></li></ul></div></div></section></div><script>
|
||||
var toggler = document.getElementById('navToggler');
|
||||
var nav = document.getElementById('docsNav');
|
||||
toggler.onclick = function() {
|
||||
|
@ -30,8 +30,8 @@
|
|||
};
|
||||
</script></nav></div><div class="container mainContainer"><div class="wrapper"><div class="post"><header class="postHeader"><a class="edit-page-link button" href="https://github.com/facebook/docusaurus/edit/master/docs/guides-custom-pages.md" target="_blank" rel="noreferrer noopener">Edit</a><h1>Custom Pages</h1></header><article><div><span><p>You can add pages to your site that are not part of the standard docs or blog markdown files. You can do this by adding <code>.js</code> files to the <code>website/pages</code> directory. These files are <a href="https://reactjs.org/">React</a> components and the <code>render()</code> is called to create them, backed by CSS classes, etc.</p>
|
||||
<h2><a class="anchor" aria-hidden="true" id="customizing-your-home-page"></a><a href="#customizing-your-home-page" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Customizing Your Home Page</h2>
|
||||
<p>The easiest way to get started customizing your home page is to use the example site that was <a href="/docs/en/next/site-creation.html">created</a> when you ran the <a href="/docs/en/next/installation.html">Docusaurus initialization script</a>.</p>
|
||||
<p>You can <a href="/docs/en/next/site-preparation.html#verifying-installation">start</a> your local server and go to <code>http://localhost:3000</code> to see what the example home page looks like. From there, edit the <code>website/pages/en/index.js</code> file and its various components to use the images and text you want for your project.</p>
|
||||
<p>The easiest way to get started customizing your home page is to use the example site that was <a href="/docs/en/next/site-creation">created</a> when you ran the <a href="/docs/en/next/installation">Docusaurus initialization script</a>.</p>
|
||||
<p>You can <a href="/docs/en/next/site-preparation#verifying-installation">start</a> your local server and go to <code>http://localhost:3000</code> to see what the example home page looks like. From there, edit the <code>website/pages/en/index.js</code> file and its various components to use the images and text you want for your project.</p>
|
||||
<h2><a class="anchor" aria-hidden="true" id="adding-other-custom-pages"></a><a href="#adding-other-custom-pages" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Adding Other Custom Pages</h2>
|
||||
<p>Docusaurus provides some simple example pages in the <code>website/pages/en</code> directory, including <code>index.js</code>, <code>users.js</code>, and <code>help.js</code>. These are good examples to showcase how to create a custom page for Docusaurus.</p>
|
||||
<pre><code class="hljs css bash">root-of-repo
|
||||
|
@ -50,18 +50,18 @@
|
|||
│ ├── siteConfig.js
|
||||
│ └── static
|
||||
</code></pre>
|
||||
<p>Of course, you are also free to write your own pages. It is strongly suggested that you at least have an index page, but none of the pages provided are mandatory to include in your site. More information on how to use the provided components or include your own can be found <a href="/docs/en/next/api-pages.html">here</a>. Information on how to link to your different pages in the header navigation bar can be found <a href="/docs/en/next/navigation.html">here</a>.</p>
|
||||
<p>Of course, you are also free to write your own pages. It is strongly suggested that you at least have an index page, but none of the pages provided are mandatory to include in your site. More information on how to use the provided components or include your own can be found <a href="/docs/en/next/api-pages">here</a>. Information on how to link to your different pages in the header navigation bar can be found <a href="/docs/en/next/navigation">here</a>.</p>
|
||||
<blockquote>
|
||||
<p>If you want your page to show up in your navigation header, you will need to update <code>siteConfig.js</code> to add to the <code>headerLinks</code> element. e.g., <code>{ page: 'about-slash', label: 'About/' }</code>,</p>
|
||||
</blockquote>
|
||||
<h2><a class="anchor" aria-hidden="true" id="adding-static-pages"></a><a href="#adding-static-pages" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Adding Static Pages</h2>
|
||||
<p>Static <code>.html</code> files can also be used, but they will not include Docusaurus' header, footer, or styles by default. These can be added to the <code>static</code> folder in the same way as other <a href="/docs/en/next/api-pages.html#using-static-assets">static assets</a>. Alternatively, they can be placed in the <code>pages</code> folder and would be served as-is instead of being rendered from React.</p>
|
||||
<p>Static <code>.html</code> files can also be used, but they will not include Docusaurus' header, footer, or styles by default. These can be added to the <code>static</code> folder in the same way as other <a href="/docs/en/next/api-pages#using-static-assets">static assets</a>. Alternatively, they can be placed in the <code>pages</code> folder and would be served as-is instead of being rendered from React.</p>
|
||||
<p>If you wish to use Docusaurus' stylesheet, you can access it at <code>${baseUrl}css/main.css</code>. If you wish to use separate css for these static pages, you can exclude them from being concatenated to Docusaurus' styles by adding them into the <code>siteConfig.separateCss</code> field in <code>siteConfig.js</code>.</p>
|
||||
<blockquote>
|
||||
<p>You can set the <a href="/docs/en/next/site-config.html#optional-fields"><code>$wrapPagesHTML</code> site config option</a> in order to wrap raw HTML fragments with the Docusaurus site styling, header and footer.</p>
|
||||
<p>You can set the <a href="/docs/en/next/site-config#optional-fields"><code>$wrapPagesHTML</code> site config option</a> in order to wrap raw HTML fragments with the Docusaurus site styling, header and footer.</p>
|
||||
</blockquote>
|
||||
<h2><a class="anchor" aria-hidden="true" id="customizing-your-site-footer"></a><a href="#customizing-your-site-footer" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Customizing Your Site Footer</h2>
|
||||
<p>Starting from the example <code>core/Footer.js</code> file that was <a href="/docs/en/next/site-creation.html">created</a> when you ran the <a href="/docs/en/next/installation.html">Docusaurus initialization script</a>, edit the footer to include any links to pages on your site or other sites that you wish to have.</p>
|
||||
<p>Starting from the example <code>core/Footer.js</code> file that was <a href="/docs/en/next/site-creation">created</a> when you ran the <a href="/docs/en/next/installation">Docusaurus initialization script</a>, edit the footer to include any links to pages on your site or other sites that you wish to have.</p>
|
||||
<p>The example provided has three columns with a footer image on the left and Facebook's open source logo and copyright at the bottom. If your project is not a Facebook open source project, remove the logo and copyright. Otherwise, feel free to get creative with your footer and make it look however you'd like!</p>
|
||||
<p>Some suggestions for links you may want to provide: documentation, API, Twitter, Discord, Facebook groups, Stack Overflow, GitHub, etc.</p>
|
||||
<p>Your footer will automatically get applied to all pages on your site, including docs and blog posts. The sole exception to this is any static html pages you include.</p>
|
||||
|
@ -76,7 +76,7 @@
|
|||
|
||||
<span class="hljs-built_in">module</span>.exports = Footer;
|
||||
</code></pre>
|
||||
</span></div></article></div><div class="docs-prevnext"><a class="docs-prev button" href="blog.html">← Adding a Blog</a><a class="docs-next button" href="search.html">Enabling Search →</a></div></div></div><nav class="onPageNav"><ul class="toc-headings"><li><a href="#customizing-your-home-page">Customizing Your Home Page</a></li><li><a href="#adding-other-custom-pages">Adding Other Custom Pages</a></li><li><a href="#adding-static-pages">Adding Static Pages</a></li><li><a href="#customizing-your-site-footer">Customizing Your Site Footer</a></li></ul></nav></div><footer class="nav-footer" id="footer"><section class="sitemap"><a href="/" class="nav-home"><img src="/img/docusaurus_monochrome.svg" alt="Docusaurus" width="66" height="58"/></a><div><h5>Docs</h5><a href="
|
||||
</span></div></article></div><div class="docs-prevnext"><a class="docs-prev button" href="blog">← Adding a Blog</a><a class="docs-next button" href="search">Enabling Search →</a></div></div></div><nav class="onPageNav"><ul class="toc-headings"><li><a href="#customizing-your-home-page">Customizing Your Home Page</a></li><li><a href="#adding-other-custom-pages">Adding Other Custom Pages</a></li><li><a href="#adding-static-pages">Adding Static Pages</a></li><li><a href="#customizing-your-site-footer">Customizing Your Site Footer</a></li></ul></nav></div><footer class="nav-footer" id="footer"><section class="sitemap"><a href="/" class="nav-home"><img src="/img/docusaurus_monochrome.svg" alt="Docusaurus" width="66" height="58"/></a><div><h5>Docs</h5><a href="
|
||||
/docs/en/installation.html">Getting Started</a><a href="
|
||||
/docs/en/versioning.html">Versioning</a><a href="
|
||||
/docs/en/translation.html">Localization</a><a href="
|
||||
|
|
91
docs/en/next/custom-pages/index.html
Normal file
91
docs/en/next/custom-pages/index.html
Normal file
|
@ -0,0 +1,91 @@
|
|||
<!DOCTYPE html><html lang="en"><head><meta charSet="utf-8"/><meta http-equiv="X-UA-Compatible" content="IE=edge"/><title>Custom Pages · Docusaurus</title><meta name="viewport" content="width=device-width"/><meta name="generator" content="Docusaurus"/><meta property="og:title" content="Custom Pages · Docusaurus"/><meta property="og:type" content="website"/><meta property="og:url" content="https://docusaurus.io/index.html"/><meta property="og:description" content="You can add pages to your site that are not part of the standard docs or blog markdown files. You can do this by adding `.js` files to the `website/pages` directory. These files are [React](https://reactjs.org/) components and the `render()` is called to create them, backed by CSS classes, etc."/><meta property="og:image" content="https://docusaurus.io/img/docusaurus.png"/><meta name="twitter:card" content="summary"/><meta name="twitter:image" content="https://docusaurus.io/img/docusaurus.png"/><link rel="shortcut icon" href="/img/docusaurus.ico"/><link rel="stylesheet" href="https://cdn.jsdelivr.net/docsearch.js/1/docsearch.min.css"/><link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/highlight.js/9.12.0/styles/atom-one-dark.min.css"/><link rel="alternate" type="application/atom+xml" href="https://docusaurus.io/blog/atom.xml" title="Docusaurus Blog ATOM Feed"/><link rel="alternate" type="application/rss+xml" href="https://docusaurus.io/blog/feed.xml" title="Docusaurus Blog RSS Feed"/><script>
|
||||
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
|
||||
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
|
||||
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
|
||||
})(window,document,'script','https://www.google-analytics.com/analytics.js','ga');
|
||||
|
||||
ga('create', 'UA-44373548-31', 'auto');
|
||||
ga('send', 'pageview');
|
||||
</script><link rel="stylesheet" href="/css/code-blocks-buttons.css"/><script type="text/javascript" src="https://buttons.github.io/buttons.js"></script><script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/clipboard.js/2.0.0/clipboard.min.js"></script><script type="text/javascript" src="/js/code-blocks-buttons.js"></script><script src="https://unpkg.com/vanilla-back-to-top@7.1.14/dist/vanilla-back-to-top.min.js"></script><script>
|
||||
document.addEventListener("DOMContentLoaded", function(){
|
||||
addBackToTop(
|
||||
{"zIndex":100}
|
||||
)
|
||||
});
|
||||
</script><link rel="stylesheet" href="/css/main.css"/></head><body class="sideNavVisible doc separateOnPageNav"><div class="fixedHeaderContainer"><div class="headerWrapper wrapper"><header><a href="/en"><img class="logo" src="/img/docusaurus.svg" alt="Docusaurus"/><h2 class="headerTitleWithLogo">Docusaurus</h2></a><a href="/en/versions.html"><h3>next</h3></a><div class="navigationWrapper navigationSlider"><nav class="slidingNav"><ul class="nav-site nav-site-internal"><li class="siteNavGroupActive"><a href="/docs/en/next/installation" target="_self">Docs</a></li><li class=""><a href="/en/help" target="_self">Help</a></li><li class=""><a href="/en/users" target="_self">Users</a></li><li class=""><a href="/en/about-slash" target="_self">About /</a></li><li class=""><a href="/blog" target="_self">Blog</a></li><li class=""><a href="https://github.com/facebook/docusaurus" target="_self">GitHub</a></li><span><li><a id="languages-menu" href="#"><img class="languages-icon" src="/img/language.svg"/>English</a><div id="languages-dropdown" class="hide"><ul id="languages-dropdown-items"><li><a href="/es-ES">Español</a></li><li><a href="/ro">Română</a></li><li><a href="/tr">Türkçe</a></li><li><a href="/zh-CN">简体中文</a></li><li><a href="https://crowdin.com/project/docusaurus" target="_blank" rel="noreferrer noopener">Help Translate</a></li></ul></div></li><script>
|
||||
const languagesMenuItem = document.getElementById("languages-menu");
|
||||
const languagesDropDown = document.getElementById("languages-dropdown");
|
||||
languagesMenuItem.addEventListener("click", function(){
|
||||
if(languagesDropDown.className == "hide") {
|
||||
languagesDropDown.className = "visible";
|
||||
} else {
|
||||
languagesDropDown.className = "hide";
|
||||
}
|
||||
});
|
||||
</script></span><li class="navSearchWrapper reactNavSearchWrapper"><input type="text" id="search_input_react" placeholder="Search" title="Search"/></li></ul></nav></div></header></div></div><div class="navPusher"><div class="docMainWrapper wrapper"><div class="container docsNavContainer" id="docsNav"><nav class="toc"><div class="toggleNav"><section class="navWrapper wrapper"><div class="navBreadcrumb wrapper"><div class="navToggle" id="navToggler"><i></i></div><h2><i>›</i><span>Guides</span></h2></div><div class="navGroups"><div class="navGroup navGroupActive"><h3>Getting Started</h3><ul><li class="navListItem"><a class="navItem" href="/docs/en/next/installation">Installation</a></li><li class="navListItem"><a class="navItem" href="/docs/en/next/site-preparation">Site Preparation</a></li><li class="navListItem"><a class="navItem" href="/docs/en/next/site-creation">Creating your site</a></li><li class="navListItem"><a class="navItem" href="/docs/en/next/publishing">Publishing your site</a></li></ul></div><div class="navGroup navGroupActive"><h3>Guides</h3><ul><li class="navListItem"><a class="navItem" href="/docs/en/next/blog">Adding a Blog</a></li><li class="navListItem navListItemActive"><a class="navItem navItemActive" href="/docs/en/next/custom-pages">Custom Pages</a></li><li class="navListItem"><a class="navItem" href="/docs/en/next/search">Enabling Search</a></li><li class="navListItem"><a class="navItem" href="/docs/en/next/navigation">Navigation and Sidebars</a></li><li class="navListItem"><a class="navItem" href="/docs/en/next/translation">Translations & Localization</a></li><li class="navListItem"><a class="navItem" href="/docs/en/next/versioning">Versioning</a></li></ul></div><div class="navGroup navGroupActive"><h3>API</h3><ul><li class="navListItem"><a class="navItem" href="/docs/en/next/commands">CLI Commands</a></li><li class="navListItem"><a class="navItem" href="/docs/en/next/doc-markdown">Markdown Features</a></li><li class="navListItem"><a class="navItem" href="/docs/en/next/api-pages">Pages and Styles</a></li><li class="navListItem"><a class="navItem" href="/docs/en/next/site-config">siteConfig.js</a></li></ul></div></div></section></div><script>
|
||||
var toggler = document.getElementById('navToggler');
|
||||
var nav = document.getElementById('docsNav');
|
||||
toggler.onclick = function() {
|
||||
nav.classList.toggle('docsSliderActive');
|
||||
};
|
||||
</script></nav></div><div class="container mainContainer"><div class="wrapper"><div class="post"><header class="postHeader"><a class="edit-page-link button" href="https://github.com/facebook/docusaurus/edit/master/docs/guides-custom-pages.md" target="_blank" rel="noreferrer noopener">Edit</a><h1>Custom Pages</h1></header><article><div><span><p>You can add pages to your site that are not part of the standard docs or blog markdown files. You can do this by adding <code>.js</code> files to the <code>website/pages</code> directory. These files are <a href="https://reactjs.org/">React</a> components and the <code>render()</code> is called to create them, backed by CSS classes, etc.</p>
|
||||
<h2><a class="anchor" aria-hidden="true" id="customizing-your-home-page"></a><a href="#customizing-your-home-page" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Customizing Your Home Page</h2>
|
||||
<p>The easiest way to get started customizing your home page is to use the example site that was <a href="/docs/en/next/site-creation">created</a> when you ran the <a href="/docs/en/next/installation">Docusaurus initialization script</a>.</p>
|
||||
<p>You can <a href="/docs/en/next/site-preparation#verifying-installation">start</a> your local server and go to <code>http://localhost:3000</code> to see what the example home page looks like. From there, edit the <code>website/pages/en/index.js</code> file and its various components to use the images and text you want for your project.</p>
|
||||
<h2><a class="anchor" aria-hidden="true" id="adding-other-custom-pages"></a><a href="#adding-other-custom-pages" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Adding Other Custom Pages</h2>
|
||||
<p>Docusaurus provides some simple example pages in the <code>website/pages/en</code> directory, including <code>index.js</code>, <code>users.js</code>, and <code>help.js</code>. These are good examples to showcase how to create a custom page for Docusaurus.</p>
|
||||
<pre><code class="hljs css bash">root-of-repo
|
||||
├── docs
|
||||
├── website
|
||||
│ ├── blog
|
||||
│ ├── core
|
||||
│ │ └── Footer.js
|
||||
│ ├── node_modules
|
||||
│ ├── package.json
|
||||
│ ├── pages
|
||||
│ │ ├── index.js
|
||||
│ │ ├── users.js
|
||||
│ │ └── help.js
|
||||
│ ├── sidebars.json
|
||||
│ ├── siteConfig.js
|
||||
│ └── static
|
||||
</code></pre>
|
||||
<p>Of course, you are also free to write your own pages. It is strongly suggested that you at least have an index page, but none of the pages provided are mandatory to include in your site. More information on how to use the provided components or include your own can be found <a href="/docs/en/next/api-pages">here</a>. Information on how to link to your different pages in the header navigation bar can be found <a href="/docs/en/next/navigation">here</a>.</p>
|
||||
<blockquote>
|
||||
<p>If you want your page to show up in your navigation header, you will need to update <code>siteConfig.js</code> to add to the <code>headerLinks</code> element. e.g., <code>{ page: 'about-slash', label: 'About/' }</code>,</p>
|
||||
</blockquote>
|
||||
<h2><a class="anchor" aria-hidden="true" id="adding-static-pages"></a><a href="#adding-static-pages" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Adding Static Pages</h2>
|
||||
<p>Static <code>.html</code> files can also be used, but they will not include Docusaurus' header, footer, or styles by default. These can be added to the <code>static</code> folder in the same way as other <a href="/docs/en/next/api-pages#using-static-assets">static assets</a>. Alternatively, they can be placed in the <code>pages</code> folder and would be served as-is instead of being rendered from React.</p>
|
||||
<p>If you wish to use Docusaurus' stylesheet, you can access it at <code>${baseUrl}css/main.css</code>. If you wish to use separate css for these static pages, you can exclude them from being concatenated to Docusaurus' styles by adding them into the <code>siteConfig.separateCss</code> field in <code>siteConfig.js</code>.</p>
|
||||
<blockquote>
|
||||
<p>You can set the <a href="/docs/en/next/site-config#optional-fields"><code>$wrapPagesHTML</code> site config option</a> in order to wrap raw HTML fragments with the Docusaurus site styling, header and footer.</p>
|
||||
</blockquote>
|
||||
<h2><a class="anchor" aria-hidden="true" id="customizing-your-site-footer"></a><a href="#customizing-your-site-footer" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Customizing Your Site Footer</h2>
|
||||
<p>Starting from the example <code>core/Footer.js</code> file that was <a href="/docs/en/next/site-creation">created</a> when you ran the <a href="/docs/en/next/installation">Docusaurus initialization script</a>, edit the footer to include any links to pages on your site or other sites that you wish to have.</p>
|
||||
<p>The example provided has three columns with a footer image on the left and Facebook's open source logo and copyright at the bottom. If your project is not a Facebook open source project, remove the logo and copyright. Otherwise, feel free to get creative with your footer and make it look however you'd like!</p>
|
||||
<p>Some suggestions for links you may want to provide: documentation, API, Twitter, Discord, Facebook groups, Stack Overflow, GitHub, etc.</p>
|
||||
<p>Your footer will automatically get applied to all pages on your site, including docs and blog posts. The sole exception to this is any static html pages you include.</p>
|
||||
<p>If you do not want a footer for your site, change the <code>render</code> function of <code>core/Footer.js</code> to return <code>null</code>. e.g.,</p>
|
||||
<pre><code class="hljs css jsx"><span class="hljs-keyword">const</span> React = <span class="hljs-built_in">require</span>(<span class="hljs-string">'react'</span>);
|
||||
|
||||
<span class="hljs-class"><span class="hljs-keyword">class</span> <span class="hljs-title">Footer</span> <span class="hljs-keyword">extends</span> <span class="hljs-title">React</span>.<span class="hljs-title">Component</span> </span>{
|
||||
render() {
|
||||
<span class="hljs-keyword">return</span> <span class="hljs-literal">null</span>;
|
||||
}
|
||||
}
|
||||
|
||||
<span class="hljs-built_in">module</span>.exports = Footer;
|
||||
</code></pre>
|
||||
</span></div></article></div><div class="docs-prevnext"><a class="docs-prev button" href="blog">← Adding a Blog</a><a class="docs-next button" href="search">Enabling Search →</a></div></div></div><nav class="onPageNav"><ul class="toc-headings"><li><a href="#customizing-your-home-page">Customizing Your Home Page</a></li><li><a href="#adding-other-custom-pages">Adding Other Custom Pages</a></li><li><a href="#adding-static-pages">Adding Static Pages</a></li><li><a href="#customizing-your-site-footer">Customizing Your Site Footer</a></li></ul></nav></div><footer class="nav-footer" id="footer"><section class="sitemap"><a href="/" class="nav-home"><img src="/img/docusaurus_monochrome.svg" alt="Docusaurus" width="66" height="58"/></a><div><h5>Docs</h5><a href="
|
||||
/docs/en/installation.html">Getting Started</a><a href="
|
||||
/docs/en/versioning.html">Versioning</a><a href="
|
||||
/docs/en/translation.html">Localization</a><a href="
|
||||
/docs/en/search.html">Adding Search</a></div><div><h5>Community</h5><a href="/en/users.html">User Showcase</a></div><div><h5>More</h5><div class="social"><a class="github-button" href="https://github.com/facebook/Docusaurus" data-count-href="/facebook/Docusaurus/stargazers" data-show-count="true" data-count-aria-label="# stargazers on GitHub" aria-label="Star this project on GitHub">Docusaurus</a></div><div class="social"><a href="https://twitter.com/docusaurus" class="twitter-follow-button">Follow @docusaurus</a></div><div class="social"><div class="fb-like" data-href="https://docusaurus.io" data-layout="standard" data-share="true" data-width="225" data-show-faces="false"></div></div></div></section><a href="https://code.facebook.com/projects/" target="_blank" rel="noreferrer noopener" class="fbOpenSource"><img src="/img/oss_logo.png" alt="Facebook Open Source" width="170" height="45"/></a><section class="copyright"><span>Copyright © 2018 Facebook Inc.</span></section></footer></div><script type="text/javascript" src="https://cdn.jsdelivr.net/docsearch.js/1/docsearch.min.js"></script><script>window.fbAsyncInit = function() {FB.init({appId:'199138890728411',xfbml:true,version:'v2.7'});};(function(d, s, id){var js, fjs = d.getElementsByTagName(s)[0];if (d.getElementById(id)) {return;}js = d.createElement(s); js.id = id;js.src = '//connect.facebook.net/en_US/sdk.js';fjs.parentNode.insertBefore(js, fjs);}(document, 'script','facebook-jssdk'));
|
||||
</script><script>window.twttr=(function(d,s, id){var js,fjs=d.getElementsByTagName(s)[0],t=window.twttr||{};if(d.getElementById(id))return t;js=d.createElement(s);js.id=id;js.src='https://platform.twitter.com/widgets.js';fjs.parentNode.insertBefore(js, fjs);t._e = [];t.ready = function(f) {t._e.push(f);};return t;}(document, 'script', 'twitter-wjs'));</script><script>
|
||||
var search = docsearch({
|
||||
|
||||
apiKey: '3eb9507824b8be89e7a199ecaa1a9d2c',
|
||||
indexName: 'docusaurus',
|
||||
inputSelector: '#search_input_react'
|
||||
});
|
||||
</script></body></html>
|
|
@ -12,7 +12,7 @@
|
|||
{"zIndex":100}
|
||||
)
|
||||
});
|
||||
</script><link rel="stylesheet" href="/css/main.css"/></head><body class="sideNavVisible doc separateOnPageNav"><div class="fixedHeaderContainer"><div class="headerWrapper wrapper"><header><a href="/en"><img class="logo" src="/img/docusaurus.svg" alt="Docusaurus"/><h2 class="headerTitleWithLogo">Docusaurus</h2></a><a href="/en/versions.html"><h3>next</h3></a><div class="navigationWrapper navigationSlider"><nav class="slidingNav"><ul class="nav-site nav-site-internal"><li class="siteNavGroupActive"><a href="/docs/en/next/installation.html" target="_self">Docs</a></li><li class=""><a href="/en/help.html" target="_self">Help</a></li><li class=""><a href="/en/users.html" target="_self">Users</a></li><li class=""><a href="/en/about-slash.html" target="_self">About /</a></li><li class=""><a href="/blog" target="_self">Blog</a></li><li class=""><a href="https://github.com/facebook/docusaurus" target="_self">GitHub</a></li><span><li><a id="languages-menu" href="#"><img class="languages-icon" src="/img/language.svg"/>English</a><div id="languages-dropdown" class="hide"><ul id="languages-dropdown-items"><li><a href="/es-ES">Español</a></li><li><a href="/ro">Română</a></li><li><a href="/tr">Türkçe</a></li><li><a href="/zh-CN">简体中文</a></li><li><a href="https://crowdin.com/project/docusaurus" target="_blank" rel="noreferrer noopener">Help Translate</a></li></ul></div></li><script>
|
||||
</script><link rel="stylesheet" href="/css/main.css"/></head><body class="sideNavVisible doc separateOnPageNav"><div class="fixedHeaderContainer"><div class="headerWrapper wrapper"><header><a href="/en"><img class="logo" src="/img/docusaurus.svg" alt="Docusaurus"/><h2 class="headerTitleWithLogo">Docusaurus</h2></a><a href="/en/versions.html"><h3>next</h3></a><div class="navigationWrapper navigationSlider"><nav class="slidingNav"><ul class="nav-site nav-site-internal"><li class="siteNavGroupActive"><a href="/docs/en/next/installation" target="_self">Docs</a></li><li class=""><a href="/en/help" target="_self">Help</a></li><li class=""><a href="/en/users" target="_self">Users</a></li><li class=""><a href="/en/about-slash" target="_self">About /</a></li><li class=""><a href="/blog" target="_self">Blog</a></li><li class=""><a href="https://github.com/facebook/docusaurus" target="_self">GitHub</a></li><span><li><a id="languages-menu" href="#"><img class="languages-icon" src="/img/language.svg"/>English</a><div id="languages-dropdown" class="hide"><ul id="languages-dropdown-items"><li><a href="/es-ES">Español</a></li><li><a href="/ro">Română</a></li><li><a href="/tr">Türkçe</a></li><li><a href="/zh-CN">简体中文</a></li><li><a href="https://crowdin.com/project/docusaurus" target="_blank" rel="noreferrer noopener">Help Translate</a></li></ul></div></li><script>
|
||||
const languagesMenuItem = document.getElementById("languages-menu");
|
||||
const languagesDropDown = document.getElementById("languages-dropdown");
|
||||
languagesMenuItem.addEventListener("click", function(){
|
||||
|
@ -22,7 +22,7 @@
|
|||
languagesDropDown.className = "hide";
|
||||
}
|
||||
});
|
||||
</script></span><li class="navSearchWrapper reactNavSearchWrapper"><input type="text" id="search_input_react" placeholder="Search" title="Search"/></li></ul></nav></div></header></div></div><div class="navPusher"><div class="docMainWrapper wrapper"><div class="container docsNavContainer" id="docsNav"><nav class="toc"><div class="toggleNav"><section class="navWrapper wrapper"><div class="navBreadcrumb wrapper"><div class="navToggle" id="navToggler"><i></i></div><h2><i>›</i><span>API</span></h2></div><div class="navGroups"><div class="navGroup navGroupActive"><h3>Getting Started</h3><ul><li class="navListItem"><a class="navItem" href="/docs/en/next/installation.html">Installation</a></li><li class="navListItem"><a class="navItem" href="/docs/en/next/site-preparation.html">Site Preparation</a></li><li class="navListItem"><a class="navItem" href="/docs/en/next/site-creation.html">Creating your site</a></li><li class="navListItem"><a class="navItem" href="/docs/en/next/publishing.html">Publishing your site</a></li></ul></div><div class="navGroup navGroupActive"><h3>Guides</h3><ul><li class="navListItem"><a class="navItem" href="/docs/en/next/blog.html">Adding a Blog</a></li><li class="navListItem"><a class="navItem" href="/docs/en/next/custom-pages.html">Custom Pages</a></li><li class="navListItem"><a class="navItem" href="/docs/en/next/search.html">Enabling Search</a></li><li class="navListItem"><a class="navItem" href="/docs/en/next/navigation.html">Navigation and Sidebars</a></li><li class="navListItem"><a class="navItem" href="/docs/en/next/translation.html">Translations & Localization</a></li><li class="navListItem"><a class="navItem" href="/docs/en/next/versioning.html">Versioning</a></li></ul></div><div class="navGroup navGroupActive"><h3>API</h3><ul><li class="navListItem"><a class="navItem" href="/docs/en/next/commands.html">CLI Commands</a></li><li class="navListItem navListItemActive"><a class="navItem navItemActive" href="/docs/en/next/doc-markdown.html">Markdown Features</a></li><li class="navListItem"><a class="navItem" href="/docs/en/next/api-pages.html">Pages and Styles</a></li><li class="navListItem"><a class="navItem" href="/docs/en/next/site-config.html">siteConfig.js</a></li></ul></div></div></section></div><script>
|
||||
</script></span><li class="navSearchWrapper reactNavSearchWrapper"><input type="text" id="search_input_react" placeholder="Search" title="Search"/></li></ul></nav></div></header></div></div><div class="navPusher"><div class="docMainWrapper wrapper"><div class="container docsNavContainer" id="docsNav"><nav class="toc"><div class="toggleNav"><section class="navWrapper wrapper"><div class="navBreadcrumb wrapper"><div class="navToggle" id="navToggler"><i></i></div><h2><i>›</i><span>API</span></h2></div><div class="navGroups"><div class="navGroup navGroupActive"><h3>Getting Started</h3><ul><li class="navListItem"><a class="navItem" href="/docs/en/next/installation">Installation</a></li><li class="navListItem"><a class="navItem" href="/docs/en/next/site-preparation">Site Preparation</a></li><li class="navListItem"><a class="navItem" href="/docs/en/next/site-creation">Creating your site</a></li><li class="navListItem"><a class="navItem" href="/docs/en/next/publishing">Publishing your site</a></li></ul></div><div class="navGroup navGroupActive"><h3>Guides</h3><ul><li class="navListItem"><a class="navItem" href="/docs/en/next/blog">Adding a Blog</a></li><li class="navListItem"><a class="navItem" href="/docs/en/next/custom-pages">Custom Pages</a></li><li class="navListItem"><a class="navItem" href="/docs/en/next/search">Enabling Search</a></li><li class="navListItem"><a class="navItem" href="/docs/en/next/navigation">Navigation and Sidebars</a></li><li class="navListItem"><a class="navItem" href="/docs/en/next/translation">Translations & Localization</a></li><li class="navListItem"><a class="navItem" href="/docs/en/next/versioning">Versioning</a></li></ul></div><div class="navGroup navGroupActive"><h3>API</h3><ul><li class="navListItem"><a class="navItem" href="/docs/en/next/commands">CLI Commands</a></li><li class="navListItem navListItemActive"><a class="navItem navItemActive" href="/docs/en/next/doc-markdown">Markdown Features</a></li><li class="navListItem"><a class="navItem" href="/docs/en/next/api-pages">Pages and Styles</a></li><li class="navListItem"><a class="navItem" href="/docs/en/next/site-config">siteConfig.js</a></li></ul></div></div></section></div><script>
|
||||
var toggler = document.getElementById('navToggler');
|
||||
var nav = document.getElementById('docsNav');
|
||||
toggler.onclick = function() {
|
||||
|
@ -143,7 +143,7 @@ ReactDOM.render(
|
|||
}
|
||||
}
|
||||
</code></pre>
|
||||
</span></div></article></div><div class="docs-prevnext"><a class="docs-prev button" href="commands.html">← CLI Commands</a><a class="docs-next button" href="api-pages.html">Pages and Styles →</a></div></div></div><nav class="onPageNav"><ul class="toc-headings"><li><a href="#markdown-headers">Markdown Headers</a><ul class="toc-headings"><li><a href="#documents">Documents</a></li><li><a href="#blog-posts">Blog Posts</a></li></ul></li><li><a href="#extra-features">Extra Features</a><ul class="toc-headings"><li><a href="#linking-other-documents">Linking other Documents</a></li><li><a href="#linking-to-images-and-other-assets">Linking to Images and Other Assets</a></li><li><a href="#generating-table-of-contents">Generating Table of Contents</a></li></ul></li><li><a href="#syntax-highlighting">Syntax Highlighting</a><ul class="toc-headings"><li><a href="#registering-additional-languages">Registering additional languages</a></li></ul></li></ul></nav></div><footer class="nav-footer" id="footer"><section class="sitemap"><a href="/" class="nav-home"><img src="/img/docusaurus_monochrome.svg" alt="Docusaurus" width="66" height="58"/></a><div><h5>Docs</h5><a href="
|
||||
</span></div></article></div><div class="docs-prevnext"><a class="docs-prev button" href="commands">← CLI Commands</a><a class="docs-next button" href="api-pages">Pages and Styles →</a></div></div></div><nav class="onPageNav"><ul class="toc-headings"><li><a href="#markdown-headers">Markdown Headers</a><ul class="toc-headings"><li><a href="#documents">Documents</a></li><li><a href="#blog-posts">Blog Posts</a></li></ul></li><li><a href="#extra-features">Extra Features</a><ul class="toc-headings"><li><a href="#linking-other-documents">Linking other Documents</a></li><li><a href="#linking-to-images-and-other-assets">Linking to Images and Other Assets</a></li><li><a href="#generating-table-of-contents">Generating Table of Contents</a></li></ul></li><li><a href="#syntax-highlighting">Syntax Highlighting</a><ul class="toc-headings"><li><a href="#registering-additional-languages">Registering additional languages</a></li></ul></li></ul></nav></div><footer class="nav-footer" id="footer"><section class="sitemap"><a href="/" class="nav-home"><img src="/img/docusaurus_monochrome.svg" alt="Docusaurus" width="66" height="58"/></a><div><h5>Docs</h5><a href="
|
||||
/docs/en/installation.html">Getting Started</a><a href="
|
||||
/docs/en/versioning.html">Versioning</a><a href="
|
||||
/docs/en/translation.html">Localization</a><a href="
|
||||
|
|
158
docs/en/next/doc-markdown/index.html
Normal file
158
docs/en/next/doc-markdown/index.html
Normal file
|
@ -0,0 +1,158 @@
|
|||
<!DOCTYPE html><html lang="en"><head><meta charSet="utf-8"/><meta http-equiv="X-UA-Compatible" content="IE=edge"/><title>Markdown Features · Docusaurus</title><meta name="viewport" content="width=device-width"/><meta name="generator" content="Docusaurus"/><meta property="og:title" content="Markdown Features · Docusaurus"/><meta property="og:type" content="website"/><meta property="og:url" content="https://docusaurus.io/index.html"/><meta property="og:description" content="## Markdown Headers"/><meta property="og:image" content="https://docusaurus.io/img/docusaurus.png"/><meta name="twitter:card" content="summary"/><meta name="twitter:image" content="https://docusaurus.io/img/docusaurus.png"/><link rel="shortcut icon" href="/img/docusaurus.ico"/><link rel="stylesheet" href="https://cdn.jsdelivr.net/docsearch.js/1/docsearch.min.css"/><link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/highlight.js/9.12.0/styles/atom-one-dark.min.css"/><link rel="alternate" type="application/atom+xml" href="https://docusaurus.io/blog/atom.xml" title="Docusaurus Blog ATOM Feed"/><link rel="alternate" type="application/rss+xml" href="https://docusaurus.io/blog/feed.xml" title="Docusaurus Blog RSS Feed"/><script>
|
||||
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
|
||||
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
|
||||
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
|
||||
})(window,document,'script','https://www.google-analytics.com/analytics.js','ga');
|
||||
|
||||
ga('create', 'UA-44373548-31', 'auto');
|
||||
ga('send', 'pageview');
|
||||
</script><link rel="stylesheet" href="/css/code-blocks-buttons.css"/><script type="text/javascript" src="https://buttons.github.io/buttons.js"></script><script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/clipboard.js/2.0.0/clipboard.min.js"></script><script type="text/javascript" src="/js/code-blocks-buttons.js"></script><script src="https://unpkg.com/vanilla-back-to-top@7.1.14/dist/vanilla-back-to-top.min.js"></script><script>
|
||||
document.addEventListener("DOMContentLoaded", function(){
|
||||
addBackToTop(
|
||||
{"zIndex":100}
|
||||
)
|
||||
});
|
||||
</script><link rel="stylesheet" href="/css/main.css"/></head><body class="sideNavVisible doc separateOnPageNav"><div class="fixedHeaderContainer"><div class="headerWrapper wrapper"><header><a href="/en"><img class="logo" src="/img/docusaurus.svg" alt="Docusaurus"/><h2 class="headerTitleWithLogo">Docusaurus</h2></a><a href="/en/versions.html"><h3>next</h3></a><div class="navigationWrapper navigationSlider"><nav class="slidingNav"><ul class="nav-site nav-site-internal"><li class="siteNavGroupActive"><a href="/docs/en/next/installation" target="_self">Docs</a></li><li class=""><a href="/en/help" target="_self">Help</a></li><li class=""><a href="/en/users" target="_self">Users</a></li><li class=""><a href="/en/about-slash" target="_self">About /</a></li><li class=""><a href="/blog" target="_self">Blog</a></li><li class=""><a href="https://github.com/facebook/docusaurus" target="_self">GitHub</a></li><span><li><a id="languages-menu" href="#"><img class="languages-icon" src="/img/language.svg"/>English</a><div id="languages-dropdown" class="hide"><ul id="languages-dropdown-items"><li><a href="/es-ES">Español</a></li><li><a href="/ro">Română</a></li><li><a href="/tr">Türkçe</a></li><li><a href="/zh-CN">简体中文</a></li><li><a href="https://crowdin.com/project/docusaurus" target="_blank" rel="noreferrer noopener">Help Translate</a></li></ul></div></li><script>
|
||||
const languagesMenuItem = document.getElementById("languages-menu");
|
||||
const languagesDropDown = document.getElementById("languages-dropdown");
|
||||
languagesMenuItem.addEventListener("click", function(){
|
||||
if(languagesDropDown.className == "hide") {
|
||||
languagesDropDown.className = "visible";
|
||||
} else {
|
||||
languagesDropDown.className = "hide";
|
||||
}
|
||||
});
|
||||
</script></span><li class="navSearchWrapper reactNavSearchWrapper"><input type="text" id="search_input_react" placeholder="Search" title="Search"/></li></ul></nav></div></header></div></div><div class="navPusher"><div class="docMainWrapper wrapper"><div class="container docsNavContainer" id="docsNav"><nav class="toc"><div class="toggleNav"><section class="navWrapper wrapper"><div class="navBreadcrumb wrapper"><div class="navToggle" id="navToggler"><i></i></div><h2><i>›</i><span>API</span></h2></div><div class="navGroups"><div class="navGroup navGroupActive"><h3>Getting Started</h3><ul><li class="navListItem"><a class="navItem" href="/docs/en/next/installation">Installation</a></li><li class="navListItem"><a class="navItem" href="/docs/en/next/site-preparation">Site Preparation</a></li><li class="navListItem"><a class="navItem" href="/docs/en/next/site-creation">Creating your site</a></li><li class="navListItem"><a class="navItem" href="/docs/en/next/publishing">Publishing your site</a></li></ul></div><div class="navGroup navGroupActive"><h3>Guides</h3><ul><li class="navListItem"><a class="navItem" href="/docs/en/next/blog">Adding a Blog</a></li><li class="navListItem"><a class="navItem" href="/docs/en/next/custom-pages">Custom Pages</a></li><li class="navListItem"><a class="navItem" href="/docs/en/next/search">Enabling Search</a></li><li class="navListItem"><a class="navItem" href="/docs/en/next/navigation">Navigation and Sidebars</a></li><li class="navListItem"><a class="navItem" href="/docs/en/next/translation">Translations & Localization</a></li><li class="navListItem"><a class="navItem" href="/docs/en/next/versioning">Versioning</a></li></ul></div><div class="navGroup navGroupActive"><h3>API</h3><ul><li class="navListItem"><a class="navItem" href="/docs/en/next/commands">CLI Commands</a></li><li class="navListItem navListItemActive"><a class="navItem navItemActive" href="/docs/en/next/doc-markdown">Markdown Features</a></li><li class="navListItem"><a class="navItem" href="/docs/en/next/api-pages">Pages and Styles</a></li><li class="navListItem"><a class="navItem" href="/docs/en/next/site-config">siteConfig.js</a></li></ul></div></div></section></div><script>
|
||||
var toggler = document.getElementById('navToggler');
|
||||
var nav = document.getElementById('docsNav');
|
||||
toggler.onclick = function() {
|
||||
nav.classList.toggle('docsSliderActive');
|
||||
};
|
||||
</script></nav></div><div class="container mainContainer"><div class="wrapper"><div class="post"><header class="postHeader"><a class="edit-page-link button" href="https://github.com/facebook/docusaurus/edit/master/docs/api-doc-markdown.md" target="_blank" rel="noreferrer noopener">Edit</a><h1>Markdown Features</h1></header><article><div><span><h2><a class="anchor" aria-hidden="true" id="markdown-headers"></a><a href="#markdown-headers" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Markdown Headers</h2>
|
||||
<h3><a class="anchor" aria-hidden="true" id="documents"></a><a href="#documents" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Documents</h3>
|
||||
<p>Documents use the following markdown header fields that are enclosed by a line <code>---</code> on either side:</p>
|
||||
<p><code>id</code>: A unique document id. If this field is not present, the document's <code>id</code> will default to its file name (without the extension).</p>
|
||||
<p><code>title</code>: The title of your document. If this field is not present, the document's <code>title</code> will default to its <code>id</code>.</p>
|
||||
<p><code>hide_title</code>: Whether to hide the title at the top of the doc.</p>
|
||||
<p><code>sidebar_label</code>: The text shown in the document sidebar for this document. If this field is not present, the document's <code>sidebar_label</code> will default to its <code>title</code>.</p>
|
||||
<p>For example:</p>
|
||||
<pre><code class="hljs css yaml"><span class="hljs-meta">---</span>
|
||||
<span class="hljs-attr">id:</span> <span class="hljs-string">doc1</span>
|
||||
<span class="hljs-attr">title:</span> <span class="hljs-string">My</span> <span class="hljs-string">Document</span>
|
||||
<span class="hljs-attr">sidebar_label:</span> <span class="hljs-string">Document</span>
|
||||
<span class="hljs-meta">---</span>
|
||||
</code></pre>
|
||||
<p>Versioned documents have their ids altered to include the version number when they get copied. The new <code>id</code> is <code>version-${version}-${id}</code> where <code>${version}</code> is the version number of that document and <code>${id}</code> is the original <code>id</code>. Additionally, versioned documents get an added <code>original_id</code> field with the original document id.</p>
|
||||
<p>For example:</p>
|
||||
<pre><code class="hljs css yaml"><span class="hljs-meta">---</span>
|
||||
<span class="hljs-attr">id:</span> <span class="hljs-string">version-1.0.0-doc1</span>
|
||||
<span class="hljs-attr">title:</span> <span class="hljs-string">My</span> <span class="hljs-string">Document</span>
|
||||
<span class="hljs-attr">sidebar_label:</span> <span class="hljs-string">Document</span>
|
||||
<span class="hljs-attr">original_id:</span> <span class="hljs-string">doc1</span>
|
||||
<span class="hljs-meta">---</span>
|
||||
</code></pre>
|
||||
<p><code>custom_edit_url</code>: The url for editing this document. If this field is not present, the document's edit url will fallback to <code>editUrl</code> from optional fields of <code>siteConfig.js</code>. See <a href="site-config.md">siteConfig.js</a> docs for more information.</p>
|
||||
<p>For example:</p>
|
||||
<pre><code class="hljs css yaml"><span class="hljs-meta">---</span>
|
||||
<span class="hljs-attr">id:</span> <span class="hljs-string">doc-markdown</span>
|
||||
<span class="hljs-attr">title:</span> <span class="hljs-string">Markdown</span> <span class="hljs-string">Features</span>
|
||||
<span class="hljs-attr">custom_edit_url:</span> <span class="hljs-attr">https://github.com/facebook/Docusaurus/edit/master/docs/api-doc-markdown.md</span>
|
||||
<span class="hljs-meta">---</span>
|
||||
</code></pre>
|
||||
<h3><a class="anchor" aria-hidden="true" id="blog-posts"></a><a href="#blog-posts" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Blog Posts</h3>
|
||||
<p>Blog Posts use the following markdown header fields that are enclosed by a line <code>---</code> on either side:</p>
|
||||
<p><code>title</code>: The title of this blog post.</p>
|
||||
<p><code>author</code>: The author of this blog post. If this field is omitted, no author name will be shown.</p>
|
||||
<p><code>authorURL</code>: A page to link to when a site user clicks the author's name. If this field is omitted, the author's name will not link to anything.</p>
|
||||
<p><code>authorFBID</code>: The author's Facebook id, used only to get the author's profile picture to display with the blog post. If this field is omitted, no author picture will be shown for the blog post.</p>
|
||||
<p>For example:</p>
|
||||
<pre><code class="hljs css yaml"><span class="hljs-meta">---</span>
|
||||
<span class="hljs-attr">title:</span> <span class="hljs-string">My</span> <span class="hljs-string">First</span> <span class="hljs-string">Blog</span> <span class="hljs-string">Post</span>
|
||||
<span class="hljs-attr">author:</span> <span class="hljs-string">Frank</span> <span class="hljs-string">Li</span>
|
||||
<span class="hljs-attr">authorURL:</span> <span class="hljs-attr">http://twitter.com/franchementli</span>
|
||||
<span class="hljs-attr">authorFBID:</span> <span class="hljs-number">100002976521003</span>
|
||||
<span class="hljs-meta">---</span>
|
||||
</code></pre>
|
||||
<h2><a class="anchor" aria-hidden="true" id="extra-features"></a><a href="#extra-features" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Extra Features</h2>
|
||||
<p>Docusaurus supports some extra features when writing documentation in markdown.</p>
|
||||
<h3><a class="anchor" aria-hidden="true" id="linking-other-documents"></a><a href="#linking-other-documents" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Linking other Documents</h3>
|
||||
<p>You can use relative urls to other documentation files which will automatically get converted to the corresponding html links when they get rendered.</p>
|
||||
<p>Example:</p>
|
||||
<pre><code class="hljs css md">[<span class="hljs-string">This links to another document</span>](<span class="hljs-link">other-document.md</span>)
|
||||
</code></pre>
|
||||
<p>This markdown will automatically get converted into a link to <code>/docs/other-document.html</code> (or the appropriately translated/versioned link) once it gets rendered.</p>
|
||||
<p>This can help when you want to navigate through docs on GitHub since the links there will be functional links to other documents (still on GitHub), but the documents will have the correct html links when they get rendered.</p>
|
||||
<h3><a class="anchor" aria-hidden="true" id="linking-to-images-and-other-assets"></a><a href="#linking-to-images-and-other-assets" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Linking to Images and Other Assets</h3>
|
||||
<p>Static assets can be linked to in the same way that documents are, using relative urls. Static assets used in documents and blogs should go into <code>docs/assets</code> and <code>website/blog/assets</code>, respectively. The markdown will get converted into correct link paths so that these paths will work for documents of all languages and versions.</p>
|
||||
<p>Example:</p>
|
||||
<pre><code class="hljs css md">
|
||||
</code></pre>
|
||||
<h3><a class="anchor" aria-hidden="true" id="generating-table-of-contents"></a><a href="#generating-table-of-contents" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Generating Table of Contents</h3>
|
||||
<p>You can make an autogenerated list of links, which can be useful as a table of contents for API docs.</p>
|
||||
<p>In your markdown file, insert a line with the text <<code>AUTOGENERATED_TABLE_OF_CONTENTS</code>>. Write your documentation using <code>h3</code> headers for each function inside a code block. These will be found by Docusaurus and a list of links to these sections will inserted at the text <<code>AUTOGENERATED_TABLE_OF_CONTENTS</code>>.</p>
|
||||
<p>Example:</p>
|
||||
<pre><code class="hljs css md"><span class="hljs-section">### `docusaurus.function(a, b)`</span>
|
||||
|
||||
Text describing my function
|
||||
|
||||
<span class="hljs-section">### `docdoc(file)`</span>
|
||||
|
||||
Text describing my function
|
||||
</code></pre>
|
||||
<p>will lead to a table of contents of the functions:</p>
|
||||
<pre><code class="hljs css md"><span class="hljs-bullet">- </span><span class="hljs-code">`docusaurus.function(a, b)`</span>
|
||||
<span class="hljs-bullet">- </span><span class="hljs-code">`docdoc(file)`</span>
|
||||
</code></pre>
|
||||
<p>and each function will link to their corresponding sections in the page.</p>
|
||||
<h2><a class="anchor" aria-hidden="true" id="syntax-highlighting"></a><a href="#syntax-highlighting" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Syntax Highlighting</h2>
|
||||
<p>Syntax highlighting is enabled by default on fenced code blocks. The language should be detected automatically, but you can sometimes get better results by specifying the language. You can do so using an <a href="https://github.github.com/gfm/#example-111">info string</a>, following the three opening backticks. The following JavaScript example...</p>
|
||||
<pre><code class="hljs">```js
|
||||
ReactDOM.render(
|
||||
<h1>Hello, world!</h1>,
|
||||
document.getElementById('root')
|
||||
);
|
||||
```
|
||||
</code></pre>
|
||||
<p>...would be rendered with syntax highlighting like so:</p>
|
||||
<pre><code class="hljs css js">ReactDOM.render(
|
||||
<span class="xml"><span class="hljs-tag"><<span class="hljs-name">h1</span>></span>Hello, world!<span class="hljs-tag"></<span class="hljs-name">h1</span>></span></span>,
|
||||
<span class="hljs-built_in">document</span>.getElementById(<span class="hljs-string">'root'</span>)
|
||||
);
|
||||
</code></pre>
|
||||
<p>Highlighting is provided by <a href="https://highlightjs.org">Highlight.js</a> using the theme specified in your <code>siteConfig.js</code> file as part of the <code>highlight</code> key:</p>
|
||||
<pre><code class="hljs css js">{
|
||||
...
|
||||
highlight: {
|
||||
<span class="hljs-attr">theme</span>: <span class="hljs-string">'default'</span>
|
||||
}
|
||||
...
|
||||
}
|
||||
</code></pre>
|
||||
<p>You can find the full list of supported themes in the Highlight.js <a href="https://github.com/isagalaev/highlight.js/tree/master/src/styles"><code>styles</code></a> directory.</p>
|
||||
<h3><a class="anchor" aria-hidden="true" id="registering-additional-languages"></a><a href="#registering-additional-languages" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Registering additional languages</h3>
|
||||
<p>While Highlight.js provides support for <a href="https://highlightjs.org/static/demo/">many popular languages out of the box</a>, you may find the need to register additional language support. For these cases, we provide an escape valve by exposing the <code>hljs</code> constant as part of the <code>highlight</code> config key. This in turn allows you to call <a href="http://highlightjs.readthedocs.io/en/latest/api.html#registerlanguage-name-language"><code>registerLanguage</code></a>:</p>
|
||||
<pre><code class="hljs css js">{
|
||||
...
|
||||
highlight: {
|
||||
<span class="hljs-attr">theme</span>: <span class="hljs-string">'default'</span>,
|
||||
<span class="hljs-attr">hljs</span>: <span class="hljs-function"><span class="hljs-keyword">function</span>(<span class="hljs-params">hljs</span>) </span>{
|
||||
hljs.registerLanguage(<span class="hljs-string">'galacticbasic'</span>, <span class="hljs-function"><span class="hljs-keyword">function</span>(<span class="hljs-params">hljs</span>) </span>{
|
||||
<span class="hljs-comment">// ...</span>
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
</code></pre>
|
||||
</span></div></article></div><div class="docs-prevnext"><a class="docs-prev button" href="commands">← CLI Commands</a><a class="docs-next button" href="api-pages">Pages and Styles →</a></div></div></div><nav class="onPageNav"><ul class="toc-headings"><li><a href="#markdown-headers">Markdown Headers</a><ul class="toc-headings"><li><a href="#documents">Documents</a></li><li><a href="#blog-posts">Blog Posts</a></li></ul></li><li><a href="#extra-features">Extra Features</a><ul class="toc-headings"><li><a href="#linking-other-documents">Linking other Documents</a></li><li><a href="#linking-to-images-and-other-assets">Linking to Images and Other Assets</a></li><li><a href="#generating-table-of-contents">Generating Table of Contents</a></li></ul></li><li><a href="#syntax-highlighting">Syntax Highlighting</a><ul class="toc-headings"><li><a href="#registering-additional-languages">Registering additional languages</a></li></ul></li></ul></nav></div><footer class="nav-footer" id="footer"><section class="sitemap"><a href="/" class="nav-home"><img src="/img/docusaurus_monochrome.svg" alt="Docusaurus" width="66" height="58"/></a><div><h5>Docs</h5><a href="
|
||||
/docs/en/installation.html">Getting Started</a><a href="
|
||||
/docs/en/versioning.html">Versioning</a><a href="
|
||||
/docs/en/translation.html">Localization</a><a href="
|
||||
/docs/en/search.html">Adding Search</a></div><div><h5>Community</h5><a href="/en/users.html">User Showcase</a></div><div><h5>More</h5><div class="social"><a class="github-button" href="https://github.com/facebook/Docusaurus" data-count-href="/facebook/Docusaurus/stargazers" data-show-count="true" data-count-aria-label="# stargazers on GitHub" aria-label="Star this project on GitHub">Docusaurus</a></div><div class="social"><a href="https://twitter.com/docusaurus" class="twitter-follow-button">Follow @docusaurus</a></div><div class="social"><div class="fb-like" data-href="https://docusaurus.io" data-layout="standard" data-share="true" data-width="225" data-show-faces="false"></div></div></div></section><a href="https://code.facebook.com/projects/" target="_blank" rel="noreferrer noopener" class="fbOpenSource"><img src="/img/oss_logo.png" alt="Facebook Open Source" width="170" height="45"/></a><section class="copyright"><span>Copyright © 2018 Facebook Inc.</span></section></footer></div><script type="text/javascript" src="https://cdn.jsdelivr.net/docsearch.js/1/docsearch.min.js"></script><script>window.fbAsyncInit = function() {FB.init({appId:'199138890728411',xfbml:true,version:'v2.7'});};(function(d, s, id){var js, fjs = d.getElementsByTagName(s)[0];if (d.getElementById(id)) {return;}js = d.createElement(s); js.id = id;js.src = '//connect.facebook.net/en_US/sdk.js';fjs.parentNode.insertBefore(js, fjs);}(document, 'script','facebook-jssdk'));
|
||||
</script><script>window.twttr=(function(d,s, id){var js,fjs=d.getElementsByTagName(s)[0],t=window.twttr||{};if(d.getElementById(id))return t;js=d.createElement(s);js.id=id;js.src='https://platform.twitter.com/widgets.js';fjs.parentNode.insertBefore(js, fjs);t._e = [];t.ready = function(f) {t._e.push(f);};return t;}(document, 'script', 'twitter-wjs'));</script><script>
|
||||
var search = docsearch({
|
||||
|
||||
apiKey: '3eb9507824b8be89e7a199ecaa1a9d2c',
|
||||
indexName: 'docusaurus',
|
||||
inputSelector: '#search_input_react'
|
||||
});
|
||||
</script></body></html>
|
|
@ -12,7 +12,7 @@
|
|||
{"zIndex":100}
|
||||
)
|
||||
});
|
||||
</script><link rel="stylesheet" href="/css/main.css"/></head><body class="sideNavVisible doc separateOnPageNav"><div class="fixedHeaderContainer"><div class="headerWrapper wrapper"><header><a href="/en"><img class="logo" src="/img/docusaurus.svg" alt="Docusaurus"/><h2 class="headerTitleWithLogo">Docusaurus</h2></a><a href="/en/versions.html"><h3>next</h3></a><div class="navigationWrapper navigationSlider"><nav class="slidingNav"><ul class="nav-site nav-site-internal"><li class="siteNavGroupActive siteNavItemActive"><a href="/docs/en/next/installation.html" target="_self">Docs</a></li><li class=""><a href="/en/help.html" target="_self">Help</a></li><li class=""><a href="/en/users.html" target="_self">Users</a></li><li class=""><a href="/en/about-slash.html" target="_self">About /</a></li><li class=""><a href="/blog" target="_self">Blog</a></li><li class=""><a href="https://github.com/facebook/docusaurus" target="_self">GitHub</a></li><span><li><a id="languages-menu" href="#"><img class="languages-icon" src="/img/language.svg"/>English</a><div id="languages-dropdown" class="hide"><ul id="languages-dropdown-items"><li><a href="/es-ES">Español</a></li><li><a href="/ro">Română</a></li><li><a href="/tr">Türkçe</a></li><li><a href="/zh-CN">简体中文</a></li><li><a href="https://crowdin.com/project/docusaurus" target="_blank" rel="noreferrer noopener">Help Translate</a></li></ul></div></li><script>
|
||||
</script><link rel="stylesheet" href="/css/main.css"/></head><body class="sideNavVisible doc separateOnPageNav"><div class="fixedHeaderContainer"><div class="headerWrapper wrapper"><header><a href="/en"><img class="logo" src="/img/docusaurus.svg" alt="Docusaurus"/><h2 class="headerTitleWithLogo">Docusaurus</h2></a><a href="/en/versions.html"><h3>next</h3></a><div class="navigationWrapper navigationSlider"><nav class="slidingNav"><ul class="nav-site nav-site-internal"><li class="siteNavGroupActive siteNavItemActive"><a href="/docs/en/next/installation" target="_self">Docs</a></li><li class=""><a href="/en/help" target="_self">Help</a></li><li class=""><a href="/en/users" target="_self">Users</a></li><li class=""><a href="/en/about-slash" target="_self">About /</a></li><li class=""><a href="/blog" target="_self">Blog</a></li><li class=""><a href="https://github.com/facebook/docusaurus" target="_self">GitHub</a></li><span><li><a id="languages-menu" href="#"><img class="languages-icon" src="/img/language.svg"/>English</a><div id="languages-dropdown" class="hide"><ul id="languages-dropdown-items"><li><a href="/es-ES">Español</a></li><li><a href="/ro">Română</a></li><li><a href="/tr">Türkçe</a></li><li><a href="/zh-CN">简体中文</a></li><li><a href="https://crowdin.com/project/docusaurus" target="_blank" rel="noreferrer noopener">Help Translate</a></li></ul></div></li><script>
|
||||
const languagesMenuItem = document.getElementById("languages-menu");
|
||||
const languagesDropDown = document.getElementById("languages-dropdown");
|
||||
languagesMenuItem.addEventListener("click", function(){
|
||||
|
@ -22,7 +22,7 @@
|
|||
languagesDropDown.className = "hide";
|
||||
}
|
||||
});
|
||||
</script></span><li class="navSearchWrapper reactNavSearchWrapper"><input type="text" id="search_input_react" placeholder="Search" title="Search"/></li></ul></nav></div></header></div></div><div class="navPusher"><div class="docMainWrapper wrapper"><div class="container docsNavContainer" id="docsNav"><nav class="toc"><div class="toggleNav"><section class="navWrapper wrapper"><div class="navBreadcrumb wrapper"><div class="navToggle" id="navToggler"><i></i></div><h2><i>›</i><span>Getting Started</span></h2></div><div class="navGroups"><div class="navGroup navGroupActive"><h3>Getting Started</h3><ul><li class="navListItem navListItemActive"><a class="navItem navItemActive" href="/docs/en/next/installation.html">Installation</a></li><li class="navListItem"><a class="navItem" href="/docs/en/next/site-preparation.html">Site Preparation</a></li><li class="navListItem"><a class="navItem" href="/docs/en/next/site-creation.html">Creating your site</a></li><li class="navListItem"><a class="navItem" href="/docs/en/next/publishing.html">Publishing your site</a></li></ul></div><div class="navGroup navGroupActive"><h3>Guides</h3><ul><li class="navListItem"><a class="navItem" href="/docs/en/next/blog.html">Adding a Blog</a></li><li class="navListItem"><a class="navItem" href="/docs/en/next/custom-pages.html">Custom Pages</a></li><li class="navListItem"><a class="navItem" href="/docs/en/next/search.html">Enabling Search</a></li><li class="navListItem"><a class="navItem" href="/docs/en/next/navigation.html">Navigation and Sidebars</a></li><li class="navListItem"><a class="navItem" href="/docs/en/next/translation.html">Translations & Localization</a></li><li class="navListItem"><a class="navItem" href="/docs/en/next/versioning.html">Versioning</a></li></ul></div><div class="navGroup navGroupActive"><h3>API</h3><ul><li class="navListItem"><a class="navItem" href="/docs/en/next/commands.html">CLI Commands</a></li><li class="navListItem"><a class="navItem" href="/docs/en/next/doc-markdown.html">Markdown Features</a></li><li class="navListItem"><a class="navItem" href="/docs/en/next/api-pages.html">Pages and Styles</a></li><li class="navListItem"><a class="navItem" href="/docs/en/next/site-config.html">siteConfig.js</a></li></ul></div></div></section></div><script>
|
||||
</script></span><li class="navSearchWrapper reactNavSearchWrapper"><input type="text" id="search_input_react" placeholder="Search" title="Search"/></li></ul></nav></div></header></div></div><div class="navPusher"><div class="docMainWrapper wrapper"><div class="container docsNavContainer" id="docsNav"><nav class="toc"><div class="toggleNav"><section class="navWrapper wrapper"><div class="navBreadcrumb wrapper"><div class="navToggle" id="navToggler"><i></i></div><h2><i>›</i><span>Getting Started</span></h2></div><div class="navGroups"><div class="navGroup navGroupActive"><h3>Getting Started</h3><ul><li class="navListItem navListItemActive"><a class="navItem navItemActive" href="/docs/en/next/installation">Installation</a></li><li class="navListItem"><a class="navItem" href="/docs/en/next/site-preparation">Site Preparation</a></li><li class="navListItem"><a class="navItem" href="/docs/en/next/site-creation">Creating your site</a></li><li class="navListItem"><a class="navItem" href="/docs/en/next/publishing">Publishing your site</a></li></ul></div><div class="navGroup navGroupActive"><h3>Guides</h3><ul><li class="navListItem"><a class="navItem" href="/docs/en/next/blog">Adding a Blog</a></li><li class="navListItem"><a class="navItem" href="/docs/en/next/custom-pages">Custom Pages</a></li><li class="navListItem"><a class="navItem" href="/docs/en/next/search">Enabling Search</a></li><li class="navListItem"><a class="navItem" href="/docs/en/next/navigation">Navigation and Sidebars</a></li><li class="navListItem"><a class="navItem" href="/docs/en/next/translation">Translations & Localization</a></li><li class="navListItem"><a class="navItem" href="/docs/en/next/versioning">Versioning</a></li></ul></div><div class="navGroup navGroupActive"><h3>API</h3><ul><li class="navListItem"><a class="navItem" href="/docs/en/next/commands">CLI Commands</a></li><li class="navListItem"><a class="navItem" href="/docs/en/next/doc-markdown">Markdown Features</a></li><li class="navListItem"><a class="navItem" href="/docs/en/next/api-pages">Pages and Styles</a></li><li class="navListItem"><a class="navItem" href="/docs/en/next/site-config">siteConfig.js</a></li></ul></div></div></section></div><script>
|
||||
var toggler = document.getElementById('navToggler');
|
||||
var nav = document.getElementById('docsNav');
|
||||
toggler.onclick = function() {
|
||||
|
@ -79,7 +79,7 @@
|
|||
<pre><code class="hljs css sh">SET NO_PROXY=localhost
|
||||
yarn start (or npm run start)
|
||||
</code></pre>
|
||||
</span></div></article></div><div class="docs-prevnext"><a class="docs-next button" href="site-preparation.html">Site Preparation →</a></div></div></div><nav class="onPageNav"><ul class="toc-headings"><li><a href="#verifying-installation">Verifying Installation</a><ul class="toc-headings"><li><a href="#launching-the-server-behind-a-proxy">Launching the server behind a proxy</a></li></ul></li></ul></nav></div><footer class="nav-footer" id="footer"><section class="sitemap"><a href="/" class="nav-home"><img src="/img/docusaurus_monochrome.svg" alt="Docusaurus" width="66" height="58"/></a><div><h5>Docs</h5><a href="
|
||||
</span></div></article></div><div class="docs-prevnext"><a class="docs-next button" href="site-preparation">Site Preparation →</a></div></div></div><nav class="onPageNav"><ul class="toc-headings"><li><a href="#verifying-installation">Verifying Installation</a><ul class="toc-headings"><li><a href="#launching-the-server-behind-a-proxy">Launching the server behind a proxy</a></li></ul></li></ul></nav></div><footer class="nav-footer" id="footer"><section class="sitemap"><a href="/" class="nav-home"><img src="/img/docusaurus_monochrome.svg" alt="Docusaurus" width="66" height="58"/></a><div><h5>Docs</h5><a href="
|
||||
/docs/en/installation.html">Getting Started</a><a href="
|
||||
/docs/en/versioning.html">Versioning</a><a href="
|
||||
/docs/en/translation.html">Localization</a><a href="
|
||||
|
|
94
docs/en/next/installation/index.html
Normal file
94
docs/en/next/installation/index.html
Normal file
|
@ -0,0 +1,94 @@
|
|||
<!DOCTYPE html><html lang="en"><head><meta charSet="utf-8"/><meta http-equiv="X-UA-Compatible" content="IE=edge"/><title>Installation · Docusaurus</title><meta name="viewport" content="width=device-width"/><meta name="generator" content="Docusaurus"/><meta property="og:title" content="Installation · Docusaurus"/><meta property="og:type" content="website"/><meta property="og:url" content="https://docusaurus.io/index.html"/><meta property="og:description" content="Docusaurus was designed from the ground up to be easily installed and used to get your website up and running quickly. To install Docusaurus, we have created an easy script that will get all of the infrastructure set up for you:"/><meta property="og:image" content="https://docusaurus.io/img/docusaurus.png"/><meta name="twitter:card" content="summary"/><meta name="twitter:image" content="https://docusaurus.io/img/docusaurus.png"/><link rel="shortcut icon" href="/img/docusaurus.ico"/><link rel="stylesheet" href="https://cdn.jsdelivr.net/docsearch.js/1/docsearch.min.css"/><link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/highlight.js/9.12.0/styles/atom-one-dark.min.css"/><link rel="alternate" type="application/atom+xml" href="https://docusaurus.io/blog/atom.xml" title="Docusaurus Blog ATOM Feed"/><link rel="alternate" type="application/rss+xml" href="https://docusaurus.io/blog/feed.xml" title="Docusaurus Blog RSS Feed"/><script>
|
||||
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
|
||||
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
|
||||
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
|
||||
})(window,document,'script','https://www.google-analytics.com/analytics.js','ga');
|
||||
|
||||
ga('create', 'UA-44373548-31', 'auto');
|
||||
ga('send', 'pageview');
|
||||
</script><link rel="stylesheet" href="/css/code-blocks-buttons.css"/><script type="text/javascript" src="https://buttons.github.io/buttons.js"></script><script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/clipboard.js/2.0.0/clipboard.min.js"></script><script type="text/javascript" src="/js/code-blocks-buttons.js"></script><script src="https://unpkg.com/vanilla-back-to-top@7.1.14/dist/vanilla-back-to-top.min.js"></script><script>
|
||||
document.addEventListener("DOMContentLoaded", function(){
|
||||
addBackToTop(
|
||||
{"zIndex":100}
|
||||
)
|
||||
});
|
||||
</script><link rel="stylesheet" href="/css/main.css"/></head><body class="sideNavVisible doc separateOnPageNav"><div class="fixedHeaderContainer"><div class="headerWrapper wrapper"><header><a href="/en"><img class="logo" src="/img/docusaurus.svg" alt="Docusaurus"/><h2 class="headerTitleWithLogo">Docusaurus</h2></a><a href="/en/versions.html"><h3>next</h3></a><div class="navigationWrapper navigationSlider"><nav class="slidingNav"><ul class="nav-site nav-site-internal"><li class="siteNavGroupActive siteNavItemActive"><a href="/docs/en/next/installation" target="_self">Docs</a></li><li class=""><a href="/en/help" target="_self">Help</a></li><li class=""><a href="/en/users" target="_self">Users</a></li><li class=""><a href="/en/about-slash" target="_self">About /</a></li><li class=""><a href="/blog" target="_self">Blog</a></li><li class=""><a href="https://github.com/facebook/docusaurus" target="_self">GitHub</a></li><span><li><a id="languages-menu" href="#"><img class="languages-icon" src="/img/language.svg"/>English</a><div id="languages-dropdown" class="hide"><ul id="languages-dropdown-items"><li><a href="/es-ES">Español</a></li><li><a href="/ro">Română</a></li><li><a href="/tr">Türkçe</a></li><li><a href="/zh-CN">简体中文</a></li><li><a href="https://crowdin.com/project/docusaurus" target="_blank" rel="noreferrer noopener">Help Translate</a></li></ul></div></li><script>
|
||||
const languagesMenuItem = document.getElementById("languages-menu");
|
||||
const languagesDropDown = document.getElementById("languages-dropdown");
|
||||
languagesMenuItem.addEventListener("click", function(){
|
||||
if(languagesDropDown.className == "hide") {
|
||||
languagesDropDown.className = "visible";
|
||||
} else {
|
||||
languagesDropDown.className = "hide";
|
||||
}
|
||||
});
|
||||
</script></span><li class="navSearchWrapper reactNavSearchWrapper"><input type="text" id="search_input_react" placeholder="Search" title="Search"/></li></ul></nav></div></header></div></div><div class="navPusher"><div class="docMainWrapper wrapper"><div class="container docsNavContainer" id="docsNav"><nav class="toc"><div class="toggleNav"><section class="navWrapper wrapper"><div class="navBreadcrumb wrapper"><div class="navToggle" id="navToggler"><i></i></div><h2><i>›</i><span>Getting Started</span></h2></div><div class="navGroups"><div class="navGroup navGroupActive"><h3>Getting Started</h3><ul><li class="navListItem navListItemActive"><a class="navItem navItemActive" href="/docs/en/next/installation">Installation</a></li><li class="navListItem"><a class="navItem" href="/docs/en/next/site-preparation">Site Preparation</a></li><li class="navListItem"><a class="navItem" href="/docs/en/next/site-creation">Creating your site</a></li><li class="navListItem"><a class="navItem" href="/docs/en/next/publishing">Publishing your site</a></li></ul></div><div class="navGroup navGroupActive"><h3>Guides</h3><ul><li class="navListItem"><a class="navItem" href="/docs/en/next/blog">Adding a Blog</a></li><li class="navListItem"><a class="navItem" href="/docs/en/next/custom-pages">Custom Pages</a></li><li class="navListItem"><a class="navItem" href="/docs/en/next/search">Enabling Search</a></li><li class="navListItem"><a class="navItem" href="/docs/en/next/navigation">Navigation and Sidebars</a></li><li class="navListItem"><a class="navItem" href="/docs/en/next/translation">Translations & Localization</a></li><li class="navListItem"><a class="navItem" href="/docs/en/next/versioning">Versioning</a></li></ul></div><div class="navGroup navGroupActive"><h3>API</h3><ul><li class="navListItem"><a class="navItem" href="/docs/en/next/commands">CLI Commands</a></li><li class="navListItem"><a class="navItem" href="/docs/en/next/doc-markdown">Markdown Features</a></li><li class="navListItem"><a class="navItem" href="/docs/en/next/api-pages">Pages and Styles</a></li><li class="navListItem"><a class="navItem" href="/docs/en/next/site-config">siteConfig.js</a></li></ul></div></div></section></div><script>
|
||||
var toggler = document.getElementById('navToggler');
|
||||
var nav = document.getElementById('docsNav');
|
||||
toggler.onclick = function() {
|
||||
nav.classList.toggle('docsSliderActive');
|
||||
};
|
||||
</script></nav></div><div class="container mainContainer"><div class="wrapper"><div class="post"><header class="postHeader"><a class="edit-page-link button" href="https://github.com/facebook/docusaurus/edit/master/docs/getting-started-installation.md" target="_blank" rel="noreferrer noopener">Edit</a><h1>Installation</h1></header><article><div><span><p>Docusaurus was designed from the ground up to be easily installed and used to get your website up and running quickly. To install Docusaurus, we have created an easy script that will get all of the infrastructure set up for you:</p>
|
||||
<ol>
|
||||
<li><p>Ensure you have the latest version of <a href="https://nodejs.org/en/download/">Node</a> installed. We also recommend you install <a href="https://yarnpkg.com/en/docs/install">Yarn</a> as well.</p>
|
||||
<blockquote>
|
||||
<p>While we recommend Node 8.x or greater, your Node version must at least 6.x.</p>
|
||||
</blockquote></li>
|
||||
<li><p>Go into the root of your GitHub repo directory where you will be creating the docs.</p></li>
|
||||
<li><p><code>npx docusaurus-init</code></p>
|
||||
<blockquote>
|
||||
<p>If you don't have Node 8.2+ or if you prefer to install Docusaurus globally, run <code>yarn global add docusaurus-init</code> or <code>npm install --global docusaurus-init</code>. After that, run <code>docusaurus-init</code>.</p>
|
||||
</blockquote></li>
|
||||
</ol>
|
||||
<p>After Docusaurus is installed, moving forward, you can check your current version of Docusaurus by going into the <code>website</code> directory and typing <code>yarn outdated docusaurus</code> or <code>npm outdated docusaurus</code>. You can update to the <a href="https://www.npmjs.com/package/docusaurus">latest version</a> of Docusaurus by typing <code>yarn upgrade docusaurus --latest</code> or <code>npm update docusaurus</code>.</p>
|
||||
<h2><a class="anchor" aria-hidden="true" id="verifying-installation"></a><a href="#verifying-installation" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Verifying Installation</h2>
|
||||
<p>Along with previously existing files and directories, your root directory will now contain a structure similar to:</p>
|
||||
<pre><code class="hljs css bash">root-directory
|
||||
├── docs-examples-from-docusaurus
|
||||
│ ├── doc1.md
|
||||
│ ├── doc2.md
|
||||
│ ├── doc3.md
|
||||
│ ├── exampledoc4.md
|
||||
│ └── exampledoc5.md
|
||||
└── website
|
||||
├── blog-examples-from-docusaurus
|
||||
│ ├── 2016-03-11-blog-post.md
|
||||
│ ├── 2017-04-10-blog-post-two.md
|
||||
│ ├── 2017-09-25-testing-rss.md
|
||||
│ ├── 2017-09-26-adding-rss.md
|
||||
│ └── 2017-10-24-new-version-1.0.0.md
|
||||
├── core
|
||||
│ └── Footer.js
|
||||
├── package.json
|
||||
├── pages
|
||||
├── sidebars.json
|
||||
├── siteConfig.js
|
||||
└── static
|
||||
</code></pre>
|
||||
<p>Running the Docusaurus initialization script, <code>docusaurus-init</code>, produces a runnable, example website to base your site upon.</p>
|
||||
<ol>
|
||||
<li>In your root, rename <code>docs-examples-from-docusaurus</code> to <code>docs</code>.</li>
|
||||
<li><code>cd website</code></li>
|
||||
<li>Rename <code>blog-examples-from-docusaurus</code> to <code>blog</code>.</li>
|
||||
<li>Run the local webserver via <code>yarn start</code> or <code>npm start</code>.</li>
|
||||
<li>Load the example site at <a href="http://localhost:3000">http://localhost:3000</a>. You should see the example site loaded in your web browser.</li>
|
||||
</ol>
|
||||
<p><img src="/img/getting-started-preparation-verify.png" alt=""></p>
|
||||
<h3><a class="anchor" aria-hidden="true" id="launching-the-server-behind-a-proxy"></a><a href="#launching-the-server-behind-a-proxy" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Launching the server behind a proxy</h3>
|
||||
<p>If you are behind a corporate proxy, you need to disable it for the development server requests. It can be done using the <code>NO_PROXY</code> environment variable.</p>
|
||||
<pre><code class="hljs css sh">SET NO_PROXY=localhost
|
||||
yarn start (or npm run start)
|
||||
</code></pre>
|
||||
</span></div></article></div><div class="docs-prevnext"><a class="docs-next button" href="site-preparation">Site Preparation →</a></div></div></div><nav class="onPageNav"><ul class="toc-headings"><li><a href="#verifying-installation">Verifying Installation</a><ul class="toc-headings"><li><a href="#launching-the-server-behind-a-proxy">Launching the server behind a proxy</a></li></ul></li></ul></nav></div><footer class="nav-footer" id="footer"><section class="sitemap"><a href="/" class="nav-home"><img src="/img/docusaurus_monochrome.svg" alt="Docusaurus" width="66" height="58"/></a><div><h5>Docs</h5><a href="
|
||||
/docs/en/installation.html">Getting Started</a><a href="
|
||||
/docs/en/versioning.html">Versioning</a><a href="
|
||||
/docs/en/translation.html">Localization</a><a href="
|
||||
/docs/en/search.html">Adding Search</a></div><div><h5>Community</h5><a href="/en/users.html">User Showcase</a></div><div><h5>More</h5><div class="social"><a class="github-button" href="https://github.com/facebook/Docusaurus" data-count-href="/facebook/Docusaurus/stargazers" data-show-count="true" data-count-aria-label="# stargazers on GitHub" aria-label="Star this project on GitHub">Docusaurus</a></div><div class="social"><a href="https://twitter.com/docusaurus" class="twitter-follow-button">Follow @docusaurus</a></div><div class="social"><div class="fb-like" data-href="https://docusaurus.io" data-layout="standard" data-share="true" data-width="225" data-show-faces="false"></div></div></div></section><a href="https://code.facebook.com/projects/" target="_blank" rel="noreferrer noopener" class="fbOpenSource"><img src="/img/oss_logo.png" alt="Facebook Open Source" width="170" height="45"/></a><section class="copyright"><span>Copyright © 2018 Facebook Inc.</span></section></footer></div><script type="text/javascript" src="https://cdn.jsdelivr.net/docsearch.js/1/docsearch.min.js"></script><script>window.fbAsyncInit = function() {FB.init({appId:'199138890728411',xfbml:true,version:'v2.7'});};(function(d, s, id){var js, fjs = d.getElementsByTagName(s)[0];if (d.getElementById(id)) {return;}js = d.createElement(s); js.id = id;js.src = '//connect.facebook.net/en_US/sdk.js';fjs.parentNode.insertBefore(js, fjs);}(document, 'script','facebook-jssdk'));
|
||||
</script><script>window.twttr=(function(d,s, id){var js,fjs=d.getElementsByTagName(s)[0],t=window.twttr||{};if(d.getElementById(id))return t;js=d.createElement(s);js.id=id;js.src='https://platform.twitter.com/widgets.js';fjs.parentNode.insertBefore(js, fjs);t._e = [];t.ready = function(f) {t._e.push(f);};return t;}(document, 'script', 'twitter-wjs'));</script><script>
|
||||
var search = docsearch({
|
||||
|
||||
apiKey: '3eb9507824b8be89e7a199ecaa1a9d2c',
|
||||
indexName: 'docusaurus',
|
||||
inputSelector: '#search_input_react'
|
||||
});
|
||||
</script></body></html>
|
|
@ -12,7 +12,7 @@
|
|||
{"zIndex":100}
|
||||
)
|
||||
});
|
||||
</script><link rel="stylesheet" href="/css/main.css"/></head><body class="sideNavVisible doc separateOnPageNav"><div class="fixedHeaderContainer"><div class="headerWrapper wrapper"><header><a href="/en"><img class="logo" src="/img/docusaurus.svg" alt="Docusaurus"/><h2 class="headerTitleWithLogo">Docusaurus</h2></a><a href="/en/versions.html"><h3>next</h3></a><div class="navigationWrapper navigationSlider"><nav class="slidingNav"><ul class="nav-site nav-site-internal"><li class="siteNavGroupActive"><a href="/docs/en/next/installation.html" target="_self">Docs</a></li><li class=""><a href="/en/help.html" target="_self">Help</a></li><li class=""><a href="/en/users.html" target="_self">Users</a></li><li class=""><a href="/en/about-slash.html" target="_self">About /</a></li><li class=""><a href="/blog" target="_self">Blog</a></li><li class=""><a href="https://github.com/facebook/docusaurus" target="_self">GitHub</a></li><span><li><a id="languages-menu" href="#"><img class="languages-icon" src="/img/language.svg"/>English</a><div id="languages-dropdown" class="hide"><ul id="languages-dropdown-items"><li><a href="/es-ES">Español</a></li><li><a href="/ro">Română</a></li><li><a href="/tr">Türkçe</a></li><li><a href="/zh-CN">简体中文</a></li><li><a href="https://crowdin.com/project/docusaurus" target="_blank" rel="noreferrer noopener">Help Translate</a></li></ul></div></li><script>
|
||||
</script><link rel="stylesheet" href="/css/main.css"/></head><body class="sideNavVisible doc separateOnPageNav"><div class="fixedHeaderContainer"><div class="headerWrapper wrapper"><header><a href="/en"><img class="logo" src="/img/docusaurus.svg" alt="Docusaurus"/><h2 class="headerTitleWithLogo">Docusaurus</h2></a><a href="/en/versions.html"><h3>next</h3></a><div class="navigationWrapper navigationSlider"><nav class="slidingNav"><ul class="nav-site nav-site-internal"><li class="siteNavGroupActive"><a href="/docs/en/next/installation" target="_self">Docs</a></li><li class=""><a href="/en/help" target="_self">Help</a></li><li class=""><a href="/en/users" target="_self">Users</a></li><li class=""><a href="/en/about-slash" target="_self">About /</a></li><li class=""><a href="/blog" target="_self">Blog</a></li><li class=""><a href="https://github.com/facebook/docusaurus" target="_self">GitHub</a></li><span><li><a id="languages-menu" href="#"><img class="languages-icon" src="/img/language.svg"/>English</a><div id="languages-dropdown" class="hide"><ul id="languages-dropdown-items"><li><a href="/es-ES">Español</a></li><li><a href="/ro">Română</a></li><li><a href="/tr">Türkçe</a></li><li><a href="/zh-CN">简体中文</a></li><li><a href="https://crowdin.com/project/docusaurus" target="_blank" rel="noreferrer noopener">Help Translate</a></li></ul></div></li><script>
|
||||
const languagesMenuItem = document.getElementById("languages-menu");
|
||||
const languagesDropDown = document.getElementById("languages-dropdown");
|
||||
languagesMenuItem.addEventListener("click", function(){
|
||||
|
@ -22,7 +22,7 @@
|
|||
languagesDropDown.className = "hide";
|
||||
}
|
||||
});
|
||||
</script></span><li class="navSearchWrapper reactNavSearchWrapper"><input type="text" id="search_input_react" placeholder="Search" title="Search"/></li></ul></nav></div></header></div></div><div class="navPusher"><div class="docMainWrapper wrapper"><div class="container docsNavContainer" id="docsNav"><nav class="toc"><div class="toggleNav"><section class="navWrapper wrapper"><div class="navBreadcrumb wrapper"><div class="navToggle" id="navToggler"><i></i></div><h2><i>›</i><span>Guides</span></h2></div><div class="navGroups"><div class="navGroup navGroupActive"><h3>Getting Started</h3><ul><li class="navListItem"><a class="navItem" href="/docs/en/next/installation.html">Installation</a></li><li class="navListItem"><a class="navItem" href="/docs/en/next/site-preparation.html">Site Preparation</a></li><li class="navListItem"><a class="navItem" href="/docs/en/next/site-creation.html">Creating your site</a></li><li class="navListItem"><a class="navItem" href="/docs/en/next/publishing.html">Publishing your site</a></li></ul></div><div class="navGroup navGroupActive"><h3>Guides</h3><ul><li class="navListItem"><a class="navItem" href="/docs/en/next/blog.html">Adding a Blog</a></li><li class="navListItem"><a class="navItem" href="/docs/en/next/custom-pages.html">Custom Pages</a></li><li class="navListItem"><a class="navItem" href="/docs/en/next/search.html">Enabling Search</a></li><li class="navListItem navListItemActive"><a class="navItem navItemActive" href="/docs/en/next/navigation.html">Navigation and Sidebars</a></li><li class="navListItem"><a class="navItem" href="/docs/en/next/translation.html">Translations & Localization</a></li><li class="navListItem"><a class="navItem" href="/docs/en/next/versioning.html">Versioning</a></li></ul></div><div class="navGroup navGroupActive"><h3>API</h3><ul><li class="navListItem"><a class="navItem" href="/docs/en/next/commands.html">CLI Commands</a></li><li class="navListItem"><a class="navItem" href="/docs/en/next/doc-markdown.html">Markdown Features</a></li><li class="navListItem"><a class="navItem" href="/docs/en/next/api-pages.html">Pages and Styles</a></li><li class="navListItem"><a class="navItem" href="/docs/en/next/site-config.html">siteConfig.js</a></li></ul></div></div></section></div><script>
|
||||
</script></span><li class="navSearchWrapper reactNavSearchWrapper"><input type="text" id="search_input_react" placeholder="Search" title="Search"/></li></ul></nav></div></header></div></div><div class="navPusher"><div class="docMainWrapper wrapper"><div class="container docsNavContainer" id="docsNav"><nav class="toc"><div class="toggleNav"><section class="navWrapper wrapper"><div class="navBreadcrumb wrapper"><div class="navToggle" id="navToggler"><i></i></div><h2><i>›</i><span>Guides</span></h2></div><div class="navGroups"><div class="navGroup navGroupActive"><h3>Getting Started</h3><ul><li class="navListItem"><a class="navItem" href="/docs/en/next/installation">Installation</a></li><li class="navListItem"><a class="navItem" href="/docs/en/next/site-preparation">Site Preparation</a></li><li class="navListItem"><a class="navItem" href="/docs/en/next/site-creation">Creating your site</a></li><li class="navListItem"><a class="navItem" href="/docs/en/next/publishing">Publishing your site</a></li></ul></div><div class="navGroup navGroupActive"><h3>Guides</h3><ul><li class="navListItem"><a class="navItem" href="/docs/en/next/blog">Adding a Blog</a></li><li class="navListItem"><a class="navItem" href="/docs/en/next/custom-pages">Custom Pages</a></li><li class="navListItem"><a class="navItem" href="/docs/en/next/search">Enabling Search</a></li><li class="navListItem navListItemActive"><a class="navItem navItemActive" href="/docs/en/next/navigation">Navigation and Sidebars</a></li><li class="navListItem"><a class="navItem" href="/docs/en/next/translation">Translations & Localization</a></li><li class="navListItem"><a class="navItem" href="/docs/en/next/versioning">Versioning</a></li></ul></div><div class="navGroup navGroupActive"><h3>API</h3><ul><li class="navListItem"><a class="navItem" href="/docs/en/next/commands">CLI Commands</a></li><li class="navListItem"><a class="navItem" href="/docs/en/next/doc-markdown">Markdown Features</a></li><li class="navListItem"><a class="navItem" href="/docs/en/next/api-pages">Pages and Styles</a></li><li class="navListItem"><a class="navItem" href="/docs/en/next/site-config">siteConfig.js</a></li></ul></div></div></section></div><script>
|
||||
var toggler = document.getElementById('navToggler');
|
||||
var nav = document.getElementById('docsNav');
|
||||
toggler.onclick = function() {
|
||||
|
@ -172,14 +172,14 @@
|
|||
</ul>
|
||||
<p>These are two separate class names so you can have the active styles applied to either exact matches only or a bit more broadly for docs that belong together. If you don't want to make this distinction you can add both classes to the same CSS rule.</p>
|
||||
<h2><a class="anchor" aria-hidden="true" id="secondary-on-page-navigation"></a><a href="#secondary-on-page-navigation" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Secondary On-Page Navigation</h2>
|
||||
<p>We support secondary on-page navigation so you can more easily see the topics associated with a given document. To enable this feature, you need to add the <code>onPageNav</code> site configuration <a href="/docs/en/next/site-config.html#optional-fields">option</a> to your <code>siteConfig.js</code>.</p>
|
||||
<p>We support secondary on-page navigation so you can more easily see the topics associated with a given document. To enable this feature, you need to add the <code>onPageNav</code> site configuration <a href="/docs/en/next/site-config#optional-fields">option</a> to your <code>siteConfig.js</code>.</p>
|
||||
<pre><code class="hljs css js">{
|
||||
<span class="hljs-attr">onPageNav</span>: <span class="hljs-string">'separate'</span>,
|
||||
...
|
||||
}
|
||||
</code></pre>
|
||||
<p>Currently, <code>'separate'</code> is the only option available for this field. This provides a separate navigation on the right side of the page.</p>
|
||||
</span></div></article></div><div class="docs-prevnext"><a class="docs-prev button" href="search.html">← Enabling Search</a><a class="docs-next button" href="translation.html">Translations & Localization →</a></div></div></div><nav class="onPageNav"><ul class="toc-headings"><li><a href="#referencing-site-documents">Referencing Site Documents</a></li><li><a href="#how-documents-are-linked">How Documents are Linked</a></li><li><a href="#adding-documents-to-a-sidebar">Adding Documents to a Sidebar</a><ul class="toc-headings"><li><a href="#adding-new-sidebars">Adding New Sidebars</a></li></ul></li><li><a href="#additions-to-the-site-navigation-bar">Additions to the Site Navigation Bar</a><ul class="toc-headings"><li><a href="#adding-documents">Adding Documents</a></li><li><a href="#adding-custom-pages">Adding Custom Pages</a></li><li><a href="#adding-external-links">Adding External Links</a></li></ul></li><li><a href="#site-navigation-bar-positioning">Site Navigation Bar Positioning</a><ul class="toc-headings"><li><a href="#search">Search</a></li><li><a href="#languages-dropdown">Languages Dropdown</a></li></ul></li><li><a href="#active-links-in-site-navigation-bar">Active Links In Site Navigation Bar</a></li><li><a href="#secondary-on-page-navigation">Secondary On-Page Navigation</a></li></ul></nav></div><footer class="nav-footer" id="footer"><section class="sitemap"><a href="/" class="nav-home"><img src="/img/docusaurus_monochrome.svg" alt="Docusaurus" width="66" height="58"/></a><div><h5>Docs</h5><a href="
|
||||
</span></div></article></div><div class="docs-prevnext"><a class="docs-prev button" href="search">← Enabling Search</a><a class="docs-next button" href="translation">Translations & Localization →</a></div></div></div><nav class="onPageNav"><ul class="toc-headings"><li><a href="#referencing-site-documents">Referencing Site Documents</a></li><li><a href="#how-documents-are-linked">How Documents are Linked</a></li><li><a href="#adding-documents-to-a-sidebar">Adding Documents to a Sidebar</a><ul class="toc-headings"><li><a href="#adding-new-sidebars">Adding New Sidebars</a></li></ul></li><li><a href="#additions-to-the-site-navigation-bar">Additions to the Site Navigation Bar</a><ul class="toc-headings"><li><a href="#adding-documents">Adding Documents</a></li><li><a href="#adding-custom-pages">Adding Custom Pages</a></li><li><a href="#adding-external-links">Adding External Links</a></li></ul></li><li><a href="#site-navigation-bar-positioning">Site Navigation Bar Positioning</a><ul class="toc-headings"><li><a href="#search">Search</a></li><li><a href="#languages-dropdown">Languages Dropdown</a></li></ul></li><li><a href="#active-links-in-site-navigation-bar">Active Links In Site Navigation Bar</a></li><li><a href="#secondary-on-page-navigation">Secondary On-Page Navigation</a></li></ul></nav></div><footer class="nav-footer" id="footer"><section class="sitemap"><a href="/" class="nav-home"><img src="/img/docusaurus_monochrome.svg" alt="Docusaurus" width="66" height="58"/></a><div><h5>Docs</h5><a href="
|
||||
/docs/en/installation.html">Getting Started</a><a href="
|
||||
/docs/en/versioning.html">Versioning</a><a href="
|
||||
/docs/en/translation.html">Localization</a><a href="
|
||||
|
|
194
docs/en/next/navigation/index.html
Normal file
194
docs/en/next/navigation/index.html
Normal file
|
@ -0,0 +1,194 @@
|
|||
<!DOCTYPE html><html lang="en"><head><meta charSet="utf-8"/><meta http-equiv="X-UA-Compatible" content="IE=edge"/><title>Navigation and Sidebars · Docusaurus</title><meta name="viewport" content="width=device-width"/><meta name="generator" content="Docusaurus"/><meta property="og:title" content="Navigation and Sidebars · Docusaurus"/><meta property="og:type" content="website"/><meta property="og:url" content="https://docusaurus.io/index.html"/><meta property="og:description" content="## Referencing Site Documents"/><meta property="og:image" content="https://docusaurus.io/img/docusaurus.png"/><meta name="twitter:card" content="summary"/><meta name="twitter:image" content="https://docusaurus.io/img/docusaurus.png"/><link rel="shortcut icon" href="/img/docusaurus.ico"/><link rel="stylesheet" href="https://cdn.jsdelivr.net/docsearch.js/1/docsearch.min.css"/><link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/highlight.js/9.12.0/styles/atom-one-dark.min.css"/><link rel="alternate" type="application/atom+xml" href="https://docusaurus.io/blog/atom.xml" title="Docusaurus Blog ATOM Feed"/><link rel="alternate" type="application/rss+xml" href="https://docusaurus.io/blog/feed.xml" title="Docusaurus Blog RSS Feed"/><script>
|
||||
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
|
||||
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
|
||||
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
|
||||
})(window,document,'script','https://www.google-analytics.com/analytics.js','ga');
|
||||
|
||||
ga('create', 'UA-44373548-31', 'auto');
|
||||
ga('send', 'pageview');
|
||||
</script><link rel="stylesheet" href="/css/code-blocks-buttons.css"/><script type="text/javascript" src="https://buttons.github.io/buttons.js"></script><script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/clipboard.js/2.0.0/clipboard.min.js"></script><script type="text/javascript" src="/js/code-blocks-buttons.js"></script><script src="https://unpkg.com/vanilla-back-to-top@7.1.14/dist/vanilla-back-to-top.min.js"></script><script>
|
||||
document.addEventListener("DOMContentLoaded", function(){
|
||||
addBackToTop(
|
||||
{"zIndex":100}
|
||||
)
|
||||
});
|
||||
</script><link rel="stylesheet" href="/css/main.css"/></head><body class="sideNavVisible doc separateOnPageNav"><div class="fixedHeaderContainer"><div class="headerWrapper wrapper"><header><a href="/en"><img class="logo" src="/img/docusaurus.svg" alt="Docusaurus"/><h2 class="headerTitleWithLogo">Docusaurus</h2></a><a href="/en/versions.html"><h3>next</h3></a><div class="navigationWrapper navigationSlider"><nav class="slidingNav"><ul class="nav-site nav-site-internal"><li class="siteNavGroupActive"><a href="/docs/en/next/installation" target="_self">Docs</a></li><li class=""><a href="/en/help" target="_self">Help</a></li><li class=""><a href="/en/users" target="_self">Users</a></li><li class=""><a href="/en/about-slash" target="_self">About /</a></li><li class=""><a href="/blog" target="_self">Blog</a></li><li class=""><a href="https://github.com/facebook/docusaurus" target="_self">GitHub</a></li><span><li><a id="languages-menu" href="#"><img class="languages-icon" src="/img/language.svg"/>English</a><div id="languages-dropdown" class="hide"><ul id="languages-dropdown-items"><li><a href="/es-ES">Español</a></li><li><a href="/ro">Română</a></li><li><a href="/tr">Türkçe</a></li><li><a href="/zh-CN">简体中文</a></li><li><a href="https://crowdin.com/project/docusaurus" target="_blank" rel="noreferrer noopener">Help Translate</a></li></ul></div></li><script>
|
||||
const languagesMenuItem = document.getElementById("languages-menu");
|
||||
const languagesDropDown = document.getElementById("languages-dropdown");
|
||||
languagesMenuItem.addEventListener("click", function(){
|
||||
if(languagesDropDown.className == "hide") {
|
||||
languagesDropDown.className = "visible";
|
||||
} else {
|
||||
languagesDropDown.className = "hide";
|
||||
}
|
||||
});
|
||||
</script></span><li class="navSearchWrapper reactNavSearchWrapper"><input type="text" id="search_input_react" placeholder="Search" title="Search"/></li></ul></nav></div></header></div></div><div class="navPusher"><div class="docMainWrapper wrapper"><div class="container docsNavContainer" id="docsNav"><nav class="toc"><div class="toggleNav"><section class="navWrapper wrapper"><div class="navBreadcrumb wrapper"><div class="navToggle" id="navToggler"><i></i></div><h2><i>›</i><span>Guides</span></h2></div><div class="navGroups"><div class="navGroup navGroupActive"><h3>Getting Started</h3><ul><li class="navListItem"><a class="navItem" href="/docs/en/next/installation">Installation</a></li><li class="navListItem"><a class="navItem" href="/docs/en/next/site-preparation">Site Preparation</a></li><li class="navListItem"><a class="navItem" href="/docs/en/next/site-creation">Creating your site</a></li><li class="navListItem"><a class="navItem" href="/docs/en/next/publishing">Publishing your site</a></li></ul></div><div class="navGroup navGroupActive"><h3>Guides</h3><ul><li class="navListItem"><a class="navItem" href="/docs/en/next/blog">Adding a Blog</a></li><li class="navListItem"><a class="navItem" href="/docs/en/next/custom-pages">Custom Pages</a></li><li class="navListItem"><a class="navItem" href="/docs/en/next/search">Enabling Search</a></li><li class="navListItem navListItemActive"><a class="navItem navItemActive" href="/docs/en/next/navigation">Navigation and Sidebars</a></li><li class="navListItem"><a class="navItem" href="/docs/en/next/translation">Translations & Localization</a></li><li class="navListItem"><a class="navItem" href="/docs/en/next/versioning">Versioning</a></li></ul></div><div class="navGroup navGroupActive"><h3>API</h3><ul><li class="navListItem"><a class="navItem" href="/docs/en/next/commands">CLI Commands</a></li><li class="navListItem"><a class="navItem" href="/docs/en/next/doc-markdown">Markdown Features</a></li><li class="navListItem"><a class="navItem" href="/docs/en/next/api-pages">Pages and Styles</a></li><li class="navListItem"><a class="navItem" href="/docs/en/next/site-config">siteConfig.js</a></li></ul></div></div></section></div><script>
|
||||
var toggler = document.getElementById('navToggler');
|
||||
var nav = document.getElementById('docsNav');
|
||||
toggler.onclick = function() {
|
||||
nav.classList.toggle('docsSliderActive');
|
||||
};
|
||||
</script></nav></div><div class="container mainContainer"><div class="wrapper"><div class="post"><header class="postHeader"><a class="edit-page-link button" href="https://github.com/facebook/docusaurus/edit/master/docs/guides-navigation.md" target="_blank" rel="noreferrer noopener">Edit</a><h1>Navigation and Sidebars</h1></header><article><div><span><h2><a class="anchor" aria-hidden="true" id="referencing-site-documents"></a><a href="#referencing-site-documents" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Referencing Site Documents</h2>
|
||||
<p>If you want to reference another document in your <code>docs</code> folder (or the location you set via the <a href="https://docusaurus.io/docs/en/site-config.html#optional-fields">optional <code>customDocsPath</code></a> path site configuration option), then you just use the name of the document you want to reference.</p>
|
||||
<p>For example, if you are in <code>doc2.md</code> and you want to reference <code>doc1.md</code>:</p>
|
||||
<pre><code class="hljs css md">I am referencing a [<span class="hljs-string">document</span>](<span class="hljs-link">doc1.md</span>).
|
||||
</code></pre>
|
||||
<blockquote>
|
||||
<p>Docusaurus currently does not support documents in nested folders; only in a flat folder structure. We are looking into adding support for nested folders.</p>
|
||||
</blockquote>
|
||||
<h2><a class="anchor" aria-hidden="true" id="how-documents-are-linked"></a><a href="#how-documents-are-linked" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>How Documents are Linked</h2>
|
||||
<p>New markdown files within <code>docs</code> will show up as pages on the website. Links to those documents are created first by using the <code>id</code> in the header of each document. If there is no <code>id</code> field, then the name of the file will serve as the link name.</p>
|
||||
<p>For example, creating an empty file such as <code>docs/getting-started.md</code> will enable the new page URL as <code>/docs/getting-started.html</code>.</p>
|
||||
<p>Suppose you add this to your document:</p>
|
||||
<pre><code class="hljs css yaml"><span class="hljs-meta">---</span>
|
||||
<span class="hljs-attr">id:</span> <span class="hljs-string">intro</span>
|
||||
<span class="hljs-attr">title:</span> <span class="hljs-string">Getting</span> <span class="hljs-string">Started</span>
|
||||
<span class="hljs-meta">---</span>
|
||||
|
||||
<span class="hljs-string">My</span> <span class="hljs-string">new</span> <span class="hljs-string">content</span> <span class="hljs-string">here..</span>
|
||||
</code></pre>
|
||||
<p>If you set the <code>id</code> field in the markdown header of the file, the doc will then be accessed from a URL of the form <code>/docs/intro.html</code>.</p>
|
||||
<blockquote>
|
||||
<p>You need an <code>id</code> field to be able to add the document to the sidebar.</p>
|
||||
</blockquote>
|
||||
<h2><a class="anchor" aria-hidden="true" id="adding-documents-to-a-sidebar"></a><a href="#adding-documents-to-a-sidebar" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Adding Documents to a Sidebar</h2>
|
||||
<p>Many times, you will want to add a document to a sidebar that will be associated with one of the headers in the top navigation bar of the website. The most common sidebar, and the one that comes installed when Docusaurus is initialized, is the <code>docs</code> sidebar.</p>
|
||||
<blockquote>
|
||||
<p>"docs" is just a name. It has no inherit meaning. You can change it as you wish.</p>
|
||||
</blockquote>
|
||||
<p>You configure the contents of the sidebar, and the order of its documents, in the <code>website/sidebars.json</code> file.</p>
|
||||
<blockquote>
|
||||
<p>Until you add your document to <code>website/sidebars.json</code>, they will only be accessible via a direct URL. The doc will not show up in any sidebar.</p>
|
||||
</blockquote>
|
||||
<p>Within <code>sidebars.json</code>, add the <code>id</code> you used in the document header to existing sidebar/category. In the below case, <code>docs</code> is the name of the sidebar and <code>Getting Started</code> is a category within the sidebar.</p>
|
||||
<pre><code class="hljs css js">{
|
||||
<span class="hljs-string">"docs"</span>: {
|
||||
<span class="hljs-string">"Getting Started"</span>: [
|
||||
<span class="hljs-string">"getting-started"</span>
|
||||
],
|
||||
...
|
||||
},
|
||||
...
|
||||
}
|
||||
</code></pre>
|
||||
<p>Or you can create a new category within the sidebar:</p>
|
||||
<pre><code class="hljs css js">{
|
||||
<span class="hljs-string">"docs"</span>: {
|
||||
<span class="hljs-string">"My New Sidebar Category"</span>: [
|
||||
<span class="hljs-string">"getting-started"</span>
|
||||
],
|
||||
...
|
||||
},
|
||||
...
|
||||
}
|
||||
</code></pre>
|
||||
<h3><a class="anchor" aria-hidden="true" id="adding-new-sidebars"></a><a href="#adding-new-sidebars" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Adding New Sidebars</h3>
|
||||
<p>You can also put a document in a new sidebar. In the following example, we are creating an <code>examples-sidebar</code> sidebar within <code>sidebars.json</code> that has a category called <code>My Example Category</code> containing a document with an <code>id</code> of <code>my-examples</code>.</p>
|
||||
<pre><code class="hljs css js">{
|
||||
<span class="hljs-string">"examples-sidebar"</span>: {
|
||||
<span class="hljs-string">"My Example Category"</span>: [
|
||||
<span class="hljs-string">"my-examples"</span>
|
||||
],
|
||||
...
|
||||
},
|
||||
...
|
||||
}
|
||||
</code></pre>
|
||||
<p>It is important to note that until you <a href="#additions-to-the-site-navigation-bar">add a document from the <code>"examples-sidebar"</code> sidebar to the nav bar</a>, it will be hidden.</p>
|
||||
<h2><a class="anchor" aria-hidden="true" id="additions-to-the-site-navigation-bar"></a><a href="#additions-to-the-site-navigation-bar" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Additions to the Site Navigation Bar</h2>
|
||||
<p>To expose sidebars, you will add clickable labels to the site navigation bar at the top of the website. You can add documents, pages and external links.</p>
|
||||
<h3><a class="anchor" aria-hidden="true" id="adding-documents"></a><a href="#adding-documents" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Adding Documents</h3>
|
||||
<p>After creating a new sidebar for the site by <a href="#adding-new-sidebars">adding</a> it to <code>sidebars.json</code>, you can expose the new sidebar from the top navigation bar by editing the <code>headerLinks</code> field of <code>siteConfig.js</code>.</p>
|
||||
<pre><code class="hljs css js">{
|
||||
<span class="hljs-attr">headerLinks</span>: [
|
||||
...
|
||||
{ <span class="hljs-attr">doc</span>: <span class="hljs-string">'my-examples'</span>, <span class="hljs-attr">label</span>: <span class="hljs-string">'Examples'</span> },
|
||||
...
|
||||
],
|
||||
...
|
||||
}
|
||||
</code></pre>
|
||||
<p>A label called <code>Examples</code> will be added to the site navigation bar and when you click on it at the top of your site, the <code>examples-sidebar</code> will be shown and the default document will be <code>my-examples</code>.</p>
|
||||
<h3><a class="anchor" aria-hidden="true" id="adding-custom-pages"></a><a href="#adding-custom-pages" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Adding Custom Pages</h3>
|
||||
<p>To add custom pages to the site navigation bar, entries can be added to the <code>headerLinks</code> of <code>siteConfig.js</code>. For example, if we have a page within <code>website/pages/help.js</code>, we can link to it by adding the following:</p>
|
||||
<pre><code class="hljs css js">{
|
||||
<span class="hljs-attr">headerLinks</span>: [
|
||||
...
|
||||
{ <span class="hljs-attr">page</span>: <span class="hljs-string">'help'</span>, <span class="hljs-attr">label</span>: <span class="hljs-string">'Help'</span> },
|
||||
...
|
||||
],
|
||||
...
|
||||
}
|
||||
</code></pre>
|
||||
<p>A label called <code>Help</code> will be added to the site navigation bar and when you click on it at the top of your site, the content from the <code>help.js</code> page will be shown.</p>
|
||||
<h3><a class="anchor" aria-hidden="true" id="adding-external-links"></a><a href="#adding-external-links" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Adding External Links</h3>
|
||||
<p>Custom links can be added to the site navigation bar with the following entry in <code>siteConfig.js</code>:</p>
|
||||
<pre><code class="hljs css js">{
|
||||
<span class="hljs-attr">headerLinks</span>: [
|
||||
...
|
||||
{ <span class="hljs-attr">href</span>: <span class="hljs-string">'https://github.com/facebook/Docusaurus'</span>, <span class="hljs-attr">label</span>: <span class="hljs-string">'GitHub'</span> },
|
||||
...
|
||||
],
|
||||
...
|
||||
}
|
||||
</code></pre>
|
||||
<p>A label called <code>GitHub</code> will be added to the site navigation bar and when you click on it at the top of your site, the content of the external link will be shown.</p>
|
||||
<blockquote>
|
||||
<p>To open external links in a new tab, provide an <code>external: true</code> flag within the header link config.</p>
|
||||
</blockquote>
|
||||
<h2><a class="anchor" aria-hidden="true" id="site-navigation-bar-positioning"></a><a href="#site-navigation-bar-positioning" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Site Navigation Bar Positioning</h2>
|
||||
<p>You have limited control where the search and languages dropdown elements are shown in the site navigation bar at the top of your website.</p>
|
||||
<h3><a class="anchor" aria-hidden="true" id="search"></a><a href="#search" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Search</h3>
|
||||
<p>If search is enabled on your site, your search bar will appear to the right of your links. If you want to put the search bar between links in the header, add a search entry in the <code>headerLinks</code> config array:</p>
|
||||
<pre><code class="hljs css js">{
|
||||
<span class="hljs-attr">headerLinks</span>: [
|
||||
{ <span class="hljs-attr">doc</span>: <span class="hljs-string">'foo'</span>, <span class="hljs-attr">label</span>: <span class="hljs-string">'Foo'</span> },
|
||||
{ <span class="hljs-attr">search</span>: <span class="hljs-literal">true</span> },
|
||||
{ <span class="hljs-attr">doc</span>: <span class="hljs-string">'bar'</span>, <span class="hljs-attr">label</span>: <span class="hljs-string">'Bar'</span> },
|
||||
],
|
||||
...
|
||||
}
|
||||
</code></pre>
|
||||
<h3><a class="anchor" aria-hidden="true" id="languages-dropdown"></a><a href="#languages-dropdown" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Languages Dropdown</h3>
|
||||
<p>If translations is enabled on your site, the language dropdown will appear to the right of your links (and to the left of the search bar, if search is enabled). If you want to put the language selection drop down between links in the header, add a languages entry in the <code>headerLinks</code> config array:</p>
|
||||
<pre><code class="hljs css js">{
|
||||
<span class="hljs-attr">headerLinks</span>: [
|
||||
{ <span class="hljs-attr">doc</span>: <span class="hljs-string">'foo'</span>, <span class="hljs-attr">label</span>: <span class="hljs-string">'Foo'</span> },
|
||||
{ <span class="hljs-attr">languages</span>: <span class="hljs-literal">true</span> },
|
||||
{ <span class="hljs-attr">doc</span>: <span class="hljs-string">'bar'</span>, <span class="hljs-attr">label</span>: <span class="hljs-string">'Bar'</span> },
|
||||
],
|
||||
...
|
||||
}
|
||||
</code></pre>
|
||||
<h2><a class="anchor" aria-hidden="true" id="active-links-in-site-navigation-bar"></a><a href="#active-links-in-site-navigation-bar" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Active Links In Site Navigation Bar</h2>
|
||||
<p>The links in the top navigation bar get <code>siteNavItemActive</code> and <code>siteNavGroupActive</code> class names to allow you to style the currently active link different from the others. <code>siteNavItemActive</code> is applied when there's an exact match between the navigation link and the currently displayed web page.</p>
|
||||
<blockquote>
|
||||
<p>This does not include links of type <code>href</code> which are meant for external links only. If you manually set an <code>href</code> in your <code>headerLinks</code> to an internal page, document, or blog post, it will not get the <code>siteNavItemActive</code> class even if that page is being displayed.</p>
|
||||
</blockquote>
|
||||
<p>The <code>siteNavGroupActive</code> class will be added to these links:</p>
|
||||
<ul>
|
||||
<li><code>doc</code> links that belong to the same sidebar as the currently displayed document</li>
|
||||
<li>The blog link when a blog post, or the blog listing page is being displayed</li>
|
||||
</ul>
|
||||
<p>These are two separate class names so you can have the active styles applied to either exact matches only or a bit more broadly for docs that belong together. If you don't want to make this distinction you can add both classes to the same CSS rule.</p>
|
||||
<h2><a class="anchor" aria-hidden="true" id="secondary-on-page-navigation"></a><a href="#secondary-on-page-navigation" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Secondary On-Page Navigation</h2>
|
||||
<p>We support secondary on-page navigation so you can more easily see the topics associated with a given document. To enable this feature, you need to add the <code>onPageNav</code> site configuration <a href="/docs/en/next/site-config#optional-fields">option</a> to your <code>siteConfig.js</code>.</p>
|
||||
<pre><code class="hljs css js">{
|
||||
<span class="hljs-attr">onPageNav</span>: <span class="hljs-string">'separate'</span>,
|
||||
...
|
||||
}
|
||||
</code></pre>
|
||||
<p>Currently, <code>'separate'</code> is the only option available for this field. This provides a separate navigation on the right side of the page.</p>
|
||||
</span></div></article></div><div class="docs-prevnext"><a class="docs-prev button" href="search">← Enabling Search</a><a class="docs-next button" href="translation">Translations & Localization →</a></div></div></div><nav class="onPageNav"><ul class="toc-headings"><li><a href="#referencing-site-documents">Referencing Site Documents</a></li><li><a href="#how-documents-are-linked">How Documents are Linked</a></li><li><a href="#adding-documents-to-a-sidebar">Adding Documents to a Sidebar</a><ul class="toc-headings"><li><a href="#adding-new-sidebars">Adding New Sidebars</a></li></ul></li><li><a href="#additions-to-the-site-navigation-bar">Additions to the Site Navigation Bar</a><ul class="toc-headings"><li><a href="#adding-documents">Adding Documents</a></li><li><a href="#adding-custom-pages">Adding Custom Pages</a></li><li><a href="#adding-external-links">Adding External Links</a></li></ul></li><li><a href="#site-navigation-bar-positioning">Site Navigation Bar Positioning</a><ul class="toc-headings"><li><a href="#search">Search</a></li><li><a href="#languages-dropdown">Languages Dropdown</a></li></ul></li><li><a href="#active-links-in-site-navigation-bar">Active Links In Site Navigation Bar</a></li><li><a href="#secondary-on-page-navigation">Secondary On-Page Navigation</a></li></ul></nav></div><footer class="nav-footer" id="footer"><section class="sitemap"><a href="/" class="nav-home"><img src="/img/docusaurus_monochrome.svg" alt="Docusaurus" width="66" height="58"/></a><div><h5>Docs</h5><a href="
|
||||
/docs/en/installation.html">Getting Started</a><a href="
|
||||
/docs/en/versioning.html">Versioning</a><a href="
|
||||
/docs/en/translation.html">Localization</a><a href="
|
||||
/docs/en/search.html">Adding Search</a></div><div><h5>Community</h5><a href="/en/users.html">User Showcase</a></div><div><h5>More</h5><div class="social"><a class="github-button" href="https://github.com/facebook/Docusaurus" data-count-href="/facebook/Docusaurus/stargazers" data-show-count="true" data-count-aria-label="# stargazers on GitHub" aria-label="Star this project on GitHub">Docusaurus</a></div><div class="social"><a href="https://twitter.com/docusaurus" class="twitter-follow-button">Follow @docusaurus</a></div><div class="social"><div class="fb-like" data-href="https://docusaurus.io" data-layout="standard" data-share="true" data-width="225" data-show-faces="false"></div></div></div></section><a href="https://code.facebook.com/projects/" target="_blank" rel="noreferrer noopener" class="fbOpenSource"><img src="/img/oss_logo.png" alt="Facebook Open Source" width="170" height="45"/></a><section class="copyright"><span>Copyright © 2018 Facebook Inc.</span></section></footer></div><script type="text/javascript" src="https://cdn.jsdelivr.net/docsearch.js/1/docsearch.min.js"></script><script>window.fbAsyncInit = function() {FB.init({appId:'199138890728411',xfbml:true,version:'v2.7'});};(function(d, s, id){var js, fjs = d.getElementsByTagName(s)[0];if (d.getElementById(id)) {return;}js = d.createElement(s); js.id = id;js.src = '//connect.facebook.net/en_US/sdk.js';fjs.parentNode.insertBefore(js, fjs);}(document, 'script','facebook-jssdk'));
|
||||
</script><script>window.twttr=(function(d,s, id){var js,fjs=d.getElementsByTagName(s)[0],t=window.twttr||{};if(d.getElementById(id))return t;js=d.createElement(s);js.id=id;js.src='https://platform.twitter.com/widgets.js';fjs.parentNode.insertBefore(js, fjs);t._e = [];t.ready = function(f) {t._e.push(f);};return t;}(document, 'script', 'twitter-wjs'));</script><script>
|
||||
var search = docsearch({
|
||||
|
||||
apiKey: '3eb9507824b8be89e7a199ecaa1a9d2c',
|
||||
indexName: 'docusaurus',
|
||||
inputSelector: '#search_input_react'
|
||||
});
|
||||
</script></body></html>
|
|
@ -1,4 +1,4 @@
|
|||
<!DOCTYPE html><html lang="en"><head><meta charSet="utf-8"/><meta http-equiv="X-UA-Compatible" content="IE=edge"/><title>Publishing your site · Docusaurus</title><meta name="viewport" content="width=device-width"/><meta name="generator" content="Docusaurus"/><meta property="og:title" content="Publishing your site · Docusaurus"/><meta property="og:type" content="website"/><meta property="og:url" content="https://docusaurus.io/index.html"/><meta property="og:description" content="You should now have a [site up and running locally](/docs/en/next/site-creation.html). Once you have [customized](/docs/en/next/site-config.html) it to your liking, it's time to publish it. Docusaurus generates a static HTML website that is ready to be served by your favorite web server or online hosting solution."/><meta property="og:image" content="https://docusaurus.io/img/docusaurus.png"/><meta name="twitter:card" content="summary"/><meta name="twitter:image" content="https://docusaurus.io/img/docusaurus.png"/><link rel="shortcut icon" href="/img/docusaurus.ico"/><link rel="stylesheet" href="https://cdn.jsdelivr.net/docsearch.js/1/docsearch.min.css"/><link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/highlight.js/9.12.0/styles/atom-one-dark.min.css"/><link rel="alternate" type="application/atom+xml" href="https://docusaurus.io/blog/atom.xml" title="Docusaurus Blog ATOM Feed"/><link rel="alternate" type="application/rss+xml" href="https://docusaurus.io/blog/feed.xml" title="Docusaurus Blog RSS Feed"/><script>
|
||||
<!DOCTYPE html><html lang="en"><head><meta charSet="utf-8"/><meta http-equiv="X-UA-Compatible" content="IE=edge"/><title>Publishing your site · Docusaurus</title><meta name="viewport" content="width=device-width"/><meta name="generator" content="Docusaurus"/><meta property="og:title" content="Publishing your site · Docusaurus"/><meta property="og:type" content="website"/><meta property="og:url" content="https://docusaurus.io/index.html"/><meta property="og:description" content="You should now have a [site up and running locally](/docs/en/next/site-creation). Once you have [customized](/docs/en/next/site-config) it to your liking, it's time to publish it. Docusaurus generates a static HTML website that is ready to be served by your favorite web server or online hosting solution."/><meta property="og:image" content="https://docusaurus.io/img/docusaurus.png"/><meta name="twitter:card" content="summary"/><meta name="twitter:image" content="https://docusaurus.io/img/docusaurus.png"/><link rel="shortcut icon" href="/img/docusaurus.ico"/><link rel="stylesheet" href="https://cdn.jsdelivr.net/docsearch.js/1/docsearch.min.css"/><link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/highlight.js/9.12.0/styles/atom-one-dark.min.css"/><link rel="alternate" type="application/atom+xml" href="https://docusaurus.io/blog/atom.xml" title="Docusaurus Blog ATOM Feed"/><link rel="alternate" type="application/rss+xml" href="https://docusaurus.io/blog/feed.xml" title="Docusaurus Blog RSS Feed"/><script>
|
||||
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
|
||||
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
|
||||
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
|
||||
|
@ -12,7 +12,7 @@
|
|||
{"zIndex":100}
|
||||
)
|
||||
});
|
||||
</script><link rel="stylesheet" href="/css/main.css"/></head><body class="sideNavVisible doc separateOnPageNav"><div class="fixedHeaderContainer"><div class="headerWrapper wrapper"><header><a href="/en"><img class="logo" src="/img/docusaurus.svg" alt="Docusaurus"/><h2 class="headerTitleWithLogo">Docusaurus</h2></a><a href="/en/versions.html"><h3>next</h3></a><div class="navigationWrapper navigationSlider"><nav class="slidingNav"><ul class="nav-site nav-site-internal"><li class="siteNavGroupActive"><a href="/docs/en/next/installation.html" target="_self">Docs</a></li><li class=""><a href="/en/help.html" target="_self">Help</a></li><li class=""><a href="/en/users.html" target="_self">Users</a></li><li class=""><a href="/en/about-slash.html" target="_self">About /</a></li><li class=""><a href="/blog" target="_self">Blog</a></li><li class=""><a href="https://github.com/facebook/docusaurus" target="_self">GitHub</a></li><span><li><a id="languages-menu" href="#"><img class="languages-icon" src="/img/language.svg"/>English</a><div id="languages-dropdown" class="hide"><ul id="languages-dropdown-items"><li><a href="/es-ES">Español</a></li><li><a href="/ro">Română</a></li><li><a href="/tr">Türkçe</a></li><li><a href="/zh-CN">简体中文</a></li><li><a href="https://crowdin.com/project/docusaurus" target="_blank" rel="noreferrer noopener">Help Translate</a></li></ul></div></li><script>
|
||||
</script><link rel="stylesheet" href="/css/main.css"/></head><body class="sideNavVisible doc separateOnPageNav"><div class="fixedHeaderContainer"><div class="headerWrapper wrapper"><header><a href="/en"><img class="logo" src="/img/docusaurus.svg" alt="Docusaurus"/><h2 class="headerTitleWithLogo">Docusaurus</h2></a><a href="/en/versions.html"><h3>next</h3></a><div class="navigationWrapper navigationSlider"><nav class="slidingNav"><ul class="nav-site nav-site-internal"><li class="siteNavGroupActive"><a href="/docs/en/next/installation" target="_self">Docs</a></li><li class=""><a href="/en/help" target="_self">Help</a></li><li class=""><a href="/en/users" target="_self">Users</a></li><li class=""><a href="/en/about-slash" target="_self">About /</a></li><li class=""><a href="/blog" target="_self">Blog</a></li><li class=""><a href="https://github.com/facebook/docusaurus" target="_self">GitHub</a></li><span><li><a id="languages-menu" href="#"><img class="languages-icon" src="/img/language.svg"/>English</a><div id="languages-dropdown" class="hide"><ul id="languages-dropdown-items"><li><a href="/es-ES">Español</a></li><li><a href="/ro">Română</a></li><li><a href="/tr">Türkçe</a></li><li><a href="/zh-CN">简体中文</a></li><li><a href="https://crowdin.com/project/docusaurus" target="_blank" rel="noreferrer noopener">Help Translate</a></li></ul></div></li><script>
|
||||
const languagesMenuItem = document.getElementById("languages-menu");
|
||||
const languagesDropDown = document.getElementById("languages-dropdown");
|
||||
languagesMenuItem.addEventListener("click", function(){
|
||||
|
@ -22,13 +22,13 @@
|
|||
languagesDropDown.className = "hide";
|
||||
}
|
||||
});
|
||||
</script></span><li class="navSearchWrapper reactNavSearchWrapper"><input type="text" id="search_input_react" placeholder="Search" title="Search"/></li></ul></nav></div></header></div></div><div class="navPusher"><div class="docMainWrapper wrapper"><div class="container docsNavContainer" id="docsNav"><nav class="toc"><div class="toggleNav"><section class="navWrapper wrapper"><div class="navBreadcrumb wrapper"><div class="navToggle" id="navToggler"><i></i></div><h2><i>›</i><span>Getting Started</span></h2></div><div class="navGroups"><div class="navGroup navGroupActive"><h3>Getting Started</h3><ul><li class="navListItem"><a class="navItem" href="/docs/en/next/installation.html">Installation</a></li><li class="navListItem"><a class="navItem" href="/docs/en/next/site-preparation.html">Site Preparation</a></li><li class="navListItem"><a class="navItem" href="/docs/en/next/site-creation.html">Creating your site</a></li><li class="navListItem navListItemActive"><a class="navItem navItemActive" href="/docs/en/next/publishing.html">Publishing your site</a></li></ul></div><div class="navGroup navGroupActive"><h3>Guides</h3><ul><li class="navListItem"><a class="navItem" href="/docs/en/next/blog.html">Adding a Blog</a></li><li class="navListItem"><a class="navItem" href="/docs/en/next/custom-pages.html">Custom Pages</a></li><li class="navListItem"><a class="navItem" href="/docs/en/next/search.html">Enabling Search</a></li><li class="navListItem"><a class="navItem" href="/docs/en/next/navigation.html">Navigation and Sidebars</a></li><li class="navListItem"><a class="navItem" href="/docs/en/next/translation.html">Translations & Localization</a></li><li class="navListItem"><a class="navItem" href="/docs/en/next/versioning.html">Versioning</a></li></ul></div><div class="navGroup navGroupActive"><h3>API</h3><ul><li class="navListItem"><a class="navItem" href="/docs/en/next/commands.html">CLI Commands</a></li><li class="navListItem"><a class="navItem" href="/docs/en/next/doc-markdown.html">Markdown Features</a></li><li class="navListItem"><a class="navItem" href="/docs/en/next/api-pages.html">Pages and Styles</a></li><li class="navListItem"><a class="navItem" href="/docs/en/next/site-config.html">siteConfig.js</a></li></ul></div></div></section></div><script>
|
||||
</script></span><li class="navSearchWrapper reactNavSearchWrapper"><input type="text" id="search_input_react" placeholder="Search" title="Search"/></li></ul></nav></div></header></div></div><div class="navPusher"><div class="docMainWrapper wrapper"><div class="container docsNavContainer" id="docsNav"><nav class="toc"><div class="toggleNav"><section class="navWrapper wrapper"><div class="navBreadcrumb wrapper"><div class="navToggle" id="navToggler"><i></i></div><h2><i>›</i><span>Getting Started</span></h2></div><div class="navGroups"><div class="navGroup navGroupActive"><h3>Getting Started</h3><ul><li class="navListItem"><a class="navItem" href="/docs/en/next/installation">Installation</a></li><li class="navListItem"><a class="navItem" href="/docs/en/next/site-preparation">Site Preparation</a></li><li class="navListItem"><a class="navItem" href="/docs/en/next/site-creation">Creating your site</a></li><li class="navListItem navListItemActive"><a class="navItem navItemActive" href="/docs/en/next/publishing">Publishing your site</a></li></ul></div><div class="navGroup navGroupActive"><h3>Guides</h3><ul><li class="navListItem"><a class="navItem" href="/docs/en/next/blog">Adding a Blog</a></li><li class="navListItem"><a class="navItem" href="/docs/en/next/custom-pages">Custom Pages</a></li><li class="navListItem"><a class="navItem" href="/docs/en/next/search">Enabling Search</a></li><li class="navListItem"><a class="navItem" href="/docs/en/next/navigation">Navigation and Sidebars</a></li><li class="navListItem"><a class="navItem" href="/docs/en/next/translation">Translations & Localization</a></li><li class="navListItem"><a class="navItem" href="/docs/en/next/versioning">Versioning</a></li></ul></div><div class="navGroup navGroupActive"><h3>API</h3><ul><li class="navListItem"><a class="navItem" href="/docs/en/next/commands">CLI Commands</a></li><li class="navListItem"><a class="navItem" href="/docs/en/next/doc-markdown">Markdown Features</a></li><li class="navListItem"><a class="navItem" href="/docs/en/next/api-pages">Pages and Styles</a></li><li class="navListItem"><a class="navItem" href="/docs/en/next/site-config">siteConfig.js</a></li></ul></div></div></section></div><script>
|
||||
var toggler = document.getElementById('navToggler');
|
||||
var nav = document.getElementById('docsNav');
|
||||
toggler.onclick = function() {
|
||||
nav.classList.toggle('docsSliderActive');
|
||||
};
|
||||
</script></nav></div><div class="container mainContainer"><div class="wrapper"><div class="post"><header class="postHeader"><a class="edit-page-link button" href="https://github.com/facebook/docusaurus/edit/master/docs/getting-started-publishing.md" target="_blank" rel="noreferrer noopener">Edit</a><h1>Publishing your site</h1></header><article><div><span><p>You should now have a <a href="/docs/en/next/site-creation.html">site up and running locally</a>. Once you have <a href="/docs/en/next/site-config.html">customized</a> it to your liking, it's time to publish it. Docusaurus generates a static HTML website that is ready to be served by your favorite web server or online hosting solution.</p>
|
||||
</script></nav></div><div class="container mainContainer"><div class="wrapper"><div class="post"><header class="postHeader"><a class="edit-page-link button" href="https://github.com/facebook/docusaurus/edit/master/docs/getting-started-publishing.md" target="_blank" rel="noreferrer noopener">Edit</a><h1>Publishing your site</h1></header><article><div><span><p>You should now have a <a href="/docs/en/next/site-creation">site up and running locally</a>. Once you have <a href="/docs/en/next/site-config">customized</a> it to your liking, it's time to publish it. Docusaurus generates a static HTML website that is ready to be served by your favorite web server or online hosting solution.</p>
|
||||
<h2><a class="anchor" aria-hidden="true" id="building-static-html-pages"></a><a href="#building-static-html-pages" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Building Static HTML Pages</h2>
|
||||
<p>To create a static build of your website, run the following script from the <code>website</code> directory:</p>
|
||||
<pre><code class="hljs css bash">yarn run build <span class="hljs-comment"># or `npm run build`</span>
|
||||
|
@ -53,8 +53,8 @@
|
|||
<blockquote>
|
||||
<p>Even if your repo is private, anything published to a <code>gh-pages</code> branch will be <a href="https://help.github.com/articles/user-organization-and-project-pages/">public</a>.</p>
|
||||
</blockquote>
|
||||
<p>Most of the work to publish to GitHub pages is done for you automatically through the <a href="/docs/en/next/commands.html#docusaurus-publish"><code>publish-gh-pages</code></a> script. You just need to determine the values for a few parameters required by the script.</p>
|
||||
<p>Two of the required parameters are set in the <a href="/docs/en/next/site-config.html"><code>siteConfig.js</code></a>:</p>
|
||||
<p>Most of the work to publish to GitHub pages is done for you automatically through the <a href="/docs/en/next/commands#docusaurus-publish"><code>publish-gh-pages</code></a> script. You just need to determine the values for a few parameters required by the script.</p>
|
||||
<p>Two of the required parameters are set in the <a href="/docs/en/next/site-config"><code>siteConfig.js</code></a>:</p>
|
||||
<table>
|
||||
<thead>
|
||||
<tr><th>Name</th><th>Description</th></tr>
|
||||
|
@ -223,7 +223,7 @@
|
|||
</tbody>
|
||||
</table>
|
||||
<p>Alter your <code>siteConfig.js</code> to add a property <code>'githubHost'</code> which represents the GitHub Enterprise hostname. Alternatively, set an environment variable <code>GITHUB_HOST</code> when executing the publish command.</p>
|
||||
</span></div></article></div><div class="docs-prevnext"><a class="docs-prev button" href="site-creation.html">← Creating your site</a><a class="docs-next button" href="blog.html">Adding a Blog →</a></div></div></div><nav class="onPageNav"><ul class="toc-headings"><li><a href="#building-static-html-pages">Building Static HTML Pages</a></li><li><a href="#hosting-static-html-pages">Hosting Static HTML Pages</a><ul class="toc-headings"><li><a href="#hosting-on-a-service">Hosting on a Service:</a></li><li><a href="#using-github-pages">Using GitHub Pages</a></li></ul></li><li><a href="#automating-deployments-using-continuous-integration">Automating Deployments Using Continuous Integration</a><ul class="toc-headings"><li><a href="#using-circle-ci-20">Using Circle CI 2.0</a></li><li><a href="#tips-tricks">Tips & Tricks</a></li><li><a href="#using-travis-ci">Using Travis CI</a></li><li><a href="#hosting-on-netlify">Hosting on Netlify</a></li><li><a href="#publishing-to-github-enterprise">Publishing to GitHub Enterprise</a></li></ul></li></ul></nav></div><footer class="nav-footer" id="footer"><section class="sitemap"><a href="/" class="nav-home"><img src="/img/docusaurus_monochrome.svg" alt="Docusaurus" width="66" height="58"/></a><div><h5>Docs</h5><a href="
|
||||
</span></div></article></div><div class="docs-prevnext"><a class="docs-prev button" href="site-creation">← Creating your site</a><a class="docs-next button" href="blog">Adding a Blog →</a></div></div></div><nav class="onPageNav"><ul class="toc-headings"><li><a href="#building-static-html-pages">Building Static HTML Pages</a></li><li><a href="#hosting-static-html-pages">Hosting Static HTML Pages</a><ul class="toc-headings"><li><a href="#hosting-on-a-service">Hosting on a Service:</a></li><li><a href="#using-github-pages">Using GitHub Pages</a></li></ul></li><li><a href="#automating-deployments-using-continuous-integration">Automating Deployments Using Continuous Integration</a><ul class="toc-headings"><li><a href="#using-circle-ci-20">Using Circle CI 2.0</a></li><li><a href="#tips-tricks">Tips & Tricks</a></li><li><a href="#using-travis-ci">Using Travis CI</a></li><li><a href="#hosting-on-netlify">Hosting on Netlify</a></li><li><a href="#publishing-to-github-enterprise">Publishing to GitHub Enterprise</a></li></ul></li></ul></nav></div><footer class="nav-footer" id="footer"><section class="sitemap"><a href="/" class="nav-home"><img src="/img/docusaurus_monochrome.svg" alt="Docusaurus" width="66" height="58"/></a><div><h5>Docs</h5><a href="
|
||||
/docs/en/installation.html">Getting Started</a><a href="
|
||||
/docs/en/versioning.html">Versioning</a><a href="
|
||||
/docs/en/translation.html">Localization</a><a href="
|
||||
|
|
238
docs/en/next/publishing/index.html
Normal file
238
docs/en/next/publishing/index.html
Normal file
|
@ -0,0 +1,238 @@
|
|||
<!DOCTYPE html><html lang="en"><head><meta charSet="utf-8"/><meta http-equiv="X-UA-Compatible" content="IE=edge"/><title>Publishing your site · Docusaurus</title><meta name="viewport" content="width=device-width"/><meta name="generator" content="Docusaurus"/><meta property="og:title" content="Publishing your site · Docusaurus"/><meta property="og:type" content="website"/><meta property="og:url" content="https://docusaurus.io/index.html"/><meta property="og:description" content="You should now have a [site up and running locally](/docs/en/next/site-creation). Once you have [customized](/docs/en/next/site-config) it to your liking, it's time to publish it. Docusaurus generates a static HTML website that is ready to be served by your favorite web server or online hosting solution."/><meta property="og:image" content="https://docusaurus.io/img/docusaurus.png"/><meta name="twitter:card" content="summary"/><meta name="twitter:image" content="https://docusaurus.io/img/docusaurus.png"/><link rel="shortcut icon" href="/img/docusaurus.ico"/><link rel="stylesheet" href="https://cdn.jsdelivr.net/docsearch.js/1/docsearch.min.css"/><link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/highlight.js/9.12.0/styles/atom-one-dark.min.css"/><link rel="alternate" type="application/atom+xml" href="https://docusaurus.io/blog/atom.xml" title="Docusaurus Blog ATOM Feed"/><link rel="alternate" type="application/rss+xml" href="https://docusaurus.io/blog/feed.xml" title="Docusaurus Blog RSS Feed"/><script>
|
||||
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
|
||||
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
|
||||
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
|
||||
})(window,document,'script','https://www.google-analytics.com/analytics.js','ga');
|
||||
|
||||
ga('create', 'UA-44373548-31', 'auto');
|
||||
ga('send', 'pageview');
|
||||
</script><link rel="stylesheet" href="/css/code-blocks-buttons.css"/><script type="text/javascript" src="https://buttons.github.io/buttons.js"></script><script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/clipboard.js/2.0.0/clipboard.min.js"></script><script type="text/javascript" src="/js/code-blocks-buttons.js"></script><script src="https://unpkg.com/vanilla-back-to-top@7.1.14/dist/vanilla-back-to-top.min.js"></script><script>
|
||||
document.addEventListener("DOMContentLoaded", function(){
|
||||
addBackToTop(
|
||||
{"zIndex":100}
|
||||
)
|
||||
});
|
||||
</script><link rel="stylesheet" href="/css/main.css"/></head><body class="sideNavVisible doc separateOnPageNav"><div class="fixedHeaderContainer"><div class="headerWrapper wrapper"><header><a href="/en"><img class="logo" src="/img/docusaurus.svg" alt="Docusaurus"/><h2 class="headerTitleWithLogo">Docusaurus</h2></a><a href="/en/versions.html"><h3>next</h3></a><div class="navigationWrapper navigationSlider"><nav class="slidingNav"><ul class="nav-site nav-site-internal"><li class="siteNavGroupActive"><a href="/docs/en/next/installation" target="_self">Docs</a></li><li class=""><a href="/en/help" target="_self">Help</a></li><li class=""><a href="/en/users" target="_self">Users</a></li><li class=""><a href="/en/about-slash" target="_self">About /</a></li><li class=""><a href="/blog" target="_self">Blog</a></li><li class=""><a href="https://github.com/facebook/docusaurus" target="_self">GitHub</a></li><span><li><a id="languages-menu" href="#"><img class="languages-icon" src="/img/language.svg"/>English</a><div id="languages-dropdown" class="hide"><ul id="languages-dropdown-items"><li><a href="/es-ES">Español</a></li><li><a href="/ro">Română</a></li><li><a href="/tr">Türkçe</a></li><li><a href="/zh-CN">简体中文</a></li><li><a href="https://crowdin.com/project/docusaurus" target="_blank" rel="noreferrer noopener">Help Translate</a></li></ul></div></li><script>
|
||||
const languagesMenuItem = document.getElementById("languages-menu");
|
||||
const languagesDropDown = document.getElementById("languages-dropdown");
|
||||
languagesMenuItem.addEventListener("click", function(){
|
||||
if(languagesDropDown.className == "hide") {
|
||||
languagesDropDown.className = "visible";
|
||||
} else {
|
||||
languagesDropDown.className = "hide";
|
||||
}
|
||||
});
|
||||
</script></span><li class="navSearchWrapper reactNavSearchWrapper"><input type="text" id="search_input_react" placeholder="Search" title="Search"/></li></ul></nav></div></header></div></div><div class="navPusher"><div class="docMainWrapper wrapper"><div class="container docsNavContainer" id="docsNav"><nav class="toc"><div class="toggleNav"><section class="navWrapper wrapper"><div class="navBreadcrumb wrapper"><div class="navToggle" id="navToggler"><i></i></div><h2><i>›</i><span>Getting Started</span></h2></div><div class="navGroups"><div class="navGroup navGroupActive"><h3>Getting Started</h3><ul><li class="navListItem"><a class="navItem" href="/docs/en/next/installation">Installation</a></li><li class="navListItem"><a class="navItem" href="/docs/en/next/site-preparation">Site Preparation</a></li><li class="navListItem"><a class="navItem" href="/docs/en/next/site-creation">Creating your site</a></li><li class="navListItem navListItemActive"><a class="navItem navItemActive" href="/docs/en/next/publishing">Publishing your site</a></li></ul></div><div class="navGroup navGroupActive"><h3>Guides</h3><ul><li class="navListItem"><a class="navItem" href="/docs/en/next/blog">Adding a Blog</a></li><li class="navListItem"><a class="navItem" href="/docs/en/next/custom-pages">Custom Pages</a></li><li class="navListItem"><a class="navItem" href="/docs/en/next/search">Enabling Search</a></li><li class="navListItem"><a class="navItem" href="/docs/en/next/navigation">Navigation and Sidebars</a></li><li class="navListItem"><a class="navItem" href="/docs/en/next/translation">Translations & Localization</a></li><li class="navListItem"><a class="navItem" href="/docs/en/next/versioning">Versioning</a></li></ul></div><div class="navGroup navGroupActive"><h3>API</h3><ul><li class="navListItem"><a class="navItem" href="/docs/en/next/commands">CLI Commands</a></li><li class="navListItem"><a class="navItem" href="/docs/en/next/doc-markdown">Markdown Features</a></li><li class="navListItem"><a class="navItem" href="/docs/en/next/api-pages">Pages and Styles</a></li><li class="navListItem"><a class="navItem" href="/docs/en/next/site-config">siteConfig.js</a></li></ul></div></div></section></div><script>
|
||||
var toggler = document.getElementById('navToggler');
|
||||
var nav = document.getElementById('docsNav');
|
||||
toggler.onclick = function() {
|
||||
nav.classList.toggle('docsSliderActive');
|
||||
};
|
||||
</script></nav></div><div class="container mainContainer"><div class="wrapper"><div class="post"><header class="postHeader"><a class="edit-page-link button" href="https://github.com/facebook/docusaurus/edit/master/docs/getting-started-publishing.md" target="_blank" rel="noreferrer noopener">Edit</a><h1>Publishing your site</h1></header><article><div><span><p>You should now have a <a href="/docs/en/next/site-creation">site up and running locally</a>. Once you have <a href="/docs/en/next/site-config">customized</a> it to your liking, it's time to publish it. Docusaurus generates a static HTML website that is ready to be served by your favorite web server or online hosting solution.</p>
|
||||
<h2><a class="anchor" aria-hidden="true" id="building-static-html-pages"></a><a href="#building-static-html-pages" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Building Static HTML Pages</h2>
|
||||
<p>To create a static build of your website, run the following script from the <code>website</code> directory:</p>
|
||||
<pre><code class="hljs css bash">yarn run build <span class="hljs-comment"># or `npm run build`</span>
|
||||
</code></pre>
|
||||
<p>This will generate a <code>build</code> folder inside the <code>website</code> directory containing the <code>.html</code> files from all of your docs and other pages included in <code>pages</code>.</p>
|
||||
<h2><a class="anchor" aria-hidden="true" id="hosting-static-html-pages"></a><a href="#hosting-static-html-pages" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Hosting Static HTML Pages</h2>
|
||||
<p>At this point, you can grab all of the files inside the <code>website/build</code> folder and copy them over to your favorite web server's <code>html</code> directory.</p>
|
||||
<blockquote>
|
||||
<p>For example, both Apache and nginx serve content from <code>/var/www/html</code> by default. That said, choosing a web server or provider is outside the scope of Docusaurus.</p>
|
||||
</blockquote>
|
||||
<blockquote>
|
||||
<p>When serving the site from your own web server, ensure the web server is serving the asset files with the proper HTTP headers. CSS files should be served with the <code>content-type</code> header of <code>text/css</code>. In the case of nginx, this would mean setting <code>include /etc/nginx/mime.types;</code> in your <code>nginx.conf</code> file. See <a href="https://github.com/facebook/Docusaurus/issues/602">this issue</a> for more info.</p>
|
||||
</blockquote>
|
||||
<h3><a class="anchor" aria-hidden="true" id="hosting-on-a-service"></a><a href="#hosting-on-a-service" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Hosting on a Service:</h3>
|
||||
<ul>
|
||||
<li><a href="#using-github-pages">GitHub Pages</a></li>
|
||||
<li><a href="#hosting-on-netlify">Netlify</a></li>
|
||||
</ul>
|
||||
<h3><a class="anchor" aria-hidden="true" id="using-github-pages"></a><a href="#using-github-pages" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Using GitHub Pages</h3>
|
||||
<p>While choosing a web server or host is outside Docusaurus' scope, Docusaurus was designed to work really well with one of the most popular hosting solutions for open source projects: <a href="https://pages.github.com/">GitHub Pages</a>.</p>
|
||||
<p>Deploying your Docusaurus site to GitHub Pages is straightforward if you are already using GitHub to host your project. Your code repository does not even need to be public.</p>
|
||||
<blockquote>
|
||||
<p>Even if your repo is private, anything published to a <code>gh-pages</code> branch will be <a href="https://help.github.com/articles/user-organization-and-project-pages/">public</a>.</p>
|
||||
</blockquote>
|
||||
<p>Most of the work to publish to GitHub pages is done for you automatically through the <a href="/docs/en/next/commands#docusaurus-publish"><code>publish-gh-pages</code></a> script. You just need to determine the values for a few parameters required by the script.</p>
|
||||
<p>Two of the required parameters are set in the <a href="/docs/en/next/site-config"><code>siteConfig.js</code></a>:</p>
|
||||
<table>
|
||||
<thead>
|
||||
<tr><th>Name</th><th>Description</th></tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr><td><code>organizationName</code></td><td>The GitHub user or organization that owns the repository. In the case of Docusaurus, that would be the "facebook" GitHub organization.</td></tr>
|
||||
<tr><td><code>projectName</code></td><td>The name of the GitHub repository for your project. For example, Docusaurus is hosted at <a href="https://github.com/facebook/docusaurus">https://github.com/facebook/docusaurus</a>, so our project name in this case would be "docusaurus".</td></tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<blockquote>
|
||||
<p>Docusaurus also supports deploying <a href="https://help.github.com/articles/user-organization-and-project-pages/#user--organization-pages">user or organization sites</a>. These sites will be served from the <code>master</code> branch of the repo. So, you will want to have the Docusaurus infra, your docs, etc. in another branch (e.g., maybe call it <code>source</code>). To do this, just set <code>projectName</code> to "<em>username</em>.github.io" (where <em>username</em> is your username or organization name on GitHub) and <code>organizationName</code> to "<em>username</em>". The publish script will automatically deploy your site to the root of the <code>master</code> branch to be served.</p>
|
||||
</blockquote>
|
||||
<blockquote>
|
||||
<p>While we recommend setting the <code>projectName</code> and <code>organizationName</code> in <code>siteConfig.js</code>, you can also use environment variables <code>ORGANIZATION_NAME</code> and <code>PROJECT_NAME</code>.</p>
|
||||
</blockquote>
|
||||
<p>One of the required parameters is set as a environment variable:</p>
|
||||
<table>
|
||||
<thead>
|
||||
<tr><th>Name</th><th>Description</th></tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr><td><code>GIT_USER</code></td><td>The username for a GitHub account that has commit access to this repo. For your own repositories, this will usually be your own GitHub username.</td></tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<p>There are also two optional parameters that are set as environment variables:</p>
|
||||
<table>
|
||||
<thead>
|
||||
<tr><th>Name</th><th>Description</th></tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr><td><code>USE_SSH</code></td><td>If this is set to <code>true</code>, then SSH is used instead of HTTPS for the connection to the GitHub repo. HTTPS is the default if this variable is not set.</td></tr>
|
||||
<tr><td><code>CURRENT_BRANCH</code></td><td>The branch that contains the latest docs changes that will be deployed. Usually, the branch will be <code>master</code>, but it could be any branch (default or otherwise) except for <code>gh-pages</code>. If nothing is set for this variable, then the current branch will be used.</td></tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<p>Once you have the parameter value information, you can go ahead and run the publish script, ensuring you have inserted your own values inside the various parameter placeholders:</p>
|
||||
<p>To run the script directly from the command-line, you can use the following, filling in the parameter values as appropriate. If you run into issues related to SSH keys, visit <a href="https://help.github.com/articles/connecting-to-github-with-ssh/">Github's authentication documentation</a>.</p>
|
||||
<pre><code class="hljs css bash">GIT_USER=<GIT_USER> \
|
||||
CURRENT_BRANCH=master \
|
||||
USE_SSH=<span class="hljs-literal">true</span> \
|
||||
yarn run publish-gh-pages <span class="hljs-comment"># or `npm run publish-gh-pages`</span>
|
||||
</code></pre>
|
||||
<blockquote>
|
||||
<p>The specified <code>GIT_USER</code> must have push access to the repository specified in the combination of <code>organizationName</code> and <code>projectName</code>.</p>
|
||||
</blockquote>
|
||||
<p>You should now be able to load your website by visiting its GitHub Pages URL, which could be something along the lines of https://<em>username</em>.github.io/<em>projectName</em>, or a custom domain if you have set that up. For example, Docusaurus' own GitHub Pages URL is <a href="https://facebook.github.io/Docusaurus">https://facebook.github.io/Docusaurus</a> (it can also be accessed via <a href="https://docusaurus.io/">https://docusaurus.io/</a>), because it is served from the <code>gh-pages</code> branch of the <a href="https://github.com/facebook/docusaurus">https://github.com/facebook/docusaurus</a> GitHub repo. We highly encourage reading through the <a href="https://pages.github.com">GitHub Pages documentation</a> to learn more about how this hosting solution works.</p>
|
||||
<p>You can run the command above any time you update the docs and wish to deploy the changes to your site. Running the script manually may be fine for sites where the documentation rarely changes and it is not too much of an inconvenience to remember to manually deploy changes.</p>
|
||||
<p>However, you can automate the publishing process with continuous integration (CI).</p>
|
||||
<h2><a class="anchor" aria-hidden="true" id="automating-deployments-using-continuous-integration"></a><a href="#automating-deployments-using-continuous-integration" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Automating Deployments Using Continuous Integration</h2>
|
||||
<p>Continuous integration (CI) services are typically used to perform routine tasks whenever new commits are checked in to source control. These tasks can be any combination of running unit tests and integration tests, automating builds, publishing packages to NPM, and yes, deploying changes to your website. All you need to do to automate deployment of your website is to invoke the <code>publish-gh-pages</code> script whenever your docs get updated. In the following section we'll be covering how to do just that using <a href="https://circleci.com/">Circle CI</a>, a popular continuous integration service provider.</p>
|
||||
<h3><a class="anchor" aria-hidden="true" id="using-circle-ci-20"></a><a href="#using-circle-ci-20" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Using Circle CI 2.0</h3>
|
||||
<p>If you haven't done so already, you can <a href="https://circleci.com/signup/">setup CircleCI</a> for your open source project. Afterwards, in order to enable automatic deployment of your site and documentation via CircleCI, just configure Circle to run the <code>publish-gh-pages</code> script as part of the deployment step. You can follow the steps below to get that setup.</p>
|
||||
<ol>
|
||||
<li>Ensure the GitHub account that will be set as the <code>GIT_USER</code> has <code>write</code> access to the repo that contains the documentation, by checking <code>Settings | Collaborators & teams</code> in the repo.</li>
|
||||
<li>Log into GitHub as the <code>GIT_USER</code>.</li>
|
||||
<li>Go to <a href="https://github.com/settings/tokens">https://github.com/settings/tokens</a> for the <code>GIT_USER</code> and generate a new <a href="https://help.github.com/articles/creating-a-personal-access-token-for-the-command-line/">personal access token</a>, granting it full control of private repositories through the <code>repo</code> access scope. Store this token in a safe place, making sure to not share it with anyone. This token can be used to authenticate GitHub actions on your behalf in place of your GitHub password.</li>
|
||||
<li>Open your Circle CI dashboard, and navigate to the Settings page for your repository, then select "Environment variables". The URL looks like <a href="https://circleci.com/gh/ORG/REPO/edit#env-vars">https://circleci.com/gh/ORG/REPO/edit#env-vars</a>, where "ORG/REPO" should be replaced with your own GitHub org/repo.</li>
|
||||
<li>Create a new environment variable named <code>GITHUB_TOKEN</code>, using your newly generated access token as the value.</li>
|
||||
<li>Create a <code>.circleci</code> folder and create a <code>config.yml</code> under that folder.</li>
|
||||
<li>Copy the text below into <code>.circleci/config.yml</code>.</li>
|
||||
</ol>
|
||||
<pre><code class="hljs css yaml"><span class="hljs-comment"># If you only want circle to run on direct commits to master, you can uncomment this out</span>
|
||||
<span class="hljs-comment"># and uncomment the filters: *filter-only-master down below too</span>
|
||||
<span class="hljs-comment">#</span>
|
||||
<span class="hljs-comment"># aliases:</span>
|
||||
<span class="hljs-comment"># - &filter-only-master</span>
|
||||
<span class="hljs-comment"># branches:</span>
|
||||
<span class="hljs-comment"># only:</span>
|
||||
<span class="hljs-comment"># - master</span>
|
||||
|
||||
<span class="hljs-attr">version:</span> <span class="hljs-number">2</span>
|
||||
<span class="hljs-attr">jobs:</span>
|
||||
<span class="hljs-attr"> deploy-website:</span>
|
||||
<span class="hljs-attr"> docker:</span>
|
||||
<span class="hljs-comment"># specify the version you desire here</span>
|
||||
<span class="hljs-attr"> - image:</span> <span class="hljs-string">circleci/node:8.11.1</span>
|
||||
|
||||
<span class="hljs-attr"> steps:</span>
|
||||
<span class="hljs-bullet"> -</span> <span class="hljs-string">checkout</span>
|
||||
<span class="hljs-attr"> - run:</span>
|
||||
<span class="hljs-attr"> name:</span> <span class="hljs-string">Deploying</span> <span class="hljs-string">to</span> <span class="hljs-string">GitHub</span> <span class="hljs-string">Pages</span>
|
||||
<span class="hljs-attr"> command:</span> <span class="hljs-string">|
|
||||
git config --global user.email "<GITHUB_USERNAME>@users.noreply.github.com"
|
||||
git config --global user.name "<YOUR_NAME>"
|
||||
echo "machine github.com login <GITHUB_USERNAME> password $GITHUB_TOKEN" > ~/.netrc
|
||||
cd website && yarn install && GIT_USER=<GIT_USER> yarn run publish-gh-pages
|
||||
|
||||
</span><span class="hljs-attr">workflows:</span>
|
||||
<span class="hljs-attr"> version:</span> <span class="hljs-number">2</span>
|
||||
<span class="hljs-attr"> build_and_deploy:</span>
|
||||
<span class="hljs-attr"> jobs:</span>
|
||||
<span class="hljs-attr"> - deploy-website:</span>
|
||||
<span class="hljs-comment"># filters: *filter-only-master</span>
|
||||
</code></pre>
|
||||
<p>Make sure to replace all <code><....></code> in the <code>command:</code> sequence with appropriate values. For <code><GIT_USER></code>, it should be a GitHub account that has access to push documentation to your GitHub repo. Many times <code><GIT_USER></code> and <code><GITHUB_USERNAME></code> will be the same.</p>
|
||||
<p><strong>DO NOT</strong> place the actual value of <code>$GITHUB_TOKEN</code> in <code>circle.yml</code>. We already configured that as an environment variable back in Step 3.</p>
|
||||
<blockquote>
|
||||
<p>If you want to use SSH for your GitHub repo connection, you can set <code>USE_SSH=true</code>. So the above command would look something like: <code>cd website && npm install && GIT_USER=<GIT_USER> USE_SSH=true npm run publish-gh-pages</code>.</p>
|
||||
</blockquote>
|
||||
<blockquote>
|
||||
<p>Unlike when you run the <code>publish-gh-pages</code> script manually, when the script runs within the Circle environment, the value of <code>CURRENT_BRANCH</code> is already defined as an <a href="https://circleci.com/docs/1.0/environment-variables/">environment variable within CircleCI</a> and will be picked up by the script automatically.</p>
|
||||
</blockquote>
|
||||
<p>Now, whenever a new commit lands in <code>master</code>, CircleCI will run your suite of tests and, if everything passes, your website will be deployed via the <code>publish-gh-pages</code> script.</p>
|
||||
<blockquote>
|
||||
<p>If you would rather use a deploy key instead of a personal access token, you can by starting with the Circle CI <a href="https://circleci.com/docs/1.0/adding-read-write-deployment-key/">instructions</a> for adding a read/write deploy key.</p>
|
||||
</blockquote>
|
||||
<h3><a class="anchor" aria-hidden="true" id="tips-tricks"></a><a href="#tips-tricks" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Tips & Tricks</h3>
|
||||
<p>When initially deploying to a <code>gh-pages</code> branch using Circle CI, you may notice that some jobs triggered by commits to the <code>gh-pages</code> branch fail to run successfully due to a lack of tests. You can easily work around this by creating a basic Circle CI config with the following contents:</p>
|
||||
<pre><code class="hljs css yaml"><span class="hljs-comment"># Circle CI 2.0 Config File</span>
|
||||
<span class="hljs-comment"># This config file will prevent tests from being run on the gh-pages branch.</span>
|
||||
<span class="hljs-attr">version:</span> <span class="hljs-number">2</span>
|
||||
<span class="hljs-attr">jobs:</span>
|
||||
<span class="hljs-attr"> build:</span>
|
||||
<span class="hljs-attr"> machine:</span> <span class="hljs-literal">true</span>
|
||||
<span class="hljs-attr"> branches:</span>
|
||||
<span class="hljs-attr"> ignore:</span> <span class="hljs-string">gh-pages</span>
|
||||
<span class="hljs-attr"> steps:</span>
|
||||
<span class="hljs-attr"> - run:</span> <span class="hljs-string">echo</span> <span class="hljs-string">"Skipping tests on gh-pages branch"</span>
|
||||
</code></pre>
|
||||
<p>Save this file as <code>config.yml</code> and place it in a <code>.circleci</code> folder inside your <code>website/static</code> folder.</p>
|
||||
<h3><a class="anchor" aria-hidden="true" id="using-travis-ci"></a><a href="#using-travis-ci" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Using Travis CI</h3>
|
||||
<ol>
|
||||
<li>Go to <a href="https://github.com/settings/tokens">https://github.com/settings/tokens</a> and generate a new <a href="https://help.github.com/articles/creating-a-personal-access-token-for-the-command-line/">personal access token</a></li>
|
||||
<li>Using your GitHub account, <a href="https://github.com/marketplace/travis-ci">add the Travis CI app</a> to the repository you want to activate.</li>
|
||||
<li>Open your Travis CI dashboard. The URL looks like <a href="https://travis-ci.com/USERNAME/REPO">https://travis-ci.com/USERNAME/REPO</a>, and navigate to the <code>More options</code> > <code>Setting</code> > <code>Environment Variables</code> section of your repository.</li>
|
||||
<li>Create a new environment variable named <code>GH_TOKEN</code> with your newly generated token as its value, then <code>GH_EMAIL</code> (your email address) and <code>GH_NAME</code> (your GitHub username).</li>
|
||||
<li>Create a <code>.travis.yml</code> on the root of your repository with below text.</li>
|
||||
</ol>
|
||||
<pre><code class="hljs css yaml"><span class="hljs-comment"># .travis.yml</span>
|
||||
<span class="hljs-attr">language:</span> <span class="hljs-string">node_js</span>
|
||||
<span class="hljs-attr">node_js:</span>
|
||||
<span class="hljs-bullet"> -</span> <span class="hljs-string">'8'</span>
|
||||
<span class="hljs-attr">branches:</span>
|
||||
<span class="hljs-attr"> only:</span>
|
||||
<span class="hljs-bullet"> -</span> <span class="hljs-string">master</span>
|
||||
<span class="hljs-attr">cache:</span>
|
||||
<span class="hljs-attr"> yarn:</span> <span class="hljs-literal">true</span>
|
||||
<span class="hljs-attr">script:</span>
|
||||
<span class="hljs-bullet"> -</span> <span class="hljs-string">git</span> <span class="hljs-string">config</span> <span class="hljs-bullet">--global</span> <span class="hljs-string">user.name</span> <span class="hljs-string">"${GH_NAME}"</span>
|
||||
<span class="hljs-bullet"> -</span> <span class="hljs-string">git</span> <span class="hljs-string">config</span> <span class="hljs-bullet">--global</span> <span class="hljs-string">user.email</span> <span class="hljs-string">"${GH_EMAIL}"</span>
|
||||
<span class="hljs-bullet"> -</span> <span class="hljs-string">echo</span> <span class="hljs-string">"machine github.com login ${GH_NAME} password ${GH_TOKEN}"</span> <span class="hljs-string">> ~/.netrc
|
||||
- cd website && yarn install && GIT_USER="${GH_NAME}" yarn run publish-gh-pages
|
||||
</span></code></pre>
|
||||
<p>Now, whenever a new commit lands in <code>master</code>, Travis CI will run your suite of tests and, if everything passes, your website will be deployed via the <code>publish-gh-pages</code> script.</p>
|
||||
<h3><a class="anchor" aria-hidden="true" id="hosting-on-netlify"></a><a href="#hosting-on-netlify" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Hosting on Netlify</h3>
|
||||
<p>Steps to configure your Docusaurus-powered site on Netlify.</p>
|
||||
<ol>
|
||||
<li><p>Select <strong>New site from Git</strong></p></li>
|
||||
<li><p>Connect to your preferred Git provider.</p></li>
|
||||
<li><p>Select the branch to deploy. Default is <code>master</code></p></li>
|
||||
<li><p>Configure your build steps:</p>
|
||||
<ul>
|
||||
<li>For your build command enter: <code>cd website; npm install; npm run build;</code></li>
|
||||
<li>For publish directory: <code>website/build/<projectName></code> (use the <code>projectName</code> from your <code>siteConfig</code>)</li>
|
||||
</ul></li>
|
||||
<li><p>Click <strong>Deploy site</strong></p></li>
|
||||
</ol>
|
||||
<p>You can also configure Netlify to rebuild on every commit to your repo, or only <code>master</code> branch commits.</p>
|
||||
<h3><a class="anchor" aria-hidden="true" id="publishing-to-github-enterprise"></a><a href="#publishing-to-github-enterprise" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Publishing to GitHub Enterprise</h3>
|
||||
<p>GitHub enterprise installations should work in the same manner as github.com; you only need to identify the organization's GitHub Enterprise host.</p>
|
||||
<table>
|
||||
<thead>
|
||||
<tr><th>Name</th><th>Description</th></tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr><td><code>GITHUB_HOST</code></td><td>The hostname for the GitHub enterprise server.</td></tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<p>Alter your <code>siteConfig.js</code> to add a property <code>'githubHost'</code> which represents the GitHub Enterprise hostname. Alternatively, set an environment variable <code>GITHUB_HOST</code> when executing the publish command.</p>
|
||||
</span></div></article></div><div class="docs-prevnext"><a class="docs-prev button" href="site-creation">← Creating your site</a><a class="docs-next button" href="blog">Adding a Blog →</a></div></div></div><nav class="onPageNav"><ul class="toc-headings"><li><a href="#building-static-html-pages">Building Static HTML Pages</a></li><li><a href="#hosting-static-html-pages">Hosting Static HTML Pages</a><ul class="toc-headings"><li><a href="#hosting-on-a-service">Hosting on a Service:</a></li><li><a href="#using-github-pages">Using GitHub Pages</a></li></ul></li><li><a href="#automating-deployments-using-continuous-integration">Automating Deployments Using Continuous Integration</a><ul class="toc-headings"><li><a href="#using-circle-ci-20">Using Circle CI 2.0</a></li><li><a href="#tips-tricks">Tips & Tricks</a></li><li><a href="#using-travis-ci">Using Travis CI</a></li><li><a href="#hosting-on-netlify">Hosting on Netlify</a></li><li><a href="#publishing-to-github-enterprise">Publishing to GitHub Enterprise</a></li></ul></li></ul></nav></div><footer class="nav-footer" id="footer"><section class="sitemap"><a href="/" class="nav-home"><img src="/img/docusaurus_monochrome.svg" alt="Docusaurus" width="66" height="58"/></a><div><h5>Docs</h5><a href="
|
||||
/docs/en/installation.html">Getting Started</a><a href="
|
||||
/docs/en/versioning.html">Versioning</a><a href="
|
||||
/docs/en/translation.html">Localization</a><a href="
|
||||
/docs/en/search.html">Adding Search</a></div><div><h5>Community</h5><a href="/en/users.html">User Showcase</a></div><div><h5>More</h5><div class="social"><a class="github-button" href="https://github.com/facebook/Docusaurus" data-count-href="/facebook/Docusaurus/stargazers" data-show-count="true" data-count-aria-label="# stargazers on GitHub" aria-label="Star this project on GitHub">Docusaurus</a></div><div class="social"><a href="https://twitter.com/docusaurus" class="twitter-follow-button">Follow @docusaurus</a></div><div class="social"><div class="fb-like" data-href="https://docusaurus.io" data-layout="standard" data-share="true" data-width="225" data-show-faces="false"></div></div></div></section><a href="https://code.facebook.com/projects/" target="_blank" rel="noreferrer noopener" class="fbOpenSource"><img src="/img/oss_logo.png" alt="Facebook Open Source" width="170" height="45"/></a><section class="copyright"><span>Copyright © 2018 Facebook Inc.</span></section></footer></div><script type="text/javascript" src="https://cdn.jsdelivr.net/docsearch.js/1/docsearch.min.js"></script><script>window.fbAsyncInit = function() {FB.init({appId:'199138890728411',xfbml:true,version:'v2.7'});};(function(d, s, id){var js, fjs = d.getElementsByTagName(s)[0];if (d.getElementById(id)) {return;}js = d.createElement(s); js.id = id;js.src = '//connect.facebook.net/en_US/sdk.js';fjs.parentNode.insertBefore(js, fjs);}(document, 'script','facebook-jssdk'));
|
||||
</script><script>window.twttr=(function(d,s, id){var js,fjs=d.getElementsByTagName(s)[0],t=window.twttr||{};if(d.getElementById(id))return t;js=d.createElement(s);js.id=id;js.src='https://platform.twitter.com/widgets.js';fjs.parentNode.insertBefore(js, fjs);t._e = [];t.ready = function(f) {t._e.push(f);};return t;}(document, 'script', 'twitter-wjs'));</script><script>
|
||||
var search = docsearch({
|
||||
|
||||
apiKey: '3eb9507824b8be89e7a199ecaa1a9d2c',
|
||||
indexName: 'docusaurus',
|
||||
inputSelector: '#search_input_react'
|
||||
});
|
||||
</script></body></html>
|
|
@ -12,7 +12,7 @@
|
|||
{"zIndex":100}
|
||||
)
|
||||
});
|
||||
</script><link rel="stylesheet" href="/css/main.css"/></head><body class="sideNavVisible doc separateOnPageNav"><div class="fixedHeaderContainer"><div class="headerWrapper wrapper"><header><a href="/en"><img class="logo" src="/img/docusaurus.svg" alt="Docusaurus"/><h2 class="headerTitleWithLogo">Docusaurus</h2></a><a href="/en/versions.html"><h3>next</h3></a><div class="navigationWrapper navigationSlider"><nav class="slidingNav"><ul class="nav-site nav-site-internal"><li class="siteNavGroupActive"><a href="/docs/en/next/installation.html" target="_self">Docs</a></li><li class=""><a href="/en/help.html" target="_self">Help</a></li><li class=""><a href="/en/users.html" target="_self">Users</a></li><li class=""><a href="/en/about-slash.html" target="_self">About /</a></li><li class=""><a href="/blog" target="_self">Blog</a></li><li class=""><a href="https://github.com/facebook/docusaurus" target="_self">GitHub</a></li><span><li><a id="languages-menu" href="#"><img class="languages-icon" src="/img/language.svg"/>English</a><div id="languages-dropdown" class="hide"><ul id="languages-dropdown-items"><li><a href="/es-ES">Español</a></li><li><a href="/ro">Română</a></li><li><a href="/tr">Türkçe</a></li><li><a href="/zh-CN">简体中文</a></li><li><a href="https://crowdin.com/project/docusaurus" target="_blank" rel="noreferrer noopener">Help Translate</a></li></ul></div></li><script>
|
||||
</script><link rel="stylesheet" href="/css/main.css"/></head><body class="sideNavVisible doc separateOnPageNav"><div class="fixedHeaderContainer"><div class="headerWrapper wrapper"><header><a href="/en"><img class="logo" src="/img/docusaurus.svg" alt="Docusaurus"/><h2 class="headerTitleWithLogo">Docusaurus</h2></a><a href="/en/versions.html"><h3>next</h3></a><div class="navigationWrapper navigationSlider"><nav class="slidingNav"><ul class="nav-site nav-site-internal"><li class="siteNavGroupActive"><a href="/docs/en/next/installation" target="_self">Docs</a></li><li class=""><a href="/en/help" target="_self">Help</a></li><li class=""><a href="/en/users" target="_self">Users</a></li><li class=""><a href="/en/about-slash" target="_self">About /</a></li><li class=""><a href="/blog" target="_self">Blog</a></li><li class=""><a href="https://github.com/facebook/docusaurus" target="_self">GitHub</a></li><span><li><a id="languages-menu" href="#"><img class="languages-icon" src="/img/language.svg"/>English</a><div id="languages-dropdown" class="hide"><ul id="languages-dropdown-items"><li><a href="/es-ES">Español</a></li><li><a href="/ro">Română</a></li><li><a href="/tr">Türkçe</a></li><li><a href="/zh-CN">简体中文</a></li><li><a href="https://crowdin.com/project/docusaurus" target="_blank" rel="noreferrer noopener">Help Translate</a></li></ul></div></li><script>
|
||||
const languagesMenuItem = document.getElementById("languages-menu");
|
||||
const languagesDropDown = document.getElementById("languages-dropdown");
|
||||
languagesMenuItem.addEventListener("click", function(){
|
||||
|
@ -22,7 +22,7 @@
|
|||
languagesDropDown.className = "hide";
|
||||
}
|
||||
});
|
||||
</script></span><li class="navSearchWrapper reactNavSearchWrapper"><input type="text" id="search_input_react" placeholder="Search" title="Search"/></li></ul></nav></div></header></div></div><div class="navPusher"><div class="docMainWrapper wrapper"><div class="container docsNavContainer" id="docsNav"><nav class="toc"><div class="toggleNav"><section class="navWrapper wrapper"><div class="navBreadcrumb wrapper"><div class="navToggle" id="navToggler"><i></i></div><h2><i>›</i><span>Guides</span></h2></div><div class="navGroups"><div class="navGroup navGroupActive"><h3>Getting Started</h3><ul><li class="navListItem"><a class="navItem" href="/docs/en/next/installation.html">Installation</a></li><li class="navListItem"><a class="navItem" href="/docs/en/next/site-preparation.html">Site Preparation</a></li><li class="navListItem"><a class="navItem" href="/docs/en/next/site-creation.html">Creating your site</a></li><li class="navListItem"><a class="navItem" href="/docs/en/next/publishing.html">Publishing your site</a></li></ul></div><div class="navGroup navGroupActive"><h3>Guides</h3><ul><li class="navListItem"><a class="navItem" href="/docs/en/next/blog.html">Adding a Blog</a></li><li class="navListItem"><a class="navItem" href="/docs/en/next/custom-pages.html">Custom Pages</a></li><li class="navListItem navListItemActive"><a class="navItem navItemActive" href="/docs/en/next/search.html">Enabling Search</a></li><li class="navListItem"><a class="navItem" href="/docs/en/next/navigation.html">Navigation and Sidebars</a></li><li class="navListItem"><a class="navItem" href="/docs/en/next/translation.html">Translations & Localization</a></li><li class="navListItem"><a class="navItem" href="/docs/en/next/versioning.html">Versioning</a></li></ul></div><div class="navGroup navGroupActive"><h3>API</h3><ul><li class="navListItem"><a class="navItem" href="/docs/en/next/commands.html">CLI Commands</a></li><li class="navListItem"><a class="navItem" href="/docs/en/next/doc-markdown.html">Markdown Features</a></li><li class="navListItem"><a class="navItem" href="/docs/en/next/api-pages.html">Pages and Styles</a></li><li class="navListItem"><a class="navItem" href="/docs/en/next/site-config.html">siteConfig.js</a></li></ul></div></div></section></div><script>
|
||||
</script></span><li class="navSearchWrapper reactNavSearchWrapper"><input type="text" id="search_input_react" placeholder="Search" title="Search"/></li></ul></nav></div></header></div></div><div class="navPusher"><div class="docMainWrapper wrapper"><div class="container docsNavContainer" id="docsNav"><nav class="toc"><div class="toggleNav"><section class="navWrapper wrapper"><div class="navBreadcrumb wrapper"><div class="navToggle" id="navToggler"><i></i></div><h2><i>›</i><span>Guides</span></h2></div><div class="navGroups"><div class="navGroup navGroupActive"><h3>Getting Started</h3><ul><li class="navListItem"><a class="navItem" href="/docs/en/next/installation">Installation</a></li><li class="navListItem"><a class="navItem" href="/docs/en/next/site-preparation">Site Preparation</a></li><li class="navListItem"><a class="navItem" href="/docs/en/next/site-creation">Creating your site</a></li><li class="navListItem"><a class="navItem" href="/docs/en/next/publishing">Publishing your site</a></li></ul></div><div class="navGroup navGroupActive"><h3>Guides</h3><ul><li class="navListItem"><a class="navItem" href="/docs/en/next/blog">Adding a Blog</a></li><li class="navListItem"><a class="navItem" href="/docs/en/next/custom-pages">Custom Pages</a></li><li class="navListItem navListItemActive"><a class="navItem navItemActive" href="/docs/en/next/search">Enabling Search</a></li><li class="navListItem"><a class="navItem" href="/docs/en/next/navigation">Navigation and Sidebars</a></li><li class="navListItem"><a class="navItem" href="/docs/en/next/translation">Translations & Localization</a></li><li class="navListItem"><a class="navItem" href="/docs/en/next/versioning">Versioning</a></li></ul></div><div class="navGroup navGroupActive"><h3>API</h3><ul><li class="navListItem"><a class="navItem" href="/docs/en/next/commands">CLI Commands</a></li><li class="navListItem"><a class="navItem" href="/docs/en/next/doc-markdown">Markdown Features</a></li><li class="navListItem"><a class="navItem" href="/docs/en/next/api-pages">Pages and Styles</a></li><li class="navListItem"><a class="navItem" href="/docs/en/next/site-config">siteConfig.js</a></li></ul></div></div></section></div><script>
|
||||
var toggler = document.getElementById('navToggler');
|
||||
var nav = document.getElementById('docsNav');
|
||||
toggler.onclick = function() {
|
||||
|
@ -61,7 +61,7 @@
|
|||
<h2><a class="anchor" aria-hidden="true" id="disabling-the-search-bar"></a><a href="#disabling-the-search-bar" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Disabling the Search Bar</h2>
|
||||
<p>To disable the search bar, comment out (recommended) or delete the <code>algolia</code> section in the <code>siteConfig.js</code> file.</p>
|
||||
<p>Also, if you have customized the location of the search bar in <code>headerLinks</code>, set <code>search: false</code>.</p>
|
||||
</span></div></article></div><div class="docs-prevnext"><a class="docs-prev button" href="custom-pages.html">← Custom Pages</a><a class="docs-next button" href="navigation.html">Navigation and Sidebars →</a></div></div></div><nav class="onPageNav"><ul class="toc-headings"><li><a href="#enabling-the-search-bar">Enabling the Search Bar</a></li><li><a href="#controlling-the-location-of-the-search-bar">Controlling the Location of the Search Bar</a></li><li><a href="#disabling-the-search-bar">Disabling the Search Bar</a></li></ul></nav></div><footer class="nav-footer" id="footer"><section class="sitemap"><a href="/" class="nav-home"><img src="/img/docusaurus_monochrome.svg" alt="Docusaurus" width="66" height="58"/></a><div><h5>Docs</h5><a href="
|
||||
</span></div></article></div><div class="docs-prevnext"><a class="docs-prev button" href="custom-pages">← Custom Pages</a><a class="docs-next button" href="navigation">Navigation and Sidebars →</a></div></div></div><nav class="onPageNav"><ul class="toc-headings"><li><a href="#enabling-the-search-bar">Enabling the Search Bar</a></li><li><a href="#controlling-the-location-of-the-search-bar">Controlling the Location of the Search Bar</a></li><li><a href="#disabling-the-search-bar">Disabling the Search Bar</a></li></ul></nav></div><footer class="nav-footer" id="footer"><section class="sitemap"><a href="/" class="nav-home"><img src="/img/docusaurus_monochrome.svg" alt="Docusaurus" width="66" height="58"/></a><div><h5>Docs</h5><a href="
|
||||
/docs/en/installation.html">Getting Started</a><a href="
|
||||
/docs/en/versioning.html">Versioning</a><a href="
|
||||
/docs/en/translation.html">Localization</a><a href="
|
||||
|
|
76
docs/en/next/search/index.html
Normal file
76
docs/en/next/search/index.html
Normal file
|
@ -0,0 +1,76 @@
|
|||
<!DOCTYPE html><html lang="en"><head><meta charSet="utf-8"/><meta http-equiv="X-UA-Compatible" content="IE=edge"/><title>Enabling Search · Docusaurus</title><meta name="viewport" content="width=device-width"/><meta name="generator" content="Docusaurus"/><meta property="og:title" content="Enabling Search · Docusaurus"/><meta property="og:type" content="website"/><meta property="og:url" content="https://docusaurus.io/index.html"/><meta property="og:description" content="Docusaurus supports search using [Algolia DocSearch](https://community.algolia.com/docsearch/). Once your website is online, you can [submit it to DocSearch](https://community.algolia.com/docsearch/). Algolia will then send you credentials you can add to your `siteConfig.js`."/><meta property="og:image" content="https://docusaurus.io/img/docusaurus.png"/><meta name="twitter:card" content="summary"/><meta name="twitter:image" content="https://docusaurus.io/img/docusaurus.png"/><link rel="shortcut icon" href="/img/docusaurus.ico"/><link rel="stylesheet" href="https://cdn.jsdelivr.net/docsearch.js/1/docsearch.min.css"/><link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/highlight.js/9.12.0/styles/atom-one-dark.min.css"/><link rel="alternate" type="application/atom+xml" href="https://docusaurus.io/blog/atom.xml" title="Docusaurus Blog ATOM Feed"/><link rel="alternate" type="application/rss+xml" href="https://docusaurus.io/blog/feed.xml" title="Docusaurus Blog RSS Feed"/><script>
|
||||
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
|
||||
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
|
||||
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
|
||||
})(window,document,'script','https://www.google-analytics.com/analytics.js','ga');
|
||||
|
||||
ga('create', 'UA-44373548-31', 'auto');
|
||||
ga('send', 'pageview');
|
||||
</script><link rel="stylesheet" href="/css/code-blocks-buttons.css"/><script type="text/javascript" src="https://buttons.github.io/buttons.js"></script><script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/clipboard.js/2.0.0/clipboard.min.js"></script><script type="text/javascript" src="/js/code-blocks-buttons.js"></script><script src="https://unpkg.com/vanilla-back-to-top@7.1.14/dist/vanilla-back-to-top.min.js"></script><script>
|
||||
document.addEventListener("DOMContentLoaded", function(){
|
||||
addBackToTop(
|
||||
{"zIndex":100}
|
||||
)
|
||||
});
|
||||
</script><link rel="stylesheet" href="/css/main.css"/></head><body class="sideNavVisible doc separateOnPageNav"><div class="fixedHeaderContainer"><div class="headerWrapper wrapper"><header><a href="/en"><img class="logo" src="/img/docusaurus.svg" alt="Docusaurus"/><h2 class="headerTitleWithLogo">Docusaurus</h2></a><a href="/en/versions.html"><h3>next</h3></a><div class="navigationWrapper navigationSlider"><nav class="slidingNav"><ul class="nav-site nav-site-internal"><li class="siteNavGroupActive"><a href="/docs/en/next/installation" target="_self">Docs</a></li><li class=""><a href="/en/help" target="_self">Help</a></li><li class=""><a href="/en/users" target="_self">Users</a></li><li class=""><a href="/en/about-slash" target="_self">About /</a></li><li class=""><a href="/blog" target="_self">Blog</a></li><li class=""><a href="https://github.com/facebook/docusaurus" target="_self">GitHub</a></li><span><li><a id="languages-menu" href="#"><img class="languages-icon" src="/img/language.svg"/>English</a><div id="languages-dropdown" class="hide"><ul id="languages-dropdown-items"><li><a href="/es-ES">Español</a></li><li><a href="/ro">Română</a></li><li><a href="/tr">Türkçe</a></li><li><a href="/zh-CN">简体中文</a></li><li><a href="https://crowdin.com/project/docusaurus" target="_blank" rel="noreferrer noopener">Help Translate</a></li></ul></div></li><script>
|
||||
const languagesMenuItem = document.getElementById("languages-menu");
|
||||
const languagesDropDown = document.getElementById("languages-dropdown");
|
||||
languagesMenuItem.addEventListener("click", function(){
|
||||
if(languagesDropDown.className == "hide") {
|
||||
languagesDropDown.className = "visible";
|
||||
} else {
|
||||
languagesDropDown.className = "hide";
|
||||
}
|
||||
});
|
||||
</script></span><li class="navSearchWrapper reactNavSearchWrapper"><input type="text" id="search_input_react" placeholder="Search" title="Search"/></li></ul></nav></div></header></div></div><div class="navPusher"><div class="docMainWrapper wrapper"><div class="container docsNavContainer" id="docsNav"><nav class="toc"><div class="toggleNav"><section class="navWrapper wrapper"><div class="navBreadcrumb wrapper"><div class="navToggle" id="navToggler"><i></i></div><h2><i>›</i><span>Guides</span></h2></div><div class="navGroups"><div class="navGroup navGroupActive"><h3>Getting Started</h3><ul><li class="navListItem"><a class="navItem" href="/docs/en/next/installation">Installation</a></li><li class="navListItem"><a class="navItem" href="/docs/en/next/site-preparation">Site Preparation</a></li><li class="navListItem"><a class="navItem" href="/docs/en/next/site-creation">Creating your site</a></li><li class="navListItem"><a class="navItem" href="/docs/en/next/publishing">Publishing your site</a></li></ul></div><div class="navGroup navGroupActive"><h3>Guides</h3><ul><li class="navListItem"><a class="navItem" href="/docs/en/next/blog">Adding a Blog</a></li><li class="navListItem"><a class="navItem" href="/docs/en/next/custom-pages">Custom Pages</a></li><li class="navListItem navListItemActive"><a class="navItem navItemActive" href="/docs/en/next/search">Enabling Search</a></li><li class="navListItem"><a class="navItem" href="/docs/en/next/navigation">Navigation and Sidebars</a></li><li class="navListItem"><a class="navItem" href="/docs/en/next/translation">Translations & Localization</a></li><li class="navListItem"><a class="navItem" href="/docs/en/next/versioning">Versioning</a></li></ul></div><div class="navGroup navGroupActive"><h3>API</h3><ul><li class="navListItem"><a class="navItem" href="/docs/en/next/commands">CLI Commands</a></li><li class="navListItem"><a class="navItem" href="/docs/en/next/doc-markdown">Markdown Features</a></li><li class="navListItem"><a class="navItem" href="/docs/en/next/api-pages">Pages and Styles</a></li><li class="navListItem"><a class="navItem" href="/docs/en/next/site-config">siteConfig.js</a></li></ul></div></div></section></div><script>
|
||||
var toggler = document.getElementById('navToggler');
|
||||
var nav = document.getElementById('docsNav');
|
||||
toggler.onclick = function() {
|
||||
nav.classList.toggle('docsSliderActive');
|
||||
};
|
||||
</script></nav></div><div class="container mainContainer"><div class="wrapper"><div class="post"><header class="postHeader"><a class="edit-page-link button" href="https://github.com/facebook/docusaurus/edit/master/docs/guides-search.md" target="_blank" rel="noreferrer noopener">Edit</a><h1>Enabling Search</h1></header><article><div><span><p>Docusaurus supports search using <a href="https://community.algolia.com/docsearch/">Algolia DocSearch</a>. Once your website is online, you can <a href="https://community.algolia.com/docsearch/">submit it to DocSearch</a>. Algolia will then send you credentials you can add to your <code>siteConfig.js</code>.</p>
|
||||
<p>DocSearch works by crawling the content of your website every 24 hours and putting all the content in an Algolia index. This content is then queried directly from your front-end using the Algolia API. Note that your website need to be publicly available for this to work (ie. not behind a firewall). This service is free.</p>
|
||||
<h2><a class="anchor" aria-hidden="true" id="enabling-the-search-bar"></a><a href="#enabling-the-search-bar" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Enabling the Search Bar</h2>
|
||||
<p>Enter your API key and index name (sent by Algolia) into <code>siteConfig.js</code> in the <code>algolia</code> section to enable search for your site.</p>
|
||||
<pre><code class="hljs css js"><span class="hljs-keyword">const</span> siteConfig = {
|
||||
...
|
||||
algolia: {
|
||||
<span class="hljs-attr">apiKey</span>: <span class="hljs-string">'my-api-key'</span>,
|
||||
<span class="hljs-attr">indexName</span>: <span class="hljs-string">'my-index-name'</span>,
|
||||
<span class="hljs-attr">algoliaOptions</span>: {} <span class="hljs-comment">// Optional, if provided by Algolia</span>
|
||||
},
|
||||
...
|
||||
};
|
||||
</code></pre>
|
||||
<p>Algolia might provide you with <a href="https://community.algolia.com/docsearch/documentation/">extra search options</a>. If so, you should add them to the <code>algoliaOptions</code> object.</p>
|
||||
<h2><a class="anchor" aria-hidden="true" id="controlling-the-location-of-the-search-bar"></a><a href="#controlling-the-location-of-the-search-bar" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Controlling the Location of the Search Bar</h2>
|
||||
<p>By default, the search bar will be the rightmost element in the top navigation bar.</p>
|
||||
<p>If you want to change the default location, add the <code>searchBar</code> flag in the <code>headerLinks</code> field of <code>siteConfig.js</code> in your desired location. For example, you may want the search bar between your internal and external links.</p>
|
||||
<pre><code class="hljs css js"><span class="hljs-keyword">const</span> siteConfig = {
|
||||
...
|
||||
headerLinks: [
|
||||
{...}
|
||||
{...}
|
||||
{ <span class="hljs-attr">search</span>: <span class="hljs-literal">true</span> }
|
||||
{...}
|
||||
{...}
|
||||
],
|
||||
...
|
||||
};
|
||||
</code></pre>
|
||||
<h2><a class="anchor" aria-hidden="true" id="disabling-the-search-bar"></a><a href="#disabling-the-search-bar" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Disabling the Search Bar</h2>
|
||||
<p>To disable the search bar, comment out (recommended) or delete the <code>algolia</code> section in the <code>siteConfig.js</code> file.</p>
|
||||
<p>Also, if you have customized the location of the search bar in <code>headerLinks</code>, set <code>search: false</code>.</p>
|
||||
</span></div></article></div><div class="docs-prevnext"><a class="docs-prev button" href="custom-pages">← Custom Pages</a><a class="docs-next button" href="navigation">Navigation and Sidebars →</a></div></div></div><nav class="onPageNav"><ul class="toc-headings"><li><a href="#enabling-the-search-bar">Enabling the Search Bar</a></li><li><a href="#controlling-the-location-of-the-search-bar">Controlling the Location of the Search Bar</a></li><li><a href="#disabling-the-search-bar">Disabling the Search Bar</a></li></ul></nav></div><footer class="nav-footer" id="footer"><section class="sitemap"><a href="/" class="nav-home"><img src="/img/docusaurus_monochrome.svg" alt="Docusaurus" width="66" height="58"/></a><div><h5>Docs</h5><a href="
|
||||
/docs/en/installation.html">Getting Started</a><a href="
|
||||
/docs/en/versioning.html">Versioning</a><a href="
|
||||
/docs/en/translation.html">Localization</a><a href="
|
||||
/docs/en/search.html">Adding Search</a></div><div><h5>Community</h5><a href="/en/users.html">User Showcase</a></div><div><h5>More</h5><div class="social"><a class="github-button" href="https://github.com/facebook/Docusaurus" data-count-href="/facebook/Docusaurus/stargazers" data-show-count="true" data-count-aria-label="# stargazers on GitHub" aria-label="Star this project on GitHub">Docusaurus</a></div><div class="social"><a href="https://twitter.com/docusaurus" class="twitter-follow-button">Follow @docusaurus</a></div><div class="social"><div class="fb-like" data-href="https://docusaurus.io" data-layout="standard" data-share="true" data-width="225" data-show-faces="false"></div></div></div></section><a href="https://code.facebook.com/projects/" target="_blank" rel="noreferrer noopener" class="fbOpenSource"><img src="/img/oss_logo.png" alt="Facebook Open Source" width="170" height="45"/></a><section class="copyright"><span>Copyright © 2018 Facebook Inc.</span></section></footer></div><script type="text/javascript" src="https://cdn.jsdelivr.net/docsearch.js/1/docsearch.min.js"></script><script>window.fbAsyncInit = function() {FB.init({appId:'199138890728411',xfbml:true,version:'v2.7'});};(function(d, s, id){var js, fjs = d.getElementsByTagName(s)[0];if (d.getElementById(id)) {return;}js = d.createElement(s); js.id = id;js.src = '//connect.facebook.net/en_US/sdk.js';fjs.parentNode.insertBefore(js, fjs);}(document, 'script','facebook-jssdk'));
|
||||
</script><script>window.twttr=(function(d,s, id){var js,fjs=d.getElementsByTagName(s)[0],t=window.twttr||{};if(d.getElementById(id))return t;js=d.createElement(s);js.id=id;js.src='https://platform.twitter.com/widgets.js';fjs.parentNode.insertBefore(js, fjs);t._e = [];t.ready = function(f) {t._e.push(f);};return t;}(document, 'script', 'twitter-wjs'));</script><script>
|
||||
var search = docsearch({
|
||||
|
||||
apiKey: '3eb9507824b8be89e7a199ecaa1a9d2c',
|
||||
indexName: 'docusaurus',
|
||||
inputSelector: '#search_input_react'
|
||||
});
|
||||
</script></body></html>
|
|
@ -12,7 +12,7 @@
|
|||
{"zIndex":100}
|
||||
)
|
||||
});
|
||||
</script><link rel="stylesheet" href="/css/main.css"/></head><body class="sideNavVisible doc separateOnPageNav"><div class="fixedHeaderContainer"><div class="headerWrapper wrapper"><header><a href="/en"><img class="logo" src="/img/docusaurus.svg" alt="Docusaurus"/><h2 class="headerTitleWithLogo">Docusaurus</h2></a><a href="/en/versions.html"><h3>next</h3></a><div class="navigationWrapper navigationSlider"><nav class="slidingNav"><ul class="nav-site nav-site-internal"><li class="siteNavGroupActive"><a href="/docs/en/next/installation.html" target="_self">Docs</a></li><li class=""><a href="/en/help.html" target="_self">Help</a></li><li class=""><a href="/en/users.html" target="_self">Users</a></li><li class=""><a href="/en/about-slash.html" target="_self">About /</a></li><li class=""><a href="/blog" target="_self">Blog</a></li><li class=""><a href="https://github.com/facebook/docusaurus" target="_self">GitHub</a></li><span><li><a id="languages-menu" href="#"><img class="languages-icon" src="/img/language.svg"/>English</a><div id="languages-dropdown" class="hide"><ul id="languages-dropdown-items"><li><a href="/es-ES">Español</a></li><li><a href="/ro">Română</a></li><li><a href="/tr">Türkçe</a></li><li><a href="/zh-CN">简体中文</a></li><li><a href="https://crowdin.com/project/docusaurus" target="_blank" rel="noreferrer noopener">Help Translate</a></li></ul></div></li><script>
|
||||
</script><link rel="stylesheet" href="/css/main.css"/></head><body class="sideNavVisible doc separateOnPageNav"><div class="fixedHeaderContainer"><div class="headerWrapper wrapper"><header><a href="/en"><img class="logo" src="/img/docusaurus.svg" alt="Docusaurus"/><h2 class="headerTitleWithLogo">Docusaurus</h2></a><a href="/en/versions.html"><h3>next</h3></a><div class="navigationWrapper navigationSlider"><nav class="slidingNav"><ul class="nav-site nav-site-internal"><li class="siteNavGroupActive"><a href="/docs/en/next/installation" target="_self">Docs</a></li><li class=""><a href="/en/help" target="_self">Help</a></li><li class=""><a href="/en/users" target="_self">Users</a></li><li class=""><a href="/en/about-slash" target="_self">About /</a></li><li class=""><a href="/blog" target="_self">Blog</a></li><li class=""><a href="https://github.com/facebook/docusaurus" target="_self">GitHub</a></li><span><li><a id="languages-menu" href="#"><img class="languages-icon" src="/img/language.svg"/>English</a><div id="languages-dropdown" class="hide"><ul id="languages-dropdown-items"><li><a href="/es-ES">Español</a></li><li><a href="/ro">Română</a></li><li><a href="/tr">Türkçe</a></li><li><a href="/zh-CN">简体中文</a></li><li><a href="https://crowdin.com/project/docusaurus" target="_blank" rel="noreferrer noopener">Help Translate</a></li></ul></div></li><script>
|
||||
const languagesMenuItem = document.getElementById("languages-menu");
|
||||
const languagesDropDown = document.getElementById("languages-dropdown");
|
||||
languagesMenuItem.addEventListener("click", function(){
|
||||
|
@ -22,7 +22,7 @@
|
|||
languagesDropDown.className = "hide";
|
||||
}
|
||||
});
|
||||
</script></span><li class="navSearchWrapper reactNavSearchWrapper"><input type="text" id="search_input_react" placeholder="Search" title="Search"/></li></ul></nav></div></header></div></div><div class="navPusher"><div class="docMainWrapper wrapper"><div class="container docsNavContainer" id="docsNav"><nav class="toc"><div class="toggleNav"><section class="navWrapper wrapper"><div class="navBreadcrumb wrapper"><div class="navToggle" id="navToggler"><i></i></div><h2><i>›</i><span>API</span></h2></div><div class="navGroups"><div class="navGroup navGroupActive"><h3>Getting Started</h3><ul><li class="navListItem"><a class="navItem" href="/docs/en/next/installation.html">Installation</a></li><li class="navListItem"><a class="navItem" href="/docs/en/next/site-preparation.html">Site Preparation</a></li><li class="navListItem"><a class="navItem" href="/docs/en/next/site-creation.html">Creating your site</a></li><li class="navListItem"><a class="navItem" href="/docs/en/next/publishing.html">Publishing your site</a></li></ul></div><div class="navGroup navGroupActive"><h3>Guides</h3><ul><li class="navListItem"><a class="navItem" href="/docs/en/next/blog.html">Adding a Blog</a></li><li class="navListItem"><a class="navItem" href="/docs/en/next/custom-pages.html">Custom Pages</a></li><li class="navListItem"><a class="navItem" href="/docs/en/next/search.html">Enabling Search</a></li><li class="navListItem"><a class="navItem" href="/docs/en/next/navigation.html">Navigation and Sidebars</a></li><li class="navListItem"><a class="navItem" href="/docs/en/next/translation.html">Translations & Localization</a></li><li class="navListItem"><a class="navItem" href="/docs/en/next/versioning.html">Versioning</a></li></ul></div><div class="navGroup navGroupActive"><h3>API</h3><ul><li class="navListItem"><a class="navItem" href="/docs/en/next/commands.html">CLI Commands</a></li><li class="navListItem"><a class="navItem" href="/docs/en/next/doc-markdown.html">Markdown Features</a></li><li class="navListItem"><a class="navItem" href="/docs/en/next/api-pages.html">Pages and Styles</a></li><li class="navListItem navListItemActive"><a class="navItem navItemActive" href="/docs/en/next/site-config.html">siteConfig.js</a></li></ul></div></div></section></div><script>
|
||||
</script></span><li class="navSearchWrapper reactNavSearchWrapper"><input type="text" id="search_input_react" placeholder="Search" title="Search"/></li></ul></nav></div></header></div></div><div class="navPusher"><div class="docMainWrapper wrapper"><div class="container docsNavContainer" id="docsNav"><nav class="toc"><div class="toggleNav"><section class="navWrapper wrapper"><div class="navBreadcrumb wrapper"><div class="navToggle" id="navToggler"><i></i></div><h2><i>›</i><span>API</span></h2></div><div class="navGroups"><div class="navGroup navGroupActive"><h3>Getting Started</h3><ul><li class="navListItem"><a class="navItem" href="/docs/en/next/installation">Installation</a></li><li class="navListItem"><a class="navItem" href="/docs/en/next/site-preparation">Site Preparation</a></li><li class="navListItem"><a class="navItem" href="/docs/en/next/site-creation">Creating your site</a></li><li class="navListItem"><a class="navItem" href="/docs/en/next/publishing">Publishing your site</a></li></ul></div><div class="navGroup navGroupActive"><h3>Guides</h3><ul><li class="navListItem"><a class="navItem" href="/docs/en/next/blog">Adding a Blog</a></li><li class="navListItem"><a class="navItem" href="/docs/en/next/custom-pages">Custom Pages</a></li><li class="navListItem"><a class="navItem" href="/docs/en/next/search">Enabling Search</a></li><li class="navListItem"><a class="navItem" href="/docs/en/next/navigation">Navigation and Sidebars</a></li><li class="navListItem"><a class="navItem" href="/docs/en/next/translation">Translations & Localization</a></li><li class="navListItem"><a class="navItem" href="/docs/en/next/versioning">Versioning</a></li></ul></div><div class="navGroup navGroupActive"><h3>API</h3><ul><li class="navListItem"><a class="navItem" href="/docs/en/next/commands">CLI Commands</a></li><li class="navListItem"><a class="navItem" href="/docs/en/next/doc-markdown">Markdown Features</a></li><li class="navListItem"><a class="navItem" href="/docs/en/next/api-pages">Pages and Styles</a></li><li class="navListItem navListItemActive"><a class="navItem navItemActive" href="/docs/en/next/site-config">siteConfig.js</a></li></ul></div></div></section></div><script>
|
||||
var toggler = document.getElementById('navToggler');
|
||||
var nav = document.getElementById('docsNav');
|
||||
toggler.onclick = function() {
|
||||
|
@ -75,7 +75,8 @@
|
|||
<li><code>indexName</code> - the Algolia provided index name for your search (usually this is the project name)</li>
|
||||
<li><code>appId</code> - Algolia provides a default scraper for your docs. If you provide your own, you will probably get this id from them.</li>
|
||||
</ul>
|
||||
<p><code>blogSidebarCount</code> - Control the number of blog posts that show up in the sidebar. See the <a href="/docs/en/next/blog.html#changing-how-many-blog-posts-show-on-sidebar">adding a blog docs</a> for more information.</p>
|
||||
<p><code>blogSidebarCount</code> - Control the number of blog posts that show up in the sidebar. See the <a href="/docs/en/next/blog#changing-how-many-blog-posts-show-on-sidebar">adding a blog docs</a> for more information.</p>
|
||||
<p><code>cleanUrl</code> - If <code>true</code>, allow URLs with no <code>html</code> extension. Example: request to URL <a href="https://docusaurus.io/docs/installation">https://docusaurus.io/docs/installation</a> will returns the same result as <a href="https://docusaurus.io/docs/installation.html">https://docusaurus.io/docs/installation.html</a>.</p>
|
||||
<p><code>cname</code> - The CNAME for your website. It will go into a <code>CNAME</code> file when your site it built.</p>
|
||||
<p><code>customDocsPath</code> - By default, Docusaurus expects your documentation to be in a directory called <code>docs</code>. This directory is at the same level as the <code>website</code> directory (i.e., not inside the <code>website</code> directory). You can specify a custom path to your documentation with this field. <strong>Note that all of your documentation <code>*.md</code> files must still reside in a flat hierarchy. You cannot have your documents in nested directories</strong>.</p>
|
||||
<pre><code class="hljs css js">customDocsPath: <span class="hljs-string">'docs/site'</span>;
|
||||
|
@ -111,7 +112,7 @@
|
|||
<p><code>gaTrackingId</code> - Google Analytics tracking ID to track page views.</p>
|
||||
<p><code>gaGtag</code> - Set this to <code>true</code> if you want to use <a href="https://developers.google.com/gtagjs/">global site tags (gtag.js)</a> for Google analytics instead of <code>analytics.js</code>.</p>
|
||||
<p><code>githubHost</code> - Hostname of your server. Useful if you are using GitHub Enterprise.</p>
|
||||
<p><code>highlight</code> - <a href="/docs/en/next/doc-markdown.html">Syntax highlighting</a> options:</p>
|
||||
<p><code>highlight</code> - <a href="/docs/en/next/doc-markdown">Syntax highlighting</a> options:</p>
|
||||
<ul>
|
||||
<li><code>theme</code> is the name of the theme used by Highlight.js when highlighting code. You can find the <a href="https://github.com/isagalaev/highlight.js/tree/master/src/styles">list of supported themes here</a>.</li>
|
||||
<li><code>version</code> specifies a particular version of Highlight.js to be used.</li>
|
||||
|
@ -134,7 +135,7 @@
|
|||
<p><code>twitter</code> - Set this to <code>true</code> if you want a Twitter social button to appear at the bottom of your blog posts.</p>
|
||||
<p><code>twitterUsername</code> - If you want a Twitter follow button at the bottom of your page, provide a Twitter username to follow. For example: <code>docusaurus</code>.</p>
|
||||
<p><code>twitterImage</code> - Local path to your Twitter card image (e.g., <code>img/myImage.png</code>). This image will show up on the Twitter card when your site is shared on Twitter.</p>
|
||||
<p><code>useEnglishUrl</code> - If you do not have <a href="/docs/en/next/translation.html">translations</a> enabled (e.g., by having a <code>languages.js</code> file), but still want a link of the form <code>/docs/en/doc.html</code> (with the <code>en</code>), set this to <code>true</code>.</p>
|
||||
<p><code>useEnglishUrl</code> - If you do not have <a href="/docs/en/next/translation">translations</a> enabled (e.g., by having a <code>languages.js</code> file), but still want a link of the form <code>/docs/en/doc.html</code> (with the <code>en</code>), set this to <code>true</code>.</p>
|
||||
<p><code>users</code> - The <code>users</code> array mentioned earlier.</p>
|
||||
<p><code>wrapPagesHTML</code> - Boolean flag to indicate whether <code>html</code> files in <code>/pages</code> should be wrapped with Docusaurus site styles, header and footer. This feature is experimental and relies on the files being <code>html</code> fragments instead of complete pages. It inserts the contents of your <code>html</code> file with no extra processing. Defaults to <code>false</code>.</p>
|
||||
<p>Users can also add their own custom fields if they wish to provide some data across different files.</p>
|
||||
|
@ -211,6 +212,7 @@
|
|||
<span class="hljs-attr">twitterUsername</span>: <span class="hljs-string">'docusaurus'</span>,
|
||||
<span class="hljs-attr">twitterImage</span>: <span class="hljs-string">'img/docusaurus.png'</span>,
|
||||
<span class="hljs-attr">ogImage</span>: <span class="hljs-string">'img/docusaurus.png'</span>,
|
||||
<span class="hljs-attr">cleanUrl</span>: <span class="hljs-literal">true</span>,
|
||||
<span class="hljs-attr">scrollToTop</span>: <span class="hljs-literal">true</span>,
|
||||
<span class="hljs-attr">scrollToTopOptions</span>: {
|
||||
<span class="hljs-attr">zIndex</span>: <span class="hljs-number">100</span>
|
||||
|
@ -219,7 +221,7 @@
|
|||
|
||||
<span class="hljs-built_in">module</span>.exports = siteConfig;
|
||||
</code></pre>
|
||||
</span></div></article></div><div class="docs-prevnext"><a class="docs-prev button" href="api-pages.html">← Pages and Styles</a></div></div></div><nav class="onPageNav"><ul class="toc-headings"><li><a href="#user-showcase">User Showcase</a></li><li><a href="#siteconfig-fields">siteConfig Fields</a><ul class="toc-headings"><li><a href="#mandatory-fields">Mandatory Fields</a></li><li><a href="#optional-fields">Optional Fields</a></li></ul></li><li><a href="#example-siteconfigjs-with-many-available-fields">Example siteConfig.js with many available fields</a></li></ul></nav></div><footer class="nav-footer" id="footer"><section class="sitemap"><a href="/" class="nav-home"><img src="/img/docusaurus_monochrome.svg" alt="Docusaurus" width="66" height="58"/></a><div><h5>Docs</h5><a href="
|
||||
</span></div></article></div><div class="docs-prevnext"><a class="docs-prev button" href="api-pages">← Pages and Styles</a></div></div></div><nav class="onPageNav"><ul class="toc-headings"><li><a href="#user-showcase">User Showcase</a></li><li><a href="#siteconfig-fields">siteConfig Fields</a><ul class="toc-headings"><li><a href="#mandatory-fields">Mandatory Fields</a></li><li><a href="#optional-fields">Optional Fields</a></li></ul></li><li><a href="#example-siteconfigjs-with-many-available-fields">Example siteConfig.js with many available fields</a></li></ul></nav></div><footer class="nav-footer" id="footer"><section class="sitemap"><a href="/" class="nav-home"><img src="/img/docusaurus_monochrome.svg" alt="Docusaurus" width="66" height="58"/></a><div><h5>Docs</h5><a href="
|
||||
/docs/en/installation.html">Getting Started</a><a href="
|
||||
/docs/en/versioning.html">Versioning</a><a href="
|
||||
/docs/en/translation.html">Localization</a><a href="
|
||||
|
|
236
docs/en/next/site-config/index.html
Normal file
236
docs/en/next/site-config/index.html
Normal file
|
@ -0,0 +1,236 @@
|
|||
<!DOCTYPE html><html lang="en"><head><meta charSet="utf-8"/><meta http-equiv="X-UA-Compatible" content="IE=edge"/><title>siteConfig.js · Docusaurus</title><meta name="viewport" content="width=device-width"/><meta name="generator" content="Docusaurus"/><meta property="og:title" content="siteConfig.js · Docusaurus"/><meta property="og:type" content="website"/><meta property="og:url" content="https://docusaurus.io/index.html"/><meta property="og:description" content="A large part of site configuration is done by editing the `siteConfig.js` file."/><meta property="og:image" content="https://docusaurus.io/img/docusaurus.png"/><meta name="twitter:card" content="summary"/><meta name="twitter:image" content="https://docusaurus.io/img/docusaurus.png"/><link rel="shortcut icon" href="/img/docusaurus.ico"/><link rel="stylesheet" href="https://cdn.jsdelivr.net/docsearch.js/1/docsearch.min.css"/><link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/highlight.js/9.12.0/styles/atom-one-dark.min.css"/><link rel="alternate" type="application/atom+xml" href="https://docusaurus.io/blog/atom.xml" title="Docusaurus Blog ATOM Feed"/><link rel="alternate" type="application/rss+xml" href="https://docusaurus.io/blog/feed.xml" title="Docusaurus Blog RSS Feed"/><script>
|
||||
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
|
||||
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
|
||||
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
|
||||
})(window,document,'script','https://www.google-analytics.com/analytics.js','ga');
|
||||
|
||||
ga('create', 'UA-44373548-31', 'auto');
|
||||
ga('send', 'pageview');
|
||||
</script><link rel="stylesheet" href="/css/code-blocks-buttons.css"/><script type="text/javascript" src="https://buttons.github.io/buttons.js"></script><script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/clipboard.js/2.0.0/clipboard.min.js"></script><script type="text/javascript" src="/js/code-blocks-buttons.js"></script><script src="https://unpkg.com/vanilla-back-to-top@7.1.14/dist/vanilla-back-to-top.min.js"></script><script>
|
||||
document.addEventListener("DOMContentLoaded", function(){
|
||||
addBackToTop(
|
||||
{"zIndex":100}
|
||||
)
|
||||
});
|
||||
</script><link rel="stylesheet" href="/css/main.css"/></head><body class="sideNavVisible doc separateOnPageNav"><div class="fixedHeaderContainer"><div class="headerWrapper wrapper"><header><a href="/en"><img class="logo" src="/img/docusaurus.svg" alt="Docusaurus"/><h2 class="headerTitleWithLogo">Docusaurus</h2></a><a href="/en/versions.html"><h3>next</h3></a><div class="navigationWrapper navigationSlider"><nav class="slidingNav"><ul class="nav-site nav-site-internal"><li class="siteNavGroupActive"><a href="/docs/en/next/installation" target="_self">Docs</a></li><li class=""><a href="/en/help" target="_self">Help</a></li><li class=""><a href="/en/users" target="_self">Users</a></li><li class=""><a href="/en/about-slash" target="_self">About /</a></li><li class=""><a href="/blog" target="_self">Blog</a></li><li class=""><a href="https://github.com/facebook/docusaurus" target="_self">GitHub</a></li><span><li><a id="languages-menu" href="#"><img class="languages-icon" src="/img/language.svg"/>English</a><div id="languages-dropdown" class="hide"><ul id="languages-dropdown-items"><li><a href="/es-ES">Español</a></li><li><a href="/ro">Română</a></li><li><a href="/tr">Türkçe</a></li><li><a href="/zh-CN">简体中文</a></li><li><a href="https://crowdin.com/project/docusaurus" target="_blank" rel="noreferrer noopener">Help Translate</a></li></ul></div></li><script>
|
||||
const languagesMenuItem = document.getElementById("languages-menu");
|
||||
const languagesDropDown = document.getElementById("languages-dropdown");
|
||||
languagesMenuItem.addEventListener("click", function(){
|
||||
if(languagesDropDown.className == "hide") {
|
||||
languagesDropDown.className = "visible";
|
||||
} else {
|
||||
languagesDropDown.className = "hide";
|
||||
}
|
||||
});
|
||||
</script></span><li class="navSearchWrapper reactNavSearchWrapper"><input type="text" id="search_input_react" placeholder="Search" title="Search"/></li></ul></nav></div></header></div></div><div class="navPusher"><div class="docMainWrapper wrapper"><div class="container docsNavContainer" id="docsNav"><nav class="toc"><div class="toggleNav"><section class="navWrapper wrapper"><div class="navBreadcrumb wrapper"><div class="navToggle" id="navToggler"><i></i></div><h2><i>›</i><span>API</span></h2></div><div class="navGroups"><div class="navGroup navGroupActive"><h3>Getting Started</h3><ul><li class="navListItem"><a class="navItem" href="/docs/en/next/installation">Installation</a></li><li class="navListItem"><a class="navItem" href="/docs/en/next/site-preparation">Site Preparation</a></li><li class="navListItem"><a class="navItem" href="/docs/en/next/site-creation">Creating your site</a></li><li class="navListItem"><a class="navItem" href="/docs/en/next/publishing">Publishing your site</a></li></ul></div><div class="navGroup navGroupActive"><h3>Guides</h3><ul><li class="navListItem"><a class="navItem" href="/docs/en/next/blog">Adding a Blog</a></li><li class="navListItem"><a class="navItem" href="/docs/en/next/custom-pages">Custom Pages</a></li><li class="navListItem"><a class="navItem" href="/docs/en/next/search">Enabling Search</a></li><li class="navListItem"><a class="navItem" href="/docs/en/next/navigation">Navigation and Sidebars</a></li><li class="navListItem"><a class="navItem" href="/docs/en/next/translation">Translations & Localization</a></li><li class="navListItem"><a class="navItem" href="/docs/en/next/versioning">Versioning</a></li></ul></div><div class="navGroup navGroupActive"><h3>API</h3><ul><li class="navListItem"><a class="navItem" href="/docs/en/next/commands">CLI Commands</a></li><li class="navListItem"><a class="navItem" href="/docs/en/next/doc-markdown">Markdown Features</a></li><li class="navListItem"><a class="navItem" href="/docs/en/next/api-pages">Pages and Styles</a></li><li class="navListItem navListItemActive"><a class="navItem navItemActive" href="/docs/en/next/site-config">siteConfig.js</a></li></ul></div></div></section></div><script>
|
||||
var toggler = document.getElementById('navToggler');
|
||||
var nav = document.getElementById('docsNav');
|
||||
toggler.onclick = function() {
|
||||
nav.classList.toggle('docsSliderActive');
|
||||
};
|
||||
</script></nav></div><div class="container mainContainer"><div class="wrapper"><div class="post"><header class="postHeader"><a class="edit-page-link button" href="https://github.com/facebook/docusaurus/edit/master/docs/api-site-config.md" target="_blank" rel="noreferrer noopener">Edit</a><h1>siteConfig.js</h1></header><article><div><span><p>A large part of site configuration is done by editing the <code>siteConfig.js</code> file.</p>
|
||||
<h2><a class="anchor" aria-hidden="true" id="user-showcase"></a><a href="#user-showcase" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>User Showcase</h2>
|
||||
<p>The <code>users</code> array is used to store objects for each project/user that you want to show on your site. Currently this field is used by example the <code>pages/en/index.js</code> and <code>pages/en/users.js</code> files provided. Each user object should have <code>caption</code>, <code>image</code>, <code>infoLink</code>, and <code>pinned</code> fields. The <code>caption</code> is the text showed when someone hovers over the <code>image</code> of that user, and the <code>infoLink</code> is where clicking the image will bring someone. The <code>pinned</code> field determines whether or not it shows up on the <code>index</code> page.</p>
|
||||
<p>Currently this <code>users</code> array is used only by the <code>index.js</code> and <code>users.js</code> example files. If you do not wish to have a users page or show users on the <code>index</code> page, you may remove this section.</p>
|
||||
<h2><a class="anchor" aria-hidden="true" id="siteconfig-fields"></a><a href="#siteconfig-fields" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>siteConfig Fields</h2>
|
||||
<p>The <code>siteConfig</code> object contains the bulk of the configuration settings for your website.</p>
|
||||
<h3><a class="anchor" aria-hidden="true" id="mandatory-fields"></a><a href="#mandatory-fields" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Mandatory Fields</h3>
|
||||
<p><code>baseUrl</code> - baseUrl for your site.</p>
|
||||
<p><code>colors</code> - Color configurations for the site.</p>
|
||||
<ul>
|
||||
<li><code>primaryColor</code> is the color used the header navigation bar and sidebars.</li>
|
||||
<li><code>secondaryColor</code> is the color seen in the second row of the header navigation bar when the site window is narrow (including on mobile).</li>
|
||||
<li>Custom color configurations can also be added. For example, if user styles are added with colors specified as <code>$myColor</code>, then adding a <code>myColor</code> field to <code>colors</code> will allow you to easily configure this color.</li>
|
||||
</ul>
|
||||
<p><code>copyright</code> - The copyright string at footer of site and within feed</p>
|
||||
<p><code>favicon</code> - url for site favicon.</p>
|
||||
<p><code>headerIcon</code> - url for icon used in header navigation bar.</p>
|
||||
<p><code>headerLinks</code> - Links that will be used in the header navigation bar. The <code>label</code> field of each object will be the link text and will also be translated for each language.</p>
|
||||
<p>Example Usage:</p>
|
||||
<pre><code class="hljs css js">headerLinks: [
|
||||
<span class="hljs-comment">// Links to document with id doc1 for current language/version</span>
|
||||
{ <span class="hljs-attr">doc</span>: <span class="hljs-string">"doc1"</span>, <span class="hljs-attr">label</span>: <span class="hljs-string">"Getting Started"</span> },
|
||||
<span class="hljs-comment">// Link to page found at pages/en/help.js or if that does not exist, pages/help.js, for current language</span>
|
||||
{ <span class="hljs-attr">page</span>: <span class="hljs-string">"help"</span>, <span class="hljs-attr">label</span>: <span class="hljs-string">"Help"</span> },
|
||||
<span class="hljs-comment">// Links to href destination</span>
|
||||
{ <span class="hljs-attr">href</span>: <span class="hljs-string">"https://github.com/"</span>, <span class="hljs-attr">label</span>: <span class="hljs-string">"GitHub"</span> },
|
||||
<span class="hljs-comment">// Links to blog generated by Docusaurus (${baseUrl}blog)</span>
|
||||
{ <span class="hljs-attr">blog</span>: <span class="hljs-literal">true</span>, <span class="hljs-attr">label</span>: <span class="hljs-string">"Blog"</span> },
|
||||
<span class="hljs-comment">// Determines search bar position among links</span>
|
||||
{ <span class="hljs-attr">search</span>: <span class="hljs-literal">true</span> },
|
||||
<span class="hljs-comment">// Determines language drop down position among links</span>
|
||||
{ <span class="hljs-attr">languages</span>: <span class="hljs-literal">true</span> }
|
||||
],
|
||||
</code></pre>
|
||||
<p><code>noIndex</code> - Boolean. If true, Docusaurus will politely ask crawlers and search engines to avoid indexing your site. This is done with a header tag and so only applies to docs and pages. Will not attempt to hide static resources. This is a best effort request. Malicious crawlers can and will still index your site.</p>
|
||||
<p><code>organizationName</code> - GitHub username of the organization or user hosting this project. This is used by the publishing script to determine where your GitHub pages website will be hosted.</p>
|
||||
<p><code>projectName</code> - Project name. This must match your GitHub repo project name (case sensitive).</p>
|
||||
<p><code>tagline</code> - Tagline for your website.</p>
|
||||
<p><code>title</code> - Title for your website.</p>
|
||||
<p><code>url</code> - URL for your website.</p>
|
||||
<h3><a class="anchor" aria-hidden="true" id="optional-fields"></a><a href="#optional-fields" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Optional Fields</h3>
|
||||
<p><code>algolia</code> - Information for Algolia search integration. If this field is excluded, the search bar will not appear in the header. You must specify two values for this field, and one (<code>appId</code>) is optional.</p>
|
||||
<ul>
|
||||
<li><code>apiKey</code> - the Algolia provided API key for your search.</li>
|
||||
<li><code>indexName</code> - the Algolia provided index name for your search (usually this is the project name)</li>
|
||||
<li><code>appId</code> - Algolia provides a default scraper for your docs. If you provide your own, you will probably get this id from them.</li>
|
||||
</ul>
|
||||
<p><code>blogSidebarCount</code> - Control the number of blog posts that show up in the sidebar. See the <a href="/docs/en/next/blog#changing-how-many-blog-posts-show-on-sidebar">adding a blog docs</a> for more information.</p>
|
||||
<p><code>cleanUrl</code> - If <code>true</code>, allow URLs with no <code>html</code> extension. Example: request to URL <a href="https://docusaurus.io/docs/installation">https://docusaurus.io/docs/installation</a> will returns the same result as <a href="https://docusaurus.io/docs/installation.html">https://docusaurus.io/docs/installation.html</a>.</p>
|
||||
<p><code>cname</code> - The CNAME for your website. It will go into a <code>CNAME</code> file when your site it built.</p>
|
||||
<p><code>customDocsPath</code> - By default, Docusaurus expects your documentation to be in a directory called <code>docs</code>. This directory is at the same level as the <code>website</code> directory (i.e., not inside the <code>website</code> directory). You can specify a custom path to your documentation with this field. <strong>Note that all of your documentation <code>*.md</code> files must still reside in a flat hierarchy. You cannot have your documents in nested directories</strong>.</p>
|
||||
<pre><code class="hljs css js">customDocsPath: <span class="hljs-string">'docs/site'</span>;
|
||||
</code></pre>
|
||||
<pre><code class="hljs css js">customDocsPath: <span class="hljs-string">'website-docs'</span>;
|
||||
</code></pre>
|
||||
<p><code>defaultVersionShown</code> - The default version for the site to be shown. If this is not set, the latest version will be shown.</p>
|
||||
<p><code>disableHeaderTitle</code> - An option to disable showing the title in the header next to the header icon. Exclude this field to keep the header as normal, otherwise set to <code>true</code>.</p>
|
||||
<p><code>disableTitleTagline</code> - An option to disable showing the tagline in the title of main pages. Exclude this field to keep page titles as <code>Title • Tagline</code>. Set to <code>true</code> to make page titles just <code>Title</code>.</p>
|
||||
<p><code>editUrl</code> - url for editing docs, usage example: <code>editUrl + 'en/doc1.md'</code>. If this field is omitted, there will be no "Edit this Doc" button for each document.</p>
|
||||
<p><code>facebookAppId</code> - If you want Facebook Like/Share buttons in the footer and at the bottom of your blog posts, provide a <a href="https://www.facebook.com/help/audiencenetwork/804209223039296">Facebook application id</a>.</p>
|
||||
<p><code>facebookComments</code> - Set this to <code>true</code> if you want to enable Facebook comments at the bottom of your blog post. <code>facebookAppId</code> has to be also set.</p>
|
||||
<p><code>facebookPixelId</code> - <a href="https://www.facebook.com/business/a/facebook-pixel">Facebook Pixel</a> ID to track page views.</p>
|
||||
<p><code>fonts</code> - Font-family css configuration for the site. If a font family is specified in <code>siteConfig.js</code> as <code>$myFont</code>, then adding a <code>myFont</code> key to an array in <code>fonts</code> will allow you to configure the font. Items appearing earlier in the array will take priority of later elements, so ordering of the fonts matter.</p>
|
||||
<p>In the below example, we have two sets of font configurations, <code>myFont</code> and <code>myOtherFont</code>. <code>Times New Roman</code> is the preferred font in <code>myFont</code>. <code>-apple-system</code> is the preferred in <code>myOtherFont</code>.</p>
|
||||
<pre><code class="hljs css js">fonts: {
|
||||
<span class="hljs-attr">myFont</span>: [
|
||||
<span class="hljs-string">'Times New Roman'</span>,
|
||||
<span class="hljs-string">'Serif'</span>
|
||||
],
|
||||
<span class="hljs-attr">myOtherFont</span>: [
|
||||
<span class="hljs-string">'-apple-system'</span>,
|
||||
<span class="hljs-string">'system-ui'</span>
|
||||
]
|
||||
},
|
||||
</code></pre>
|
||||
<p>The above fonts would be represented in your CSS file(s) as variables <code>$myFont</code> and <code>$myOtherFont</code>.</p>
|
||||
<pre><code class="hljs css css"><span class="hljs-selector-tag">h1</span> {
|
||||
<span class="hljs-attribute">font-family</span>: $myFont;
|
||||
}
|
||||
</code></pre>
|
||||
<p><code>footerIcon</code> - URL for a footer icon. Currently used in the <code>core/Footer.js</code> file provided as an example, but it can be removed from that file.</p>
|
||||
<p><code>gaTrackingId</code> - Google Analytics tracking ID to track page views.</p>
|
||||
<p><code>gaGtag</code> - Set this to <code>true</code> if you want to use <a href="https://developers.google.com/gtagjs/">global site tags (gtag.js)</a> for Google analytics instead of <code>analytics.js</code>.</p>
|
||||
<p><code>githubHost</code> - Hostname of your server. Useful if you are using GitHub Enterprise.</p>
|
||||
<p><code>highlight</code> - <a href="/docs/en/next/doc-markdown">Syntax highlighting</a> options:</p>
|
||||
<ul>
|
||||
<li><code>theme</code> is the name of the theme used by Highlight.js when highlighting code. You can find the <a href="https://github.com/isagalaev/highlight.js/tree/master/src/styles">list of supported themes here</a>.</li>
|
||||
<li><code>version</code> specifies a particular version of Highlight.js to be used.</li>
|
||||
<li><code>hljs</code> provides an escape valve by passing an instance of Highlight.js to the function specified here, allowing additional languages to be registered for syntax highlighting.</li>
|
||||
<li><code>defaultLang</code> defines a default language. It will be used if one is not specified at the top of the code block. You can find the <a href="https://github.com/isagalaev/highlight.js/tree/master/src/languages">list of supported languages here</a>.</li>
|
||||
<li><code>themeUrl</code> is the custom URL of CSS theme file that you want to use with Highlight.js. If this is provided, the <code>theme</code> and <code>version</code> fields will be ignored.</li>
|
||||
</ul>
|
||||
<p><code>markdownPlugins</code> - An array of plugins to be loaded by Remarkable, the markdown parser and renderer used by Docusaurus. The plugin will receive a reference to the Remarkable instance, allowing custom parsing and rendering rules to be defined.</p>
|
||||
<p><code>ogImage</code> - Local path to an Open Graph image (e.g., <code>img/myImage.png</code>). This image will show up when your site is shared on Facebook and other websites/apps where the Open Graph protocol is supported.</p>
|
||||
<p><code>onPageNav</code> - If you want a visible navigation option for representing topics on the current page. Currently, there is one accepted value for this option:</p>
|
||||
<ul>
|
||||
<li><code>separate</code> - The secondary navigation is a separate pane defaulting on the right side of a document. See <a href="http://docusaurus.io/docs/en/translation.html">http://docusaurus.io/docs/en/translation.html</a> for an example.</li>
|
||||
</ul>
|
||||
<p><code>scripts</code> - Array of JavaScript sources to load. The script tag will be inserted in the HTML head.</p>
|
||||
<p><code>separateCss</code> - Folders inside which any <code>css</code> files will not be processed and concatenated to Docusaurus' styles. This is to support static <code>html</code> pages that may be separate from Docusaurus with completely separate styles.</p>
|
||||
<p><code>scrollToTop</code> - Set this to <code>true</code> if you want to enable the scroll to top button at the bottom of your site.</p>
|
||||
<p><code>scrollToTopOptions</code> - Optional options configuration for the scroll to top button. You do not need to use this, even if you set <code>scrollToTop</code> to <code>true</code>; it just provides you more configuration control of the button. You can find more options <a href="https://github.com/vfeskov/vanilla-back-to-top/blob/v7.1.14/OPTIONS.md">here</a>. By default, we set the zIndex option to 100.</p>
|
||||
<p><code>stylesheets</code> - Array of CSS sources to load. The link tag will be inserted in the HTML head.</p>
|
||||
<p><code>translationRecruitingLink</code> - URL for the <code>Help Translate</code> tab of language selection when languages besides English are enabled. This can be included you are using translations but does not have to be.</p>
|
||||
<p><code>twitter</code> - Set this to <code>true</code> if you want a Twitter social button to appear at the bottom of your blog posts.</p>
|
||||
<p><code>twitterUsername</code> - If you want a Twitter follow button at the bottom of your page, provide a Twitter username to follow. For example: <code>docusaurus</code>.</p>
|
||||
<p><code>twitterImage</code> - Local path to your Twitter card image (e.g., <code>img/myImage.png</code>). This image will show up on the Twitter card when your site is shared on Twitter.</p>
|
||||
<p><code>useEnglishUrl</code> - If you do not have <a href="/docs/en/next/translation">translations</a> enabled (e.g., by having a <code>languages.js</code> file), but still want a link of the form <code>/docs/en/doc.html</code> (with the <code>en</code>), set this to <code>true</code>.</p>
|
||||
<p><code>users</code> - The <code>users</code> array mentioned earlier.</p>
|
||||
<p><code>wrapPagesHTML</code> - Boolean flag to indicate whether <code>html</code> files in <code>/pages</code> should be wrapped with Docusaurus site styles, header and footer. This feature is experimental and relies on the files being <code>html</code> fragments instead of complete pages. It inserts the contents of your <code>html</code> file with no extra processing. Defaults to <code>false</code>.</p>
|
||||
<p>Users can also add their own custom fields if they wish to provide some data across different files.</p>
|
||||
<h2><a class="anchor" aria-hidden="true" id="example-siteconfigjs-with-many-available-fields"></a><a href="#example-siteconfigjs-with-many-available-fields" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Example siteConfig.js with many available fields</h2>
|
||||
<pre><code class="hljs css js"><span class="hljs-keyword">const</span> users = [
|
||||
{
|
||||
<span class="hljs-attr">caption</span>: <span class="hljs-string">'User1'</span>,
|
||||
<span class="hljs-attr">image</span>: <span class="hljs-string">'/test-site/img/docusaurus.svg'</span>,
|
||||
<span class="hljs-attr">infoLink</span>: <span class="hljs-string">'https://www.example.com'</span>,
|
||||
<span class="hljs-attr">pinned</span>: <span class="hljs-literal">true</span>,
|
||||
},
|
||||
];
|
||||
|
||||
<span class="hljs-keyword">const</span> siteConfig = {
|
||||
<span class="hljs-attr">title</span>: <span class="hljs-string">'Docusaurus'</span>,
|
||||
<span class="hljs-attr">tagline</span>: <span class="hljs-string">'Generate websites!'</span>,
|
||||
<span class="hljs-attr">url</span>: <span class="hljs-string">'https://docusaurus.io'</span>,
|
||||
<span class="hljs-attr">baseUrl</span>: <span class="hljs-string">'/'</span>,
|
||||
<span class="hljs-comment">// For github.io type URLS, you would combine the url and baseUrl like:</span>
|
||||
<span class="hljs-comment">// url: 'https://reasonml.github.io',</span>
|
||||
<span class="hljs-comment">// baseUrl: '/reason-react/',</span>
|
||||
defaultVersionShown: <span class="hljs-string">'1.0.0'</span>,
|
||||
<span class="hljs-attr">organizationName</span>: <span class="hljs-string">'facebook'</span>,
|
||||
<span class="hljs-attr">projectName</span>: <span class="hljs-string">'docusaurus'</span>,
|
||||
<span class="hljs-attr">noIndex</span>: <span class="hljs-literal">false</span>,
|
||||
<span class="hljs-comment">// For no header links in the top nav bar -> headerLinks: [],</span>
|
||||
headerLinks: [
|
||||
{<span class="hljs-attr">doc</span>: <span class="hljs-string">'doc1'</span>, <span class="hljs-attr">label</span>: <span class="hljs-string">'Docs'</span>},
|
||||
{<span class="hljs-attr">page</span>: <span class="hljs-string">'help'</span>, <span class="hljs-attr">label</span>: <span class="hljs-string">'Help'</span>},
|
||||
{<span class="hljs-attr">search</span>: <span class="hljs-literal">true</span>},
|
||||
{<span class="hljs-attr">blog</span>: <span class="hljs-literal">true</span>},
|
||||
],
|
||||
<span class="hljs-attr">headerIcon</span>: <span class="hljs-string">'img/docusaurus.svg'</span>,
|
||||
<span class="hljs-attr">favicon</span>: <span class="hljs-string">'img/favicon.png'</span>,
|
||||
<span class="hljs-attr">colors</span>: {
|
||||
<span class="hljs-attr">primaryColor</span>: <span class="hljs-string">'#2E8555'</span>,
|
||||
<span class="hljs-attr">secondaryColor</span>: <span class="hljs-string">'#205C3B'</span>,
|
||||
},
|
||||
<span class="hljs-attr">editUrl</span>: <span class="hljs-string">'https://github.com/facebook/docusaurus/edit/master/docs/'</span>,
|
||||
<span class="hljs-comment">// Users variable set above</span>
|
||||
users,
|
||||
<span class="hljs-attr">disableHeaderTitle</span>: <span class="hljs-literal">true</span>,
|
||||
<span class="hljs-attr">disableTitleTagline</span>: <span class="hljs-literal">true</span>,
|
||||
<span class="hljs-attr">separateCss</span>: [<span class="hljs-string">'static/css/non-docusaurus'</span>, <span class="hljs-string">'static/assets/separate-css'</span>],
|
||||
<span class="hljs-attr">footerIcon</span>: <span class="hljs-string">'img/docusaurus.svg'</span>,
|
||||
<span class="hljs-attr">translationRecruitingLink</span>: <span class="hljs-string">'https://crowdin.com/project/docusaurus'</span>,
|
||||
<span class="hljs-attr">algolia</span>: {
|
||||
<span class="hljs-attr">apiKey</span>: <span class="hljs-string">'0f9f28b9ab9efae89810921a351753b5'</span>,
|
||||
<span class="hljs-attr">indexName</span>: <span class="hljs-string">'github'</span>,
|
||||
},
|
||||
<span class="hljs-attr">gaTrackingId</span>: <span class="hljs-string">'UA-12345678-9'</span>,
|
||||
<span class="hljs-attr">highlight</span>: {
|
||||
<span class="hljs-attr">theme</span>: <span class="hljs-string">'default'</span>,
|
||||
},
|
||||
<span class="hljs-attr">markdownPlugins</span>: [
|
||||
<span class="hljs-function"><span class="hljs-keyword">function</span> <span class="hljs-title">foo</span>(<span class="hljs-params">md</span>) </span>{
|
||||
md.renderer.rules.fence_custom.foo = <span class="hljs-function"><span class="hljs-keyword">function</span>(<span class="hljs-params">
|
||||
tokens,
|
||||
idx,
|
||||
options,
|
||||
env,
|
||||
instance
|
||||
</span>) </span>{
|
||||
<span class="hljs-keyword">return</span> <span class="hljs-string">'<div class="foo">bar</div>'</span>;
|
||||
};
|
||||
},
|
||||
],
|
||||
<span class="hljs-attr">scripts</span>: [<span class="hljs-string">'https://docusaurus.io/slash.js'</span>],
|
||||
<span class="hljs-attr">stylesheets</span>: [<span class="hljs-string">'https://docusaurus.io/style.css'</span>],
|
||||
<span class="hljs-attr">facebookAppId</span>: <span class="hljs-string">'1615782811974223'</span>,
|
||||
<span class="hljs-attr">facebookComments</span>: <span class="hljs-literal">true</span>,
|
||||
<span class="hljs-attr">facebookPixelId</span>: <span class="hljs-string">'352490515235776'</span>,
|
||||
<span class="hljs-attr">twitter</span>: <span class="hljs-string">'true'</span>,
|
||||
<span class="hljs-attr">twitterUsername</span>: <span class="hljs-string">'docusaurus'</span>,
|
||||
<span class="hljs-attr">twitterImage</span>: <span class="hljs-string">'img/docusaurus.png'</span>,
|
||||
<span class="hljs-attr">ogImage</span>: <span class="hljs-string">'img/docusaurus.png'</span>,
|
||||
<span class="hljs-attr">cleanUrl</span>: <span class="hljs-literal">true</span>,
|
||||
<span class="hljs-attr">scrollToTop</span>: <span class="hljs-literal">true</span>,
|
||||
<span class="hljs-attr">scrollToTopOptions</span>: {
|
||||
<span class="hljs-attr">zIndex</span>: <span class="hljs-number">100</span>
|
||||
}
|
||||
};
|
||||
|
||||
<span class="hljs-built_in">module</span>.exports = siteConfig;
|
||||
</code></pre>
|
||||
</span></div></article></div><div class="docs-prevnext"><a class="docs-prev button" href="api-pages">← Pages and Styles</a></div></div></div><nav class="onPageNav"><ul class="toc-headings"><li><a href="#user-showcase">User Showcase</a></li><li><a href="#siteconfig-fields">siteConfig Fields</a><ul class="toc-headings"><li><a href="#mandatory-fields">Mandatory Fields</a></li><li><a href="#optional-fields">Optional Fields</a></li></ul></li><li><a href="#example-siteconfigjs-with-many-available-fields">Example siteConfig.js with many available fields</a></li></ul></nav></div><footer class="nav-footer" id="footer"><section class="sitemap"><a href="/" class="nav-home"><img src="/img/docusaurus_monochrome.svg" alt="Docusaurus" width="66" height="58"/></a><div><h5>Docs</h5><a href="
|
||||
/docs/en/installation.html">Getting Started</a><a href="
|
||||
/docs/en/versioning.html">Versioning</a><a href="
|
||||
/docs/en/translation.html">Localization</a><a href="
|
||||
/docs/en/search.html">Adding Search</a></div><div><h5>Community</h5><a href="/en/users.html">User Showcase</a></div><div><h5>More</h5><div class="social"><a class="github-button" href="https://github.com/facebook/Docusaurus" data-count-href="/facebook/Docusaurus/stargazers" data-show-count="true" data-count-aria-label="# stargazers on GitHub" aria-label="Star this project on GitHub">Docusaurus</a></div><div class="social"><a href="https://twitter.com/docusaurus" class="twitter-follow-button">Follow @docusaurus</a></div><div class="social"><div class="fb-like" data-href="https://docusaurus.io" data-layout="standard" data-share="true" data-width="225" data-show-faces="false"></div></div></div></section><a href="https://code.facebook.com/projects/" target="_blank" rel="noreferrer noopener" class="fbOpenSource"><img src="/img/oss_logo.png" alt="Facebook Open Source" width="170" height="45"/></a><section class="copyright"><span>Copyright © 2018 Facebook Inc.</span></section></footer></div><script type="text/javascript" src="https://cdn.jsdelivr.net/docsearch.js/1/docsearch.min.js"></script><script>window.fbAsyncInit = function() {FB.init({appId:'199138890728411',xfbml:true,version:'v2.7'});};(function(d, s, id){var js, fjs = d.getElementsByTagName(s)[0];if (d.getElementById(id)) {return;}js = d.createElement(s); js.id = id;js.src = '//connect.facebook.net/en_US/sdk.js';fjs.parentNode.insertBefore(js, fjs);}(document, 'script','facebook-jssdk'));
|
||||
</script><script>window.twttr=(function(d,s, id){var js,fjs=d.getElementsByTagName(s)[0],t=window.twttr||{};if(d.getElementById(id))return t;js=d.createElement(s);js.id=id;js.src='https://platform.twitter.com/widgets.js';fjs.parentNode.insertBefore(js, fjs);t._e = [];t.ready = function(f) {t._e.push(f);};return t;}(document, 'script', 'twitter-wjs'));</script><script>
|
||||
var search = docsearch({
|
||||
|
||||
apiKey: '3eb9507824b8be89e7a199ecaa1a9d2c',
|
||||
indexName: 'docusaurus',
|
||||
inputSelector: '#search_input_react'
|
||||
});
|
||||
</script></body></html>
|
|
@ -12,7 +12,7 @@
|
|||
{"zIndex":100}
|
||||
)
|
||||
});
|
||||
</script><link rel="stylesheet" href="/css/main.css"/></head><body class="sideNavVisible doc separateOnPageNav"><div class="fixedHeaderContainer"><div class="headerWrapper wrapper"><header><a href="/en"><img class="logo" src="/img/docusaurus.svg" alt="Docusaurus"/><h2 class="headerTitleWithLogo">Docusaurus</h2></a><a href="/en/versions.html"><h3>next</h3></a><div class="navigationWrapper navigationSlider"><nav class="slidingNav"><ul class="nav-site nav-site-internal"><li class="siteNavGroupActive"><a href="/docs/en/next/installation.html" target="_self">Docs</a></li><li class=""><a href="/en/help.html" target="_self">Help</a></li><li class=""><a href="/en/users.html" target="_self">Users</a></li><li class=""><a href="/en/about-slash.html" target="_self">About /</a></li><li class=""><a href="/blog" target="_self">Blog</a></li><li class=""><a href="https://github.com/facebook/docusaurus" target="_self">GitHub</a></li><span><li><a id="languages-menu" href="#"><img class="languages-icon" src="/img/language.svg"/>English</a><div id="languages-dropdown" class="hide"><ul id="languages-dropdown-items"><li><a href="/es-ES">Español</a></li><li><a href="/ro">Română</a></li><li><a href="/tr">Türkçe</a></li><li><a href="/zh-CN">简体中文</a></li><li><a href="https://crowdin.com/project/docusaurus" target="_blank" rel="noreferrer noopener">Help Translate</a></li></ul></div></li><script>
|
||||
</script><link rel="stylesheet" href="/css/main.css"/></head><body class="sideNavVisible doc separateOnPageNav"><div class="fixedHeaderContainer"><div class="headerWrapper wrapper"><header><a href="/en"><img class="logo" src="/img/docusaurus.svg" alt="Docusaurus"/><h2 class="headerTitleWithLogo">Docusaurus</h2></a><a href="/en/versions.html"><h3>next</h3></a><div class="navigationWrapper navigationSlider"><nav class="slidingNav"><ul class="nav-site nav-site-internal"><li class="siteNavGroupActive"><a href="/docs/en/next/installation" target="_self">Docs</a></li><li class=""><a href="/en/help" target="_self">Help</a></li><li class=""><a href="/en/users" target="_self">Users</a></li><li class=""><a href="/en/about-slash" target="_self">About /</a></li><li class=""><a href="/blog" target="_self">Blog</a></li><li class=""><a href="https://github.com/facebook/docusaurus" target="_self">GitHub</a></li><span><li><a id="languages-menu" href="#"><img class="languages-icon" src="/img/language.svg"/>English</a><div id="languages-dropdown" class="hide"><ul id="languages-dropdown-items"><li><a href="/es-ES">Español</a></li><li><a href="/ro">Română</a></li><li><a href="/tr">Türkçe</a></li><li><a href="/zh-CN">简体中文</a></li><li><a href="https://crowdin.com/project/docusaurus" target="_blank" rel="noreferrer noopener">Help Translate</a></li></ul></div></li><script>
|
||||
const languagesMenuItem = document.getElementById("languages-menu");
|
||||
const languagesDropDown = document.getElementById("languages-dropdown");
|
||||
languagesMenuItem.addEventListener("click", function(){
|
||||
|
@ -22,14 +22,14 @@
|
|||
languagesDropDown.className = "hide";
|
||||
}
|
||||
});
|
||||
</script></span><li class="navSearchWrapper reactNavSearchWrapper"><input type="text" id="search_input_react" placeholder="Search" title="Search"/></li></ul></nav></div></header></div></div><div class="navPusher"><div class="docMainWrapper wrapper"><div class="container docsNavContainer" id="docsNav"><nav class="toc"><div class="toggleNav"><section class="navWrapper wrapper"><div class="navBreadcrumb wrapper"><div class="navToggle" id="navToggler"><i></i></div><h2><i>›</i><span>Getting Started</span></h2></div><div class="navGroups"><div class="navGroup navGroupActive"><h3>Getting Started</h3><ul><li class="navListItem"><a class="navItem" href="/docs/en/next/installation.html">Installation</a></li><li class="navListItem"><a class="navItem" href="/docs/en/next/site-preparation.html">Site Preparation</a></li><li class="navListItem navListItemActive"><a class="navItem navItemActive" href="/docs/en/next/site-creation.html">Creating your site</a></li><li class="navListItem"><a class="navItem" href="/docs/en/next/publishing.html">Publishing your site</a></li></ul></div><div class="navGroup navGroupActive"><h3>Guides</h3><ul><li class="navListItem"><a class="navItem" href="/docs/en/next/blog.html">Adding a Blog</a></li><li class="navListItem"><a class="navItem" href="/docs/en/next/custom-pages.html">Custom Pages</a></li><li class="navListItem"><a class="navItem" href="/docs/en/next/search.html">Enabling Search</a></li><li class="navListItem"><a class="navItem" href="/docs/en/next/navigation.html">Navigation and Sidebars</a></li><li class="navListItem"><a class="navItem" href="/docs/en/next/translation.html">Translations & Localization</a></li><li class="navListItem"><a class="navItem" href="/docs/en/next/versioning.html">Versioning</a></li></ul></div><div class="navGroup navGroupActive"><h3>API</h3><ul><li class="navListItem"><a class="navItem" href="/docs/en/next/commands.html">CLI Commands</a></li><li class="navListItem"><a class="navItem" href="/docs/en/next/doc-markdown.html">Markdown Features</a></li><li class="navListItem"><a class="navItem" href="/docs/en/next/api-pages.html">Pages and Styles</a></li><li class="navListItem"><a class="navItem" href="/docs/en/next/site-config.html">siteConfig.js</a></li></ul></div></div></section></div><script>
|
||||
</script></span><li class="navSearchWrapper reactNavSearchWrapper"><input type="text" id="search_input_react" placeholder="Search" title="Search"/></li></ul></nav></div></header></div></div><div class="navPusher"><div class="docMainWrapper wrapper"><div class="container docsNavContainer" id="docsNav"><nav class="toc"><div class="toggleNav"><section class="navWrapper wrapper"><div class="navBreadcrumb wrapper"><div class="navToggle" id="navToggler"><i></i></div><h2><i>›</i><span>Getting Started</span></h2></div><div class="navGroups"><div class="navGroup navGroupActive"><h3>Getting Started</h3><ul><li class="navListItem"><a class="navItem" href="/docs/en/next/installation">Installation</a></li><li class="navListItem"><a class="navItem" href="/docs/en/next/site-preparation">Site Preparation</a></li><li class="navListItem navListItemActive"><a class="navItem navItemActive" href="/docs/en/next/site-creation">Creating your site</a></li><li class="navListItem"><a class="navItem" href="/docs/en/next/publishing">Publishing your site</a></li></ul></div><div class="navGroup navGroupActive"><h3>Guides</h3><ul><li class="navListItem"><a class="navItem" href="/docs/en/next/blog">Adding a Blog</a></li><li class="navListItem"><a class="navItem" href="/docs/en/next/custom-pages">Custom Pages</a></li><li class="navListItem"><a class="navItem" href="/docs/en/next/search">Enabling Search</a></li><li class="navListItem"><a class="navItem" href="/docs/en/next/navigation">Navigation and Sidebars</a></li><li class="navListItem"><a class="navItem" href="/docs/en/next/translation">Translations & Localization</a></li><li class="navListItem"><a class="navItem" href="/docs/en/next/versioning">Versioning</a></li></ul></div><div class="navGroup navGroupActive"><h3>API</h3><ul><li class="navListItem"><a class="navItem" href="/docs/en/next/commands">CLI Commands</a></li><li class="navListItem"><a class="navItem" href="/docs/en/next/doc-markdown">Markdown Features</a></li><li class="navListItem"><a class="navItem" href="/docs/en/next/api-pages">Pages and Styles</a></li><li class="navListItem"><a class="navItem" href="/docs/en/next/site-config">siteConfig.js</a></li></ul></div></div></section></div><script>
|
||||
var toggler = document.getElementById('navToggler');
|
||||
var nav = document.getElementById('docsNav');
|
||||
toggler.onclick = function() {
|
||||
nav.classList.toggle('docsSliderActive');
|
||||
};
|
||||
</script></nav></div><div class="container mainContainer"><div class="wrapper"><div class="post"><header class="postHeader"><a class="edit-page-link button" href="https://github.com/facebook/docusaurus/edit/master/docs/getting-started-site-creation.md" target="_blank" rel="noreferrer noopener">Edit</a><h1>Creating your site</h1></header><article><div><span><p>Docusaurus was created to hopefully make it super simple for you to create a site and documentation for your open source project.</p>
|
||||
<p>After <a href="/docs/en/next/installation.html">installation</a> and <a href="/docs/en/next/site-preparation.html">preparation</a>, much of the work to create a basic site for your docs is already complete.</p>
|
||||
<p>After <a href="/docs/en/next/installation">installation</a> and <a href="/docs/en/next/site-preparation">preparation</a>, much of the work to create a basic site for your docs is already complete.</p>
|
||||
<h2><a class="anchor" aria-hidden="true" id="site-structure"></a><a href="#site-structure" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Site Structure</h2>
|
||||
<p>Your site structure looks like the following:</p>
|
||||
<pre><code class="hljs css bash">root-of-repo
|
||||
|
@ -46,7 +46,7 @@
|
|||
│ └── static
|
||||
</code></pre>
|
||||
<blockquote>
|
||||
<p>This assumes that you removed the example <code>.md</code> files that were installed with the <a href="/docs/en/next/installation.html">initialization</a> script.</p>
|
||||
<p>This assumes that you removed the example <code>.md</code> files that were installed with the <a href="/docs/en/next/installation">initialization</a> script.</p>
|
||||
</blockquote>
|
||||
<p>All of your documentation files should be placed inside the <code>docs</code> folder as markdown <code>.md</code> files. Any blog posts should be inside the <code>blog</code> folder.</p>
|
||||
<blockquote>
|
||||
|
@ -55,7 +55,7 @@
|
|||
<h2><a class="anchor" aria-hidden="true" id="create-your-basic-site"></a><a href="#create-your-basic-site" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Create Your Basic Site</h2>
|
||||
<p>To create a fully functional site, you only need to do a few steps:</p>
|
||||
<ol>
|
||||
<li><p>Add your documentation to the <code>/docs</code> folder as <code>.md</code> files, ensuring you have the proper <a href="/docs/en/next/doc-markdown.html#documents">header</a> in each file. The simplest header would be the following, where <code>id</code> is the link name (e.g., <code>docs/intro.html</code>) and the <code>title</code>, is, of course, the title of the browser page.</p>
|
||||
<li><p>Add your documentation to the <code>/docs</code> folder as <code>.md</code> files, ensuring you have the proper <a href="/docs/en/next/doc-markdown#documents">header</a> in each file. The simplest header would be the following, where <code>id</code> is the link name (e.g., <code>docs/intro.html</code>) and the <code>title</code>, is, of course, the title of the browser page.</p>
|
||||
<pre><code class="hljs css yaml"><span class="hljs-meta">---</span>
|
||||
<span class="hljs-attr">id:</span> <span class="hljs-string">intro</span>
|
||||
<span class="hljs-attr">title:</span> <span class="hljs-string">Getting</span> <span class="hljs-string">Started</span>
|
||||
|
@ -63,14 +63,14 @@
|
|||
|
||||
<span class="hljs-string">My</span> <span class="hljs-string">new</span> <span class="hljs-string">content</span> <span class="hljs-string">here..</span>
|
||||
</code></pre></li>
|
||||
<li><p>Add zero or more docs to the <a href="/docs/en/next/navigation.html#adding-docs-to-a-sidebar"><code>sidebars.json</code></a> file so that your documentation is rendered in a sidebar, if you choose them to be.</p></li>
|
||||
<li><p>Add zero or more docs to the <a href="/docs/en/next/navigation#adding-docs-to-a-sidebar"><code>sidebars.json</code></a> file so that your documentation is rendered in a sidebar, if you choose them to be.</p></li>
|
||||
</ol>
|
||||
<blockquote>
|
||||
<p>If you do not add your documentation to the <code>sidebars.json</code> file, the docs will be rendered, but they can only be linked to from other documentation and visited with the known URL.</p>
|
||||
</blockquote>
|
||||
<ol start="3">
|
||||
<li>Modify the <code>website/siteConfig.js</code> file to <a href="/docs/en/next/site-config.html">configure your site</a>, following the comments included in the <a href="/docs/en/next/site-config.html">docs</a> and the <code>website/siteConfig.js</code> to guide you.</li>
|
||||
<li>Create any <a href="/docs/en/next/custom-pages.html#customizing-your-site-footer">custom pages</a> and/or <a href="/docs/en/next/custom-pages.html#customizing-your-site-footer">customize</a> the <code>website/core/Footer.js</code> file that provides the footer for your site.</li>
|
||||
<li>Modify the <code>website/siteConfig.js</code> file to <a href="/docs/en/next/site-config">configure your site</a>, following the comments included in the <a href="/docs/en/next/site-config">docs</a> and the <code>website/siteConfig.js</code> to guide you.</li>
|
||||
<li>Create any <a href="/docs/en/next/custom-pages#customizing-your-site-footer">custom pages</a> and/or <a href="/docs/en/next/custom-pages#customizing-your-site-footer">customize</a> the <code>website/core/Footer.js</code> file that provides the footer for your site.</li>
|
||||
<li>Place assets, such as images, in the <code>website/static/</code> folder.</li>
|
||||
<li>Run the site to see the results of your changes.</li>
|
||||
</ol>
|
||||
|
@ -83,7 +83,7 @@ yarn run start <span class="hljs-comment"># or `npm run start`</span>
|
|||
<p>If you prefer to have your landing page be straight to your documentation, you can do this through a redirect.</p>
|
||||
<ol>
|
||||
<li>Remove the <code>index.js</code> file from the <code>website/pages</code> directory, if it exists.</li>
|
||||
<li>Add a <a href="/docs/en/next/custom-pages.html#adding-static-pages">custom static <code>index.html</code> page</a> in the <code>website/static</code> folder with the following contents:</li>
|
||||
<li>Add a <a href="/docs/en/next/custom-pages#adding-static-pages">custom static <code>index.html</code> page</a> in the <code>website/static</code> folder with the following contents:</li>
|
||||
</ol>
|
||||
<pre><code class="hljs css html"><span class="hljs-meta"><!DOCTYPE HTML></span>
|
||||
<span class="hljs-tag"><<span class="hljs-name">html</span> <span class="hljs-attr">lang</span>=<span class="hljs-string">"en-US"</span>></span>
|
||||
|
@ -104,8 +104,8 @@ yarn run start <span class="hljs-comment"># or `npm run start`</span>
|
|||
<p>You will get the <code>id</code> of the document to land on the <code>.md</code> metadata of that doc page.</p>
|
||||
</blockquote>
|
||||
<h3><a class="anchor" aria-hidden="true" id="blog-only"></a><a href="#blog-only" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Blog Only</h3>
|
||||
<p>You can also use Docusaurus to host your <a href="/docs/en/next/blog.html#i-want-to-run-in-blog-only-mode">blog only</a>.</p>
|
||||
</span></div></article></div><div class="docs-prevnext"><a class="docs-prev button" href="site-preparation.html">← Site Preparation</a><a class="docs-next button" href="publishing.html">Publishing your site →</a></div></div></div><nav class="onPageNav"><ul class="toc-headings"><li><a href="#site-structure">Site Structure</a></li><li><a href="#create-your-basic-site">Create Your Basic Site</a></li><li><a href="#special-customization">Special Customization</a><ul class="toc-headings"><li><a href="#docs-landing-page">Docs Landing Page</a></li><li><a href="#blog-only">Blog Only</a></li></ul></li></ul></nav></div><footer class="nav-footer" id="footer"><section class="sitemap"><a href="/" class="nav-home"><img src="/img/docusaurus_monochrome.svg" alt="Docusaurus" width="66" height="58"/></a><div><h5>Docs</h5><a href="
|
||||
<p>You can also use Docusaurus to host your <a href="/docs/en/next/blog#i-want-to-run-in-blog-only-mode">blog only</a>.</p>
|
||||
</span></div></article></div><div class="docs-prevnext"><a class="docs-prev button" href="site-preparation">← Site Preparation</a><a class="docs-next button" href="publishing">Publishing your site →</a></div></div></div><nav class="onPageNav"><ul class="toc-headings"><li><a href="#site-structure">Site Structure</a></li><li><a href="#create-your-basic-site">Create Your Basic Site</a></li><li><a href="#special-customization">Special Customization</a><ul class="toc-headings"><li><a href="#docs-landing-page">Docs Landing Page</a></li><li><a href="#blog-only">Blog Only</a></li></ul></li></ul></nav></div><footer class="nav-footer" id="footer"><section class="sitemap"><a href="/" class="nav-home"><img src="/img/docusaurus_monochrome.svg" alt="Docusaurus" width="66" height="58"/></a><div><h5>Docs</h5><a href="
|
||||
/docs/en/installation.html">Getting Started</a><a href="
|
||||
/docs/en/versioning.html">Versioning</a><a href="
|
||||
/docs/en/translation.html">Localization</a><a href="
|
||||
|
|
120
docs/en/next/site-creation/index.html
Normal file
120
docs/en/next/site-creation/index.html
Normal file
|
@ -0,0 +1,120 @@
|
|||
<!DOCTYPE html><html lang="en"><head><meta charSet="utf-8"/><meta http-equiv="X-UA-Compatible" content="IE=edge"/><title>Creating your site · Docusaurus</title><meta name="viewport" content="width=device-width"/><meta name="generator" content="Docusaurus"/><meta property="og:title" content="Creating your site · Docusaurus"/><meta property="og:type" content="website"/><meta property="og:url" content="https://docusaurus.io/index.html"/><meta property="og:description" content="Docusaurus was created to hopefully make it super simple for you to create a site and documentation for your open source project."/><meta property="og:image" content="https://docusaurus.io/img/docusaurus.png"/><meta name="twitter:card" content="summary"/><meta name="twitter:image" content="https://docusaurus.io/img/docusaurus.png"/><link rel="shortcut icon" href="/img/docusaurus.ico"/><link rel="stylesheet" href="https://cdn.jsdelivr.net/docsearch.js/1/docsearch.min.css"/><link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/highlight.js/9.12.0/styles/atom-one-dark.min.css"/><link rel="alternate" type="application/atom+xml" href="https://docusaurus.io/blog/atom.xml" title="Docusaurus Blog ATOM Feed"/><link rel="alternate" type="application/rss+xml" href="https://docusaurus.io/blog/feed.xml" title="Docusaurus Blog RSS Feed"/><script>
|
||||
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
|
||||
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
|
||||
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
|
||||
})(window,document,'script','https://www.google-analytics.com/analytics.js','ga');
|
||||
|
||||
ga('create', 'UA-44373548-31', 'auto');
|
||||
ga('send', 'pageview');
|
||||
</script><link rel="stylesheet" href="/css/code-blocks-buttons.css"/><script type="text/javascript" src="https://buttons.github.io/buttons.js"></script><script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/clipboard.js/2.0.0/clipboard.min.js"></script><script type="text/javascript" src="/js/code-blocks-buttons.js"></script><script src="https://unpkg.com/vanilla-back-to-top@7.1.14/dist/vanilla-back-to-top.min.js"></script><script>
|
||||
document.addEventListener("DOMContentLoaded", function(){
|
||||
addBackToTop(
|
||||
{"zIndex":100}
|
||||
)
|
||||
});
|
||||
</script><link rel="stylesheet" href="/css/main.css"/></head><body class="sideNavVisible doc separateOnPageNav"><div class="fixedHeaderContainer"><div class="headerWrapper wrapper"><header><a href="/en"><img class="logo" src="/img/docusaurus.svg" alt="Docusaurus"/><h2 class="headerTitleWithLogo">Docusaurus</h2></a><a href="/en/versions.html"><h3>next</h3></a><div class="navigationWrapper navigationSlider"><nav class="slidingNav"><ul class="nav-site nav-site-internal"><li class="siteNavGroupActive"><a href="/docs/en/next/installation" target="_self">Docs</a></li><li class=""><a href="/en/help" target="_self">Help</a></li><li class=""><a href="/en/users" target="_self">Users</a></li><li class=""><a href="/en/about-slash" target="_self">About /</a></li><li class=""><a href="/blog" target="_self">Blog</a></li><li class=""><a href="https://github.com/facebook/docusaurus" target="_self">GitHub</a></li><span><li><a id="languages-menu" href="#"><img class="languages-icon" src="/img/language.svg"/>English</a><div id="languages-dropdown" class="hide"><ul id="languages-dropdown-items"><li><a href="/es-ES">Español</a></li><li><a href="/ro">Română</a></li><li><a href="/tr">Türkçe</a></li><li><a href="/zh-CN">简体中文</a></li><li><a href="https://crowdin.com/project/docusaurus" target="_blank" rel="noreferrer noopener">Help Translate</a></li></ul></div></li><script>
|
||||
const languagesMenuItem = document.getElementById("languages-menu");
|
||||
const languagesDropDown = document.getElementById("languages-dropdown");
|
||||
languagesMenuItem.addEventListener("click", function(){
|
||||
if(languagesDropDown.className == "hide") {
|
||||
languagesDropDown.className = "visible";
|
||||
} else {
|
||||
languagesDropDown.className = "hide";
|
||||
}
|
||||
});
|
||||
</script></span><li class="navSearchWrapper reactNavSearchWrapper"><input type="text" id="search_input_react" placeholder="Search" title="Search"/></li></ul></nav></div></header></div></div><div class="navPusher"><div class="docMainWrapper wrapper"><div class="container docsNavContainer" id="docsNav"><nav class="toc"><div class="toggleNav"><section class="navWrapper wrapper"><div class="navBreadcrumb wrapper"><div class="navToggle" id="navToggler"><i></i></div><h2><i>›</i><span>Getting Started</span></h2></div><div class="navGroups"><div class="navGroup navGroupActive"><h3>Getting Started</h3><ul><li class="navListItem"><a class="navItem" href="/docs/en/next/installation">Installation</a></li><li class="navListItem"><a class="navItem" href="/docs/en/next/site-preparation">Site Preparation</a></li><li class="navListItem navListItemActive"><a class="navItem navItemActive" href="/docs/en/next/site-creation">Creating your site</a></li><li class="navListItem"><a class="navItem" href="/docs/en/next/publishing">Publishing your site</a></li></ul></div><div class="navGroup navGroupActive"><h3>Guides</h3><ul><li class="navListItem"><a class="navItem" href="/docs/en/next/blog">Adding a Blog</a></li><li class="navListItem"><a class="navItem" href="/docs/en/next/custom-pages">Custom Pages</a></li><li class="navListItem"><a class="navItem" href="/docs/en/next/search">Enabling Search</a></li><li class="navListItem"><a class="navItem" href="/docs/en/next/navigation">Navigation and Sidebars</a></li><li class="navListItem"><a class="navItem" href="/docs/en/next/translation">Translations & Localization</a></li><li class="navListItem"><a class="navItem" href="/docs/en/next/versioning">Versioning</a></li></ul></div><div class="navGroup navGroupActive"><h3>API</h3><ul><li class="navListItem"><a class="navItem" href="/docs/en/next/commands">CLI Commands</a></li><li class="navListItem"><a class="navItem" href="/docs/en/next/doc-markdown">Markdown Features</a></li><li class="navListItem"><a class="navItem" href="/docs/en/next/api-pages">Pages and Styles</a></li><li class="navListItem"><a class="navItem" href="/docs/en/next/site-config">siteConfig.js</a></li></ul></div></div></section></div><script>
|
||||
var toggler = document.getElementById('navToggler');
|
||||
var nav = document.getElementById('docsNav');
|
||||
toggler.onclick = function() {
|
||||
nav.classList.toggle('docsSliderActive');
|
||||
};
|
||||
</script></nav></div><div class="container mainContainer"><div class="wrapper"><div class="post"><header class="postHeader"><a class="edit-page-link button" href="https://github.com/facebook/docusaurus/edit/master/docs/getting-started-site-creation.md" target="_blank" rel="noreferrer noopener">Edit</a><h1>Creating your site</h1></header><article><div><span><p>Docusaurus was created to hopefully make it super simple for you to create a site and documentation for your open source project.</p>
|
||||
<p>After <a href="/docs/en/next/installation">installation</a> and <a href="/docs/en/next/site-preparation">preparation</a>, much of the work to create a basic site for your docs is already complete.</p>
|
||||
<h2><a class="anchor" aria-hidden="true" id="site-structure"></a><a href="#site-structure" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Site Structure</h2>
|
||||
<p>Your site structure looks like the following:</p>
|
||||
<pre><code class="hljs css bash">root-of-repo
|
||||
├── docs
|
||||
├── website
|
||||
│ ├── blog
|
||||
│ ├── core
|
||||
│ │ └── Footer.js
|
||||
│ ├── node_modules
|
||||
│ ├── package.json
|
||||
│ ├── pages
|
||||
│ ├── sidebars.json
|
||||
│ ├── siteConfig.js
|
||||
│ └── static
|
||||
</code></pre>
|
||||
<blockquote>
|
||||
<p>This assumes that you removed the example <code>.md</code> files that were installed with the <a href="/docs/en/next/installation">initialization</a> script.</p>
|
||||
</blockquote>
|
||||
<p>All of your documentation files should be placed inside the <code>docs</code> folder as markdown <code>.md</code> files. Any blog posts should be inside the <code>blog</code> folder.</p>
|
||||
<blockquote>
|
||||
<p>The blog posts must be formatted as <code>YYYY-MM-DD-your-file-name.md</code></p>
|
||||
</blockquote>
|
||||
<h2><a class="anchor" aria-hidden="true" id="create-your-basic-site"></a><a href="#create-your-basic-site" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Create Your Basic Site</h2>
|
||||
<p>To create a fully functional site, you only need to do a few steps:</p>
|
||||
<ol>
|
||||
<li><p>Add your documentation to the <code>/docs</code> folder as <code>.md</code> files, ensuring you have the proper <a href="/docs/en/next/doc-markdown#documents">header</a> in each file. The simplest header would be the following, where <code>id</code> is the link name (e.g., <code>docs/intro.html</code>) and the <code>title</code>, is, of course, the title of the browser page.</p>
|
||||
<pre><code class="hljs css yaml"><span class="hljs-meta">---</span>
|
||||
<span class="hljs-attr">id:</span> <span class="hljs-string">intro</span>
|
||||
<span class="hljs-attr">title:</span> <span class="hljs-string">Getting</span> <span class="hljs-string">Started</span>
|
||||
<span class="hljs-meta">---</span>
|
||||
|
||||
<span class="hljs-string">My</span> <span class="hljs-string">new</span> <span class="hljs-string">content</span> <span class="hljs-string">here..</span>
|
||||
</code></pre></li>
|
||||
<li><p>Add zero or more docs to the <a href="/docs/en/next/navigation#adding-docs-to-a-sidebar"><code>sidebars.json</code></a> file so that your documentation is rendered in a sidebar, if you choose them to be.</p></li>
|
||||
</ol>
|
||||
<blockquote>
|
||||
<p>If you do not add your documentation to the <code>sidebars.json</code> file, the docs will be rendered, but they can only be linked to from other documentation and visited with the known URL.</p>
|
||||
</blockquote>
|
||||
<ol start="3">
|
||||
<li>Modify the <code>website/siteConfig.js</code> file to <a href="/docs/en/next/site-config">configure your site</a>, following the comments included in the <a href="/docs/en/next/site-config">docs</a> and the <code>website/siteConfig.js</code> to guide you.</li>
|
||||
<li>Create any <a href="/docs/en/next/custom-pages#customizing-your-site-footer">custom pages</a> and/or <a href="/docs/en/next/custom-pages#customizing-your-site-footer">customize</a> the <code>website/core/Footer.js</code> file that provides the footer for your site.</li>
|
||||
<li>Place assets, such as images, in the <code>website/static/</code> folder.</li>
|
||||
<li>Run the site to see the results of your changes.</li>
|
||||
</ol>
|
||||
<pre><code class="hljs css bash"><span class="hljs-built_in">cd</span> website
|
||||
yarn run start <span class="hljs-comment"># or `npm run start`</span>
|
||||
<span class="hljs-comment"># Navigate to http://localhost:3000</span>
|
||||
</code></pre>
|
||||
<h2><a class="anchor" aria-hidden="true" id="special-customization"></a><a href="#special-customization" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Special Customization</h2>
|
||||
<h3><a class="anchor" aria-hidden="true" id="docs-landing-page"></a><a href="#docs-landing-page" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Docs Landing Page</h3>
|
||||
<p>If you prefer to have your landing page be straight to your documentation, you can do this through a redirect.</p>
|
||||
<ol>
|
||||
<li>Remove the <code>index.js</code> file from the <code>website/pages</code> directory, if it exists.</li>
|
||||
<li>Add a <a href="/docs/en/next/custom-pages#adding-static-pages">custom static <code>index.html</code> page</a> in the <code>website/static</code> folder with the following contents:</li>
|
||||
</ol>
|
||||
<pre><code class="hljs css html"><span class="hljs-meta"><!DOCTYPE HTML></span>
|
||||
<span class="hljs-tag"><<span class="hljs-name">html</span> <span class="hljs-attr">lang</span>=<span class="hljs-string">"en-US"</span>></span>
|
||||
<span class="hljs-tag"><<span class="hljs-name">head</span>></span>
|
||||
<span class="hljs-tag"><<span class="hljs-name">meta</span> <span class="hljs-attr">charset</span>=<span class="hljs-string">"UTF-8"</span>></span>
|
||||
<span class="hljs-tag"><<span class="hljs-name">meta</span> <span class="hljs-attr">http-equiv</span>=<span class="hljs-string">"refresh"</span> <span class="hljs-attr">content</span>=<span class="hljs-string">"0; url=docs/id-of-doc-to-land-on.html"</span>></span>
|
||||
<span class="hljs-tag"><<span class="hljs-name">script</span> <span class="hljs-attr">type</span>=<span class="hljs-string">"text/javascript"</span>></span><span class="javascript">
|
||||
<span class="hljs-built_in">window</span>.location.href = <span class="hljs-string">'docs/id-of-doc-to-land-on.html'</span>;
|
||||
</span><span class="hljs-tag"></<span class="hljs-name">script</span>></span>
|
||||
<span class="hljs-tag"><<span class="hljs-name">title</span>></span>Your Site Title Here<span class="hljs-tag"></<span class="hljs-name">title</span>></span>
|
||||
<span class="hljs-tag"></<span class="hljs-name">head</span>></span>
|
||||
<span class="hljs-tag"><<span class="hljs-name">body</span>></span>
|
||||
If you are not redirected automatically, follow this <span class="hljs-tag"><<span class="hljs-name">a</span> <span class="hljs-attr">href</span>=<span class="hljs-string">"docs/id-of-doc-to-land-on.html"</span>></span>link<span class="hljs-tag"></<span class="hljs-name">a</span>></span>.
|
||||
<span class="hljs-tag"></<span class="hljs-name">body</span>></span>
|
||||
<span class="hljs-tag"></<span class="hljs-name">html</span>></span>
|
||||
</code></pre>
|
||||
<blockquote>
|
||||
<p>You will get the <code>id</code> of the document to land on the <code>.md</code> metadata of that doc page.</p>
|
||||
</blockquote>
|
||||
<h3><a class="anchor" aria-hidden="true" id="blog-only"></a><a href="#blog-only" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Blog Only</h3>
|
||||
<p>You can also use Docusaurus to host your <a href="/docs/en/next/blog#i-want-to-run-in-blog-only-mode">blog only</a>.</p>
|
||||
</span></div></article></div><div class="docs-prevnext"><a class="docs-prev button" href="site-preparation">← Site Preparation</a><a class="docs-next button" href="publishing">Publishing your site →</a></div></div></div><nav class="onPageNav"><ul class="toc-headings"><li><a href="#site-structure">Site Structure</a></li><li><a href="#create-your-basic-site">Create Your Basic Site</a></li><li><a href="#special-customization">Special Customization</a><ul class="toc-headings"><li><a href="#docs-landing-page">Docs Landing Page</a></li><li><a href="#blog-only">Blog Only</a></li></ul></li></ul></nav></div><footer class="nav-footer" id="footer"><section class="sitemap"><a href="/" class="nav-home"><img src="/img/docusaurus_monochrome.svg" alt="Docusaurus" width="66" height="58"/></a><div><h5>Docs</h5><a href="
|
||||
/docs/en/installation.html">Getting Started</a><a href="
|
||||
/docs/en/versioning.html">Versioning</a><a href="
|
||||
/docs/en/translation.html">Localization</a><a href="
|
||||
/docs/en/search.html">Adding Search</a></div><div><h5>Community</h5><a href="/en/users.html">User Showcase</a></div><div><h5>More</h5><div class="social"><a class="github-button" href="https://github.com/facebook/Docusaurus" data-count-href="/facebook/Docusaurus/stargazers" data-show-count="true" data-count-aria-label="# stargazers on GitHub" aria-label="Star this project on GitHub">Docusaurus</a></div><div class="social"><a href="https://twitter.com/docusaurus" class="twitter-follow-button">Follow @docusaurus</a></div><div class="social"><div class="fb-like" data-href="https://docusaurus.io" data-layout="standard" data-share="true" data-width="225" data-show-faces="false"></div></div></div></section><a href="https://code.facebook.com/projects/" target="_blank" rel="noreferrer noopener" class="fbOpenSource"><img src="/img/oss_logo.png" alt="Facebook Open Source" width="170" height="45"/></a><section class="copyright"><span>Copyright © 2018 Facebook Inc.</span></section></footer></div><script type="text/javascript" src="https://cdn.jsdelivr.net/docsearch.js/1/docsearch.min.js"></script><script>window.fbAsyncInit = function() {FB.init({appId:'199138890728411',xfbml:true,version:'v2.7'});};(function(d, s, id){var js, fjs = d.getElementsByTagName(s)[0];if (d.getElementById(id)) {return;}js = d.createElement(s); js.id = id;js.src = '//connect.facebook.net/en_US/sdk.js';fjs.parentNode.insertBefore(js, fjs);}(document, 'script','facebook-jssdk'));
|
||||
</script><script>window.twttr=(function(d,s, id){var js,fjs=d.getElementsByTagName(s)[0],t=window.twttr||{};if(d.getElementById(id))return t;js=d.createElement(s);js.id=id;js.src='https://platform.twitter.com/widgets.js';fjs.parentNode.insertBefore(js, fjs);t._e = [];t.ready = function(f) {t._e.push(f);};return t;}(document, 'script', 'twitter-wjs'));</script><script>
|
||||
var search = docsearch({
|
||||
|
||||
apiKey: '3eb9507824b8be89e7a199ecaa1a9d2c',
|
||||
indexName: 'docusaurus',
|
||||
inputSelector: '#search_input_react'
|
||||
});
|
||||
</script></body></html>
|
|
@ -1,4 +1,4 @@
|
|||
<!DOCTYPE html><html lang="en"><head><meta charSet="utf-8"/><meta http-equiv="X-UA-Compatible" content="IE=edge"/><title>Site Preparation · Docusaurus</title><meta name="viewport" content="width=device-width"/><meta name="generator" content="Docusaurus"/><meta property="og:title" content="Site Preparation · Docusaurus"/><meta property="og:type" content="website"/><meta property="og:url" content="https://docusaurus.io/index.html"/><meta property="og:description" content="After [installing Docusaurus](/docs/en/next/installation.html), you now have a skeleton to work from for your specific website. The following discusses the rest of the Docusaurus structure in order for you to prepare your site."/><meta property="og:image" content="https://docusaurus.io/img/docusaurus.png"/><meta name="twitter:card" content="summary"/><meta name="twitter:image" content="https://docusaurus.io/img/docusaurus.png"/><link rel="shortcut icon" href="/img/docusaurus.ico"/><link rel="stylesheet" href="https://cdn.jsdelivr.net/docsearch.js/1/docsearch.min.css"/><link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/highlight.js/9.12.0/styles/atom-one-dark.min.css"/><link rel="alternate" type="application/atom+xml" href="https://docusaurus.io/blog/atom.xml" title="Docusaurus Blog ATOM Feed"/><link rel="alternate" type="application/rss+xml" href="https://docusaurus.io/blog/feed.xml" title="Docusaurus Blog RSS Feed"/><script>
|
||||
<!DOCTYPE html><html lang="en"><head><meta charSet="utf-8"/><meta http-equiv="X-UA-Compatible" content="IE=edge"/><title>Site Preparation · Docusaurus</title><meta name="viewport" content="width=device-width"/><meta name="generator" content="Docusaurus"/><meta property="og:title" content="Site Preparation · Docusaurus"/><meta property="og:type" content="website"/><meta property="og:url" content="https://docusaurus.io/index.html"/><meta property="og:description" content="After [installing Docusaurus](/docs/en/next/installation), you now have a skeleton to work from for your specific website. The following discusses the rest of the Docusaurus structure in order for you to prepare your site."/><meta property="og:image" content="https://docusaurus.io/img/docusaurus.png"/><meta name="twitter:card" content="summary"/><meta name="twitter:image" content="https://docusaurus.io/img/docusaurus.png"/><link rel="shortcut icon" href="/img/docusaurus.ico"/><link rel="stylesheet" href="https://cdn.jsdelivr.net/docsearch.js/1/docsearch.min.css"/><link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/highlight.js/9.12.0/styles/atom-one-dark.min.css"/><link rel="alternate" type="application/atom+xml" href="https://docusaurus.io/blog/atom.xml" title="Docusaurus Blog ATOM Feed"/><link rel="alternate" type="application/rss+xml" href="https://docusaurus.io/blog/feed.xml" title="Docusaurus Blog RSS Feed"/><script>
|
||||
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
|
||||
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
|
||||
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
|
||||
|
@ -12,7 +12,7 @@
|
|||
{"zIndex":100}
|
||||
)
|
||||
});
|
||||
</script><link rel="stylesheet" href="/css/main.css"/></head><body class="sideNavVisible doc separateOnPageNav"><div class="fixedHeaderContainer"><div class="headerWrapper wrapper"><header><a href="/en"><img class="logo" src="/img/docusaurus.svg" alt="Docusaurus"/><h2 class="headerTitleWithLogo">Docusaurus</h2></a><a href="/en/versions.html"><h3>next</h3></a><div class="navigationWrapper navigationSlider"><nav class="slidingNav"><ul class="nav-site nav-site-internal"><li class="siteNavGroupActive"><a href="/docs/en/next/installation.html" target="_self">Docs</a></li><li class=""><a href="/en/help.html" target="_self">Help</a></li><li class=""><a href="/en/users.html" target="_self">Users</a></li><li class=""><a href="/en/about-slash.html" target="_self">About /</a></li><li class=""><a href="/blog" target="_self">Blog</a></li><li class=""><a href="https://github.com/facebook/docusaurus" target="_self">GitHub</a></li><span><li><a id="languages-menu" href="#"><img class="languages-icon" src="/img/language.svg"/>English</a><div id="languages-dropdown" class="hide"><ul id="languages-dropdown-items"><li><a href="/es-ES">Español</a></li><li><a href="/ro">Română</a></li><li><a href="/tr">Türkçe</a></li><li><a href="/zh-CN">简体中文</a></li><li><a href="https://crowdin.com/project/docusaurus" target="_blank" rel="noreferrer noopener">Help Translate</a></li></ul></div></li><script>
|
||||
</script><link rel="stylesheet" href="/css/main.css"/></head><body class="sideNavVisible doc separateOnPageNav"><div class="fixedHeaderContainer"><div class="headerWrapper wrapper"><header><a href="/en"><img class="logo" src="/img/docusaurus.svg" alt="Docusaurus"/><h2 class="headerTitleWithLogo">Docusaurus</h2></a><a href="/en/versions.html"><h3>next</h3></a><div class="navigationWrapper navigationSlider"><nav class="slidingNav"><ul class="nav-site nav-site-internal"><li class="siteNavGroupActive"><a href="/docs/en/next/installation" target="_self">Docs</a></li><li class=""><a href="/en/help" target="_self">Help</a></li><li class=""><a href="/en/users" target="_self">Users</a></li><li class=""><a href="/en/about-slash" target="_self">About /</a></li><li class=""><a href="/blog" target="_self">Blog</a></li><li class=""><a href="https://github.com/facebook/docusaurus" target="_self">GitHub</a></li><span><li><a id="languages-menu" href="#"><img class="languages-icon" src="/img/language.svg"/>English</a><div id="languages-dropdown" class="hide"><ul id="languages-dropdown-items"><li><a href="/es-ES">Español</a></li><li><a href="/ro">Română</a></li><li><a href="/tr">Türkçe</a></li><li><a href="/zh-CN">简体中文</a></li><li><a href="https://crowdin.com/project/docusaurus" target="_blank" rel="noreferrer noopener">Help Translate</a></li></ul></div></li><script>
|
||||
const languagesMenuItem = document.getElementById("languages-menu");
|
||||
const languagesDropDown = document.getElementById("languages-dropdown");
|
||||
languagesMenuItem.addEventListener("click", function(){
|
||||
|
@ -22,15 +22,15 @@
|
|||
languagesDropDown.className = "hide";
|
||||
}
|
||||
});
|
||||
</script></span><li class="navSearchWrapper reactNavSearchWrapper"><input type="text" id="search_input_react" placeholder="Search" title="Search"/></li></ul></nav></div></header></div></div><div class="navPusher"><div class="docMainWrapper wrapper"><div class="container docsNavContainer" id="docsNav"><nav class="toc"><div class="toggleNav"><section class="navWrapper wrapper"><div class="navBreadcrumb wrapper"><div class="navToggle" id="navToggler"><i></i></div><h2><i>›</i><span>Getting Started</span></h2></div><div class="navGroups"><div class="navGroup navGroupActive"><h3>Getting Started</h3><ul><li class="navListItem"><a class="navItem" href="/docs/en/next/installation.html">Installation</a></li><li class="navListItem navListItemActive"><a class="navItem navItemActive" href="/docs/en/next/site-preparation.html">Site Preparation</a></li><li class="navListItem"><a class="navItem" href="/docs/en/next/site-creation.html">Creating your site</a></li><li class="navListItem"><a class="navItem" href="/docs/en/next/publishing.html">Publishing your site</a></li></ul></div><div class="navGroup navGroupActive"><h3>Guides</h3><ul><li class="navListItem"><a class="navItem" href="/docs/en/next/blog.html">Adding a Blog</a></li><li class="navListItem"><a class="navItem" href="/docs/en/next/custom-pages.html">Custom Pages</a></li><li class="navListItem"><a class="navItem" href="/docs/en/next/search.html">Enabling Search</a></li><li class="navListItem"><a class="navItem" href="/docs/en/next/navigation.html">Navigation and Sidebars</a></li><li class="navListItem"><a class="navItem" href="/docs/en/next/translation.html">Translations & Localization</a></li><li class="navListItem"><a class="navItem" href="/docs/en/next/versioning.html">Versioning</a></li></ul></div><div class="navGroup navGroupActive"><h3>API</h3><ul><li class="navListItem"><a class="navItem" href="/docs/en/next/commands.html">CLI Commands</a></li><li class="navListItem"><a class="navItem" href="/docs/en/next/doc-markdown.html">Markdown Features</a></li><li class="navListItem"><a class="navItem" href="/docs/en/next/api-pages.html">Pages and Styles</a></li><li class="navListItem"><a class="navItem" href="/docs/en/next/site-config.html">siteConfig.js</a></li></ul></div></div></section></div><script>
|
||||
</script></span><li class="navSearchWrapper reactNavSearchWrapper"><input type="text" id="search_input_react" placeholder="Search" title="Search"/></li></ul></nav></div></header></div></div><div class="navPusher"><div class="docMainWrapper wrapper"><div class="container docsNavContainer" id="docsNav"><nav class="toc"><div class="toggleNav"><section class="navWrapper wrapper"><div class="navBreadcrumb wrapper"><div class="navToggle" id="navToggler"><i></i></div><h2><i>›</i><span>Getting Started</span></h2></div><div class="navGroups"><div class="navGroup navGroupActive"><h3>Getting Started</h3><ul><li class="navListItem"><a class="navItem" href="/docs/en/next/installation">Installation</a></li><li class="navListItem navListItemActive"><a class="navItem navItemActive" href="/docs/en/next/site-preparation">Site Preparation</a></li><li class="navListItem"><a class="navItem" href="/docs/en/next/site-creation">Creating your site</a></li><li class="navListItem"><a class="navItem" href="/docs/en/next/publishing">Publishing your site</a></li></ul></div><div class="navGroup navGroupActive"><h3>Guides</h3><ul><li class="navListItem"><a class="navItem" href="/docs/en/next/blog">Adding a Blog</a></li><li class="navListItem"><a class="navItem" href="/docs/en/next/custom-pages">Custom Pages</a></li><li class="navListItem"><a class="navItem" href="/docs/en/next/search">Enabling Search</a></li><li class="navListItem"><a class="navItem" href="/docs/en/next/navigation">Navigation and Sidebars</a></li><li class="navListItem"><a class="navItem" href="/docs/en/next/translation">Translations & Localization</a></li><li class="navListItem"><a class="navItem" href="/docs/en/next/versioning">Versioning</a></li></ul></div><div class="navGroup navGroupActive"><h3>API</h3><ul><li class="navListItem"><a class="navItem" href="/docs/en/next/commands">CLI Commands</a></li><li class="navListItem"><a class="navItem" href="/docs/en/next/doc-markdown">Markdown Features</a></li><li class="navListItem"><a class="navItem" href="/docs/en/next/api-pages">Pages and Styles</a></li><li class="navListItem"><a class="navItem" href="/docs/en/next/site-config">siteConfig.js</a></li></ul></div></div></section></div><script>
|
||||
var toggler = document.getElementById('navToggler');
|
||||
var nav = document.getElementById('docsNav');
|
||||
toggler.onclick = function() {
|
||||
nav.classList.toggle('docsSliderActive');
|
||||
};
|
||||
</script></nav></div><div class="container mainContainer"><div class="wrapper"><div class="post"><header class="postHeader"><a class="edit-page-link button" href="https://github.com/facebook/docusaurus/edit/master/docs/getting-started-preparation.md" target="_blank" rel="noreferrer noopener">Edit</a><h1>Site Preparation</h1></header><article><div><span><p>After <a href="/docs/en/next/installation.html">installing Docusaurus</a>, you now have a skeleton to work from for your specific website. The following discusses the rest of the Docusaurus structure in order for you to prepare your site.</p>
|
||||
</script></nav></div><div class="container mainContainer"><div class="wrapper"><div class="post"><header class="postHeader"><a class="edit-page-link button" href="https://github.com/facebook/docusaurus/edit/master/docs/getting-started-preparation.md" target="_blank" rel="noreferrer noopener">Edit</a><h1>Site Preparation</h1></header><article><div><span><p>After <a href="/docs/en/next/installation">installing Docusaurus</a>, you now have a skeleton to work from for your specific website. The following discusses the rest of the Docusaurus structure in order for you to prepare your site.</p>
|
||||
<h2><a class="anchor" aria-hidden="true" id="directory-structure"></a><a href="#directory-structure" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Directory Structure</h2>
|
||||
<p>As shown after you <a href="/docs/en/next/installation.html">installed Docusaurus</a>, the initialization script created a directory structure similar to:</p>
|
||||
<p>As shown after you <a href="/docs/en/next/installation">installed Docusaurus</a>, the initialization script created a directory structure similar to:</p>
|
||||
<pre><code class="hljs css bash">root-directory
|
||||
├── docs-examples-from-docusaurus
|
||||
│ ├── doc1.md
|
||||
|
@ -54,7 +54,7 @@
|
|||
└── static
|
||||
</code></pre>
|
||||
<blockquote>
|
||||
<p>You may have already renamed the example blog (<code>website/blog-examples-from-docusaurus</code>) and document (<code>docs-examples-from-docusaurus</code>) directories when you <a href="/docs/en/next/installation.html##verifying-installation">verified the installation</a>.</p>
|
||||
<p>You may have already renamed the example blog (<code>website/blog-examples-from-docusaurus</code>) and document (<code>docs-examples-from-docusaurus</code>) directories when you <a href="/docs/en/next/installation##verifying-installation">verified the installation</a>.</p>
|
||||
</blockquote>
|
||||
<ul>
|
||||
<li>The <code>website/core/Footer.js</code> file is a React component that acts as the footer for the site generated by Docusaurus and should be customized by the user.</li>
|
||||
|
@ -66,7 +66,7 @@
|
|||
</ul>
|
||||
<p>You will need to keep the <code>website/siteConfig.js</code> and <code>website/core/Footer.js</code> files, but may edit them as you wish.</p>
|
||||
<p>You should keep the <code>website/pages</code> and <code>website/static</code> folders, but may change the content inside them as you wish. At the bare minimum you should have an <code>en/index.js</code> or <code>en/index.html</code> file inside <code>website/pages</code> and an image to use as your header icon inside <code>website/static</code>.</p>
|
||||
</span></div></article></div><div class="docs-prevnext"><a class="docs-prev button" href="installation.html">← Installation</a><a class="docs-next button" href="site-creation.html">Creating your site →</a></div></div></div><nav class="onPageNav"><ul class="toc-headings"><li><a href="#directory-structure">Directory Structure</a></li></ul></nav></div><footer class="nav-footer" id="footer"><section class="sitemap"><a href="/" class="nav-home"><img src="/img/docusaurus_monochrome.svg" alt="Docusaurus" width="66" height="58"/></a><div><h5>Docs</h5><a href="
|
||||
</span></div></article></div><div class="docs-prevnext"><a class="docs-prev button" href="installation">← Installation</a><a class="docs-next button" href="site-creation">Creating your site →</a></div></div></div><nav class="onPageNav"><ul class="toc-headings"><li><a href="#directory-structure">Directory Structure</a></li></ul></nav></div><footer class="nav-footer" id="footer"><section class="sitemap"><a href="/" class="nav-home"><img src="/img/docusaurus_monochrome.svg" alt="Docusaurus" width="66" height="58"/></a><div><h5>Docs</h5><a href="
|
||||
/docs/en/installation.html">Getting Started</a><a href="
|
||||
/docs/en/versioning.html">Versioning</a><a href="
|
||||
/docs/en/translation.html">Localization</a><a href="
|
||||
|
|
81
docs/en/next/site-preparation/index.html
Normal file
81
docs/en/next/site-preparation/index.html
Normal file
|
@ -0,0 +1,81 @@
|
|||
<!DOCTYPE html><html lang="en"><head><meta charSet="utf-8"/><meta http-equiv="X-UA-Compatible" content="IE=edge"/><title>Site Preparation · Docusaurus</title><meta name="viewport" content="width=device-width"/><meta name="generator" content="Docusaurus"/><meta property="og:title" content="Site Preparation · Docusaurus"/><meta property="og:type" content="website"/><meta property="og:url" content="https://docusaurus.io/index.html"/><meta property="og:description" content="After [installing Docusaurus](/docs/en/next/installation), you now have a skeleton to work from for your specific website. The following discusses the rest of the Docusaurus structure in order for you to prepare your site."/><meta property="og:image" content="https://docusaurus.io/img/docusaurus.png"/><meta name="twitter:card" content="summary"/><meta name="twitter:image" content="https://docusaurus.io/img/docusaurus.png"/><link rel="shortcut icon" href="/img/docusaurus.ico"/><link rel="stylesheet" href="https://cdn.jsdelivr.net/docsearch.js/1/docsearch.min.css"/><link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/highlight.js/9.12.0/styles/atom-one-dark.min.css"/><link rel="alternate" type="application/atom+xml" href="https://docusaurus.io/blog/atom.xml" title="Docusaurus Blog ATOM Feed"/><link rel="alternate" type="application/rss+xml" href="https://docusaurus.io/blog/feed.xml" title="Docusaurus Blog RSS Feed"/><script>
|
||||
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
|
||||
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
|
||||
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
|
||||
})(window,document,'script','https://www.google-analytics.com/analytics.js','ga');
|
||||
|
||||
ga('create', 'UA-44373548-31', 'auto');
|
||||
ga('send', 'pageview');
|
||||
</script><link rel="stylesheet" href="/css/code-blocks-buttons.css"/><script type="text/javascript" src="https://buttons.github.io/buttons.js"></script><script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/clipboard.js/2.0.0/clipboard.min.js"></script><script type="text/javascript" src="/js/code-blocks-buttons.js"></script><script src="https://unpkg.com/vanilla-back-to-top@7.1.14/dist/vanilla-back-to-top.min.js"></script><script>
|
||||
document.addEventListener("DOMContentLoaded", function(){
|
||||
addBackToTop(
|
||||
{"zIndex":100}
|
||||
)
|
||||
});
|
||||
</script><link rel="stylesheet" href="/css/main.css"/></head><body class="sideNavVisible doc separateOnPageNav"><div class="fixedHeaderContainer"><div class="headerWrapper wrapper"><header><a href="/en"><img class="logo" src="/img/docusaurus.svg" alt="Docusaurus"/><h2 class="headerTitleWithLogo">Docusaurus</h2></a><a href="/en/versions.html"><h3>next</h3></a><div class="navigationWrapper navigationSlider"><nav class="slidingNav"><ul class="nav-site nav-site-internal"><li class="siteNavGroupActive"><a href="/docs/en/next/installation" target="_self">Docs</a></li><li class=""><a href="/en/help" target="_self">Help</a></li><li class=""><a href="/en/users" target="_self">Users</a></li><li class=""><a href="/en/about-slash" target="_self">About /</a></li><li class=""><a href="/blog" target="_self">Blog</a></li><li class=""><a href="https://github.com/facebook/docusaurus" target="_self">GitHub</a></li><span><li><a id="languages-menu" href="#"><img class="languages-icon" src="/img/language.svg"/>English</a><div id="languages-dropdown" class="hide"><ul id="languages-dropdown-items"><li><a href="/es-ES">Español</a></li><li><a href="/ro">Română</a></li><li><a href="/tr">Türkçe</a></li><li><a href="/zh-CN">简体中文</a></li><li><a href="https://crowdin.com/project/docusaurus" target="_blank" rel="noreferrer noopener">Help Translate</a></li></ul></div></li><script>
|
||||
const languagesMenuItem = document.getElementById("languages-menu");
|
||||
const languagesDropDown = document.getElementById("languages-dropdown");
|
||||
languagesMenuItem.addEventListener("click", function(){
|
||||
if(languagesDropDown.className == "hide") {
|
||||
languagesDropDown.className = "visible";
|
||||
} else {
|
||||
languagesDropDown.className = "hide";
|
||||
}
|
||||
});
|
||||
</script></span><li class="navSearchWrapper reactNavSearchWrapper"><input type="text" id="search_input_react" placeholder="Search" title="Search"/></li></ul></nav></div></header></div></div><div class="navPusher"><div class="docMainWrapper wrapper"><div class="container docsNavContainer" id="docsNav"><nav class="toc"><div class="toggleNav"><section class="navWrapper wrapper"><div class="navBreadcrumb wrapper"><div class="navToggle" id="navToggler"><i></i></div><h2><i>›</i><span>Getting Started</span></h2></div><div class="navGroups"><div class="navGroup navGroupActive"><h3>Getting Started</h3><ul><li class="navListItem"><a class="navItem" href="/docs/en/next/installation">Installation</a></li><li class="navListItem navListItemActive"><a class="navItem navItemActive" href="/docs/en/next/site-preparation">Site Preparation</a></li><li class="navListItem"><a class="navItem" href="/docs/en/next/site-creation">Creating your site</a></li><li class="navListItem"><a class="navItem" href="/docs/en/next/publishing">Publishing your site</a></li></ul></div><div class="navGroup navGroupActive"><h3>Guides</h3><ul><li class="navListItem"><a class="navItem" href="/docs/en/next/blog">Adding a Blog</a></li><li class="navListItem"><a class="navItem" href="/docs/en/next/custom-pages">Custom Pages</a></li><li class="navListItem"><a class="navItem" href="/docs/en/next/search">Enabling Search</a></li><li class="navListItem"><a class="navItem" href="/docs/en/next/navigation">Navigation and Sidebars</a></li><li class="navListItem"><a class="navItem" href="/docs/en/next/translation">Translations & Localization</a></li><li class="navListItem"><a class="navItem" href="/docs/en/next/versioning">Versioning</a></li></ul></div><div class="navGroup navGroupActive"><h3>API</h3><ul><li class="navListItem"><a class="navItem" href="/docs/en/next/commands">CLI Commands</a></li><li class="navListItem"><a class="navItem" href="/docs/en/next/doc-markdown">Markdown Features</a></li><li class="navListItem"><a class="navItem" href="/docs/en/next/api-pages">Pages and Styles</a></li><li class="navListItem"><a class="navItem" href="/docs/en/next/site-config">siteConfig.js</a></li></ul></div></div></section></div><script>
|
||||
var toggler = document.getElementById('navToggler');
|
||||
var nav = document.getElementById('docsNav');
|
||||
toggler.onclick = function() {
|
||||
nav.classList.toggle('docsSliderActive');
|
||||
};
|
||||
</script></nav></div><div class="container mainContainer"><div class="wrapper"><div class="post"><header class="postHeader"><a class="edit-page-link button" href="https://github.com/facebook/docusaurus/edit/master/docs/getting-started-preparation.md" target="_blank" rel="noreferrer noopener">Edit</a><h1>Site Preparation</h1></header><article><div><span><p>After <a href="/docs/en/next/installation">installing Docusaurus</a>, you now have a skeleton to work from for your specific website. The following discusses the rest of the Docusaurus structure in order for you to prepare your site.</p>
|
||||
<h2><a class="anchor" aria-hidden="true" id="directory-structure"></a><a href="#directory-structure" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Directory Structure</h2>
|
||||
<p>As shown after you <a href="/docs/en/next/installation">installed Docusaurus</a>, the initialization script created a directory structure similar to:</p>
|
||||
<pre><code class="hljs css bash">root-directory
|
||||
├── docs-examples-from-docusaurus
|
||||
│ ├── doc1.md
|
||||
│ ├── doc2.md
|
||||
│ ├── doc3.md
|
||||
│ ├── exampledoc4.md
|
||||
│ └── exampledoc5.md
|
||||
└── website
|
||||
├── blog-examples-from-docusaurus
|
||||
│ ├── 2016-03-11-blog-post.md
|
||||
│ ├── 2017-04-10-blog-post-two.md
|
||||
│ ├── 2017-09-25-testing-rss.md
|
||||
│ ├── 2017-09-26-adding-rss.md
|
||||
│ └── 2017-10-24-new-version-1.0.0.md
|
||||
├── core
|
||||
│ └── Footer.js
|
||||
├── package.json
|
||||
├── pages
|
||||
├── sidebars.json
|
||||
├── siteConfig.js
|
||||
└── static
|
||||
</code></pre>
|
||||
<blockquote>
|
||||
<p>You may have already renamed the example blog (<code>website/blog-examples-from-docusaurus</code>) and document (<code>docs-examples-from-docusaurus</code>) directories when you <a href="/docs/en/next/installation##verifying-installation">verified the installation</a>.</p>
|
||||
</blockquote>
|
||||
<ul>
|
||||
<li>The <code>website/core/Footer.js</code> file is a React component that acts as the footer for the site generated by Docusaurus and should be customized by the user.</li>
|
||||
<li>The <code>website/blog-examples-from-docusaurus</code> folder contains examples of blog posts written in markdown.</li>
|
||||
<li>The <code>docs-examples-from-docusaurus</code> folder contains example documentation files written in markdown.</li>
|
||||
<li>The <code>website/pages</code> folder contains example top-level pages for the site.</li>
|
||||
<li>The <code>website/static</code> folder contains static assets used by the example site.</li>
|
||||
<li>The <code>website/siteConfig.js</code> file is the main configuration file used by Docusaurus.</li>
|
||||
</ul>
|
||||
<p>You will need to keep the <code>website/siteConfig.js</code> and <code>website/core/Footer.js</code> files, but may edit them as you wish.</p>
|
||||
<p>You should keep the <code>website/pages</code> and <code>website/static</code> folders, but may change the content inside them as you wish. At the bare minimum you should have an <code>en/index.js</code> or <code>en/index.html</code> file inside <code>website/pages</code> and an image to use as your header icon inside <code>website/static</code>.</p>
|
||||
</span></div></article></div><div class="docs-prevnext"><a class="docs-prev button" href="installation">← Installation</a><a class="docs-next button" href="site-creation">Creating your site →</a></div></div></div><nav class="onPageNav"><ul class="toc-headings"><li><a href="#directory-structure">Directory Structure</a></li></ul></nav></div><footer class="nav-footer" id="footer"><section class="sitemap"><a href="/" class="nav-home"><img src="/img/docusaurus_monochrome.svg" alt="Docusaurus" width="66" height="58"/></a><div><h5>Docs</h5><a href="
|
||||
/docs/en/installation.html">Getting Started</a><a href="
|
||||
/docs/en/versioning.html">Versioning</a><a href="
|
||||
/docs/en/translation.html">Localization</a><a href="
|
||||
/docs/en/search.html">Adding Search</a></div><div><h5>Community</h5><a href="/en/users.html">User Showcase</a></div><div><h5>More</h5><div class="social"><a class="github-button" href="https://github.com/facebook/Docusaurus" data-count-href="/facebook/Docusaurus/stargazers" data-show-count="true" data-count-aria-label="# stargazers on GitHub" aria-label="Star this project on GitHub">Docusaurus</a></div><div class="social"><a href="https://twitter.com/docusaurus" class="twitter-follow-button">Follow @docusaurus</a></div><div class="social"><div class="fb-like" data-href="https://docusaurus.io" data-layout="standard" data-share="true" data-width="225" data-show-faces="false"></div></div></div></section><a href="https://code.facebook.com/projects/" target="_blank" rel="noreferrer noopener" class="fbOpenSource"><img src="/img/oss_logo.png" alt="Facebook Open Source" width="170" height="45"/></a><section class="copyright"><span>Copyright © 2018 Facebook Inc.</span></section></footer></div><script type="text/javascript" src="https://cdn.jsdelivr.net/docsearch.js/1/docsearch.min.js"></script><script>window.fbAsyncInit = function() {FB.init({appId:'199138890728411',xfbml:true,version:'v2.7'});};(function(d, s, id){var js, fjs = d.getElementsByTagName(s)[0];if (d.getElementById(id)) {return;}js = d.createElement(s); js.id = id;js.src = '//connect.facebook.net/en_US/sdk.js';fjs.parentNode.insertBefore(js, fjs);}(document, 'script','facebook-jssdk'));
|
||||
</script><script>window.twttr=(function(d,s, id){var js,fjs=d.getElementsByTagName(s)[0],t=window.twttr||{};if(d.getElementById(id))return t;js=d.createElement(s);js.id=id;js.src='https://platform.twitter.com/widgets.js';fjs.parentNode.insertBefore(js, fjs);t._e = [];t.ready = function(f) {t._e.push(f);};return t;}(document, 'script', 'twitter-wjs'));</script><script>
|
||||
var search = docsearch({
|
||||
|
||||
apiKey: '3eb9507824b8be89e7a199ecaa1a9d2c',
|
||||
indexName: 'docusaurus',
|
||||
inputSelector: '#search_input_react'
|
||||
});
|
||||
</script></body></html>
|
|
@ -12,7 +12,7 @@
|
|||
{"zIndex":100}
|
||||
)
|
||||
});
|
||||
</script><link rel="stylesheet" href="/css/main.css"/></head><body class="sideNavVisible doc separateOnPageNav"><div class="fixedHeaderContainer"><div class="headerWrapper wrapper"><header><a href="/en"><img class="logo" src="/img/docusaurus.svg" alt="Docusaurus"/><h2 class="headerTitleWithLogo">Docusaurus</h2></a><a href="/en/versions.html"><h3>next</h3></a><div class="navigationWrapper navigationSlider"><nav class="slidingNav"><ul class="nav-site nav-site-internal"><li class="siteNavGroupActive"><a href="/docs/en/next/installation.html" target="_self">Docs</a></li><li class=""><a href="/en/help.html" target="_self">Help</a></li><li class=""><a href="/en/users.html" target="_self">Users</a></li><li class=""><a href="/en/about-slash.html" target="_self">About /</a></li><li class=""><a href="/blog" target="_self">Blog</a></li><li class=""><a href="https://github.com/facebook/docusaurus" target="_self">GitHub</a></li><span><li><a id="languages-menu" href="#"><img class="languages-icon" src="/img/language.svg"/>English</a><div id="languages-dropdown" class="hide"><ul id="languages-dropdown-items"><li><a href="/es-ES">Español</a></li><li><a href="/ro">Română</a></li><li><a href="/tr">Türkçe</a></li><li><a href="/zh-CN">简体中文</a></li><li><a href="https://crowdin.com/project/docusaurus" target="_blank" rel="noreferrer noopener">Help Translate</a></li></ul></div></li><script>
|
||||
</script><link rel="stylesheet" href="/css/main.css"/></head><body class="sideNavVisible doc separateOnPageNav"><div class="fixedHeaderContainer"><div class="headerWrapper wrapper"><header><a href="/en"><img class="logo" src="/img/docusaurus.svg" alt="Docusaurus"/><h2 class="headerTitleWithLogo">Docusaurus</h2></a><a href="/en/versions.html"><h3>next</h3></a><div class="navigationWrapper navigationSlider"><nav class="slidingNav"><ul class="nav-site nav-site-internal"><li class="siteNavGroupActive"><a href="/docs/en/next/installation" target="_self">Docs</a></li><li class=""><a href="/en/help" target="_self">Help</a></li><li class=""><a href="/en/users" target="_self">Users</a></li><li class=""><a href="/en/about-slash" target="_self">About /</a></li><li class=""><a href="/blog" target="_self">Blog</a></li><li class=""><a href="https://github.com/facebook/docusaurus" target="_self">GitHub</a></li><span><li><a id="languages-menu" href="#"><img class="languages-icon" src="/img/language.svg"/>English</a><div id="languages-dropdown" class="hide"><ul id="languages-dropdown-items"><li><a href="/es-ES">Español</a></li><li><a href="/ro">Română</a></li><li><a href="/tr">Türkçe</a></li><li><a href="/zh-CN">简体中文</a></li><li><a href="https://crowdin.com/project/docusaurus" target="_blank" rel="noreferrer noopener">Help Translate</a></li></ul></div></li><script>
|
||||
const languagesMenuItem = document.getElementById("languages-menu");
|
||||
const languagesDropDown = document.getElementById("languages-dropdown");
|
||||
languagesMenuItem.addEventListener("click", function(){
|
||||
|
@ -22,7 +22,7 @@
|
|||
languagesDropDown.className = "hide";
|
||||
}
|
||||
});
|
||||
</script></span><li class="navSearchWrapper reactNavSearchWrapper"><input type="text" id="search_input_react" placeholder="Search" title="Search"/></li></ul></nav></div></header></div></div><div class="navPusher"><div class="docMainWrapper wrapper"><div class="container docsNavContainer" id="docsNav"><nav class="toc"><div class="toggleNav"><section class="navWrapper wrapper"><div class="navBreadcrumb wrapper"><div class="navToggle" id="navToggler"><i></i></div><h2><i>›</i><span>Guides</span></h2></div><div class="navGroups"><div class="navGroup navGroupActive"><h3>Getting Started</h3><ul><li class="navListItem"><a class="navItem" href="/docs/en/next/installation.html">Installation</a></li><li class="navListItem"><a class="navItem" href="/docs/en/next/site-preparation.html">Site Preparation</a></li><li class="navListItem"><a class="navItem" href="/docs/en/next/site-creation.html">Creating your site</a></li><li class="navListItem"><a class="navItem" href="/docs/en/next/publishing.html">Publishing your site</a></li></ul></div><div class="navGroup navGroupActive"><h3>Guides</h3><ul><li class="navListItem"><a class="navItem" href="/docs/en/next/blog.html">Adding a Blog</a></li><li class="navListItem"><a class="navItem" href="/docs/en/next/custom-pages.html">Custom Pages</a></li><li class="navListItem"><a class="navItem" href="/docs/en/next/search.html">Enabling Search</a></li><li class="navListItem"><a class="navItem" href="/docs/en/next/navigation.html">Navigation and Sidebars</a></li><li class="navListItem navListItemActive"><a class="navItem navItemActive" href="/docs/en/next/translation.html">Translations & Localization</a></li><li class="navListItem"><a class="navItem" href="/docs/en/next/versioning.html">Versioning</a></li></ul></div><div class="navGroup navGroupActive"><h3>API</h3><ul><li class="navListItem"><a class="navItem" href="/docs/en/next/commands.html">CLI Commands</a></li><li class="navListItem"><a class="navItem" href="/docs/en/next/doc-markdown.html">Markdown Features</a></li><li class="navListItem"><a class="navItem" href="/docs/en/next/api-pages.html">Pages and Styles</a></li><li class="navListItem"><a class="navItem" href="/docs/en/next/site-config.html">siteConfig.js</a></li></ul></div></div></section></div><script>
|
||||
</script></span><li class="navSearchWrapper reactNavSearchWrapper"><input type="text" id="search_input_react" placeholder="Search" title="Search"/></li></ul></nav></div></header></div></div><div class="navPusher"><div class="docMainWrapper wrapper"><div class="container docsNavContainer" id="docsNav"><nav class="toc"><div class="toggleNav"><section class="navWrapper wrapper"><div class="navBreadcrumb wrapper"><div class="navToggle" id="navToggler"><i></i></div><h2><i>›</i><span>Guides</span></h2></div><div class="navGroups"><div class="navGroup navGroupActive"><h3>Getting Started</h3><ul><li class="navListItem"><a class="navItem" href="/docs/en/next/installation">Installation</a></li><li class="navListItem"><a class="navItem" href="/docs/en/next/site-preparation">Site Preparation</a></li><li class="navListItem"><a class="navItem" href="/docs/en/next/site-creation">Creating your site</a></li><li class="navListItem"><a class="navItem" href="/docs/en/next/publishing">Publishing your site</a></li></ul></div><div class="navGroup navGroupActive"><h3>Guides</h3><ul><li class="navListItem"><a class="navItem" href="/docs/en/next/blog">Adding a Blog</a></li><li class="navListItem"><a class="navItem" href="/docs/en/next/custom-pages">Custom Pages</a></li><li class="navListItem"><a class="navItem" href="/docs/en/next/search">Enabling Search</a></li><li class="navListItem"><a class="navItem" href="/docs/en/next/navigation">Navigation and Sidebars</a></li><li class="navListItem navListItemActive"><a class="navItem navItemActive" href="/docs/en/next/translation">Translations & Localization</a></li><li class="navListItem"><a class="navItem" href="/docs/en/next/versioning">Versioning</a></li></ul></div><div class="navGroup navGroupActive"><h3>API</h3><ul><li class="navListItem"><a class="navItem" href="/docs/en/next/commands">CLI Commands</a></li><li class="navListItem"><a class="navItem" href="/docs/en/next/doc-markdown">Markdown Features</a></li><li class="navListItem"><a class="navItem" href="/docs/en/next/api-pages">Pages and Styles</a></li><li class="navListItem"><a class="navItem" href="/docs/en/next/site-config">siteConfig.js</a></li></ul></div></div></section></div><script>
|
||||
var toggler = document.getElementById('navToggler');
|
||||
var nav = document.getElementById('docsNav');
|
||||
toggler.onclick = function() {
|
||||
|
@ -208,7 +208,7 @@ CROWDIN_DOCUSAURUS_PROJECT_ID=YOUR_CROWDIN_PROJECT_ID CROWDIN_DOCUSAURUS_API_KEY
|
|||
<span class="hljs-attr"> languages_mapping:</span> <span class="hljs-meta">*anchor</span>
|
||||
</code></pre>
|
||||
<p>Translated, versioned documents will be copied into <code>website/translated_docs/${language}/${version}/</code>.</p>
|
||||
</span></div></article></div><div class="docs-prevnext"><a class="docs-prev button" href="navigation.html">← Navigation and Sidebars</a><a class="docs-next button" href="versioning.html">Versioning →</a></div></div></div><nav class="onPageNav"><ul class="toc-headings"><li><a href="#docusaurus-translation-configurations">Docusaurus Translation Configurations</a></li><li><a href="#translating-your-existing-docs">Translating Your Existing Docs</a></li><li><a href="#enabling-translations-on-pages">Enabling Translations on Pages</a></li><li><a href="#gathering-strings-to-translate">Gathering Strings to Translate</a></li><li><a href="#how-strings-get-translated">How Strings Get Translated</a></li><li><a href="#how-docusaurus-uses-string-translations">How Docusaurus Uses String Translations</a><ul class="toc-headings"><li><a href="#strings">Strings</a></li><li><a href="#markdown-files">Markdown Files</a></li><li><a href="#other-pages">Other Pages</a></li></ul></li><li><a href="#crowdin">Crowdin</a><ul class="toc-headings"><li><a href="#setup-the-crowdin-scripts">Setup the Crowdin Scripts</a></li><li><a href="#manual-file-sync">Manual File Sync</a></li><li><a href="#automated-file-sync-using-circleci">Automated File Sync Using CircleCI</a></li></ul></li><li><a href="#versioned-translations">Versioned Translations</a></li></ul></nav></div><footer class="nav-footer" id="footer"><section class="sitemap"><a href="/" class="nav-home"><img src="/img/docusaurus_monochrome.svg" alt="Docusaurus" width="66" height="58"/></a><div><h5>Docs</h5><a href="
|
||||
</span></div></article></div><div class="docs-prevnext"><a class="docs-prev button" href="navigation">← Navigation and Sidebars</a><a class="docs-next button" href="versioning">Versioning →</a></div></div></div><nav class="onPageNav"><ul class="toc-headings"><li><a href="#docusaurus-translation-configurations">Docusaurus Translation Configurations</a></li><li><a href="#translating-your-existing-docs">Translating Your Existing Docs</a></li><li><a href="#enabling-translations-on-pages">Enabling Translations on Pages</a></li><li><a href="#gathering-strings-to-translate">Gathering Strings to Translate</a></li><li><a href="#how-strings-get-translated">How Strings Get Translated</a></li><li><a href="#how-docusaurus-uses-string-translations">How Docusaurus Uses String Translations</a><ul class="toc-headings"><li><a href="#strings">Strings</a></li><li><a href="#markdown-files">Markdown Files</a></li><li><a href="#other-pages">Other Pages</a></li></ul></li><li><a href="#crowdin">Crowdin</a><ul class="toc-headings"><li><a href="#setup-the-crowdin-scripts">Setup the Crowdin Scripts</a></li><li><a href="#manual-file-sync">Manual File Sync</a></li><li><a href="#automated-file-sync-using-circleci">Automated File Sync Using CircleCI</a></li></ul></li><li><a href="#versioned-translations">Versioned Translations</a></li></ul></nav></div><footer class="nav-footer" id="footer"><section class="sitemap"><a href="/" class="nav-home"><img src="/img/docusaurus_monochrome.svg" alt="Docusaurus" width="66" height="58"/></a><div><h5>Docs</h5><a href="
|
||||
/docs/en/installation.html">Getting Started</a><a href="
|
||||
/docs/en/versioning.html">Versioning</a><a href="
|
||||
/docs/en/translation.html">Localization</a><a href="
|
||||
|
|
223
docs/en/next/translation/index.html
Normal file
223
docs/en/next/translation/index.html
Normal file
|
@ -0,0 +1,223 @@
|
|||
<!DOCTYPE html><html lang="en"><head><meta charSet="utf-8"/><meta http-equiv="X-UA-Compatible" content="IE=edge"/><title>Translations & Localization · Docusaurus</title><meta name="viewport" content="width=device-width"/><meta name="generator" content="Docusaurus"/><meta property="og:title" content="Translations & Localization · Docusaurus"/><meta property="og:type" content="website"/><meta property="og:url" content="https://docusaurus.io/index.html"/><meta property="og:description" content="Docusaurus allows for easy translation functionality using [Crowdin](https://crowdin.com/). Documentation files written in English are uploaded to Crowdin for translation by users within a community. Top-level pages written with English strings can be translated by wrapping any strings you want to translate in a `<translate>` tag. Other titles and labels will also be found and properly translated."/><meta property="og:image" content="https://docusaurus.io/img/docusaurus.png"/><meta name="twitter:card" content="summary"/><meta name="twitter:image" content="https://docusaurus.io/img/docusaurus.png"/><link rel="shortcut icon" href="/img/docusaurus.ico"/><link rel="stylesheet" href="https://cdn.jsdelivr.net/docsearch.js/1/docsearch.min.css"/><link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/highlight.js/9.12.0/styles/atom-one-dark.min.css"/><link rel="alternate" type="application/atom+xml" href="https://docusaurus.io/blog/atom.xml" title="Docusaurus Blog ATOM Feed"/><link rel="alternate" type="application/rss+xml" href="https://docusaurus.io/blog/feed.xml" title="Docusaurus Blog RSS Feed"/><script>
|
||||
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
|
||||
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
|
||||
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
|
||||
})(window,document,'script','https://www.google-analytics.com/analytics.js','ga');
|
||||
|
||||
ga('create', 'UA-44373548-31', 'auto');
|
||||
ga('send', 'pageview');
|
||||
</script><link rel="stylesheet" href="/css/code-blocks-buttons.css"/><script type="text/javascript" src="https://buttons.github.io/buttons.js"></script><script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/clipboard.js/2.0.0/clipboard.min.js"></script><script type="text/javascript" src="/js/code-blocks-buttons.js"></script><script src="https://unpkg.com/vanilla-back-to-top@7.1.14/dist/vanilla-back-to-top.min.js"></script><script>
|
||||
document.addEventListener("DOMContentLoaded", function(){
|
||||
addBackToTop(
|
||||
{"zIndex":100}
|
||||
)
|
||||
});
|
||||
</script><link rel="stylesheet" href="/css/main.css"/></head><body class="sideNavVisible doc separateOnPageNav"><div class="fixedHeaderContainer"><div class="headerWrapper wrapper"><header><a href="/en"><img class="logo" src="/img/docusaurus.svg" alt="Docusaurus"/><h2 class="headerTitleWithLogo">Docusaurus</h2></a><a href="/en/versions.html"><h3>next</h3></a><div class="navigationWrapper navigationSlider"><nav class="slidingNav"><ul class="nav-site nav-site-internal"><li class="siteNavGroupActive"><a href="/docs/en/next/installation" target="_self">Docs</a></li><li class=""><a href="/en/help" target="_self">Help</a></li><li class=""><a href="/en/users" target="_self">Users</a></li><li class=""><a href="/en/about-slash" target="_self">About /</a></li><li class=""><a href="/blog" target="_self">Blog</a></li><li class=""><a href="https://github.com/facebook/docusaurus" target="_self">GitHub</a></li><span><li><a id="languages-menu" href="#"><img class="languages-icon" src="/img/language.svg"/>English</a><div id="languages-dropdown" class="hide"><ul id="languages-dropdown-items"><li><a href="/es-ES">Español</a></li><li><a href="/ro">Română</a></li><li><a href="/tr">Türkçe</a></li><li><a href="/zh-CN">简体中文</a></li><li><a href="https://crowdin.com/project/docusaurus" target="_blank" rel="noreferrer noopener">Help Translate</a></li></ul></div></li><script>
|
||||
const languagesMenuItem = document.getElementById("languages-menu");
|
||||
const languagesDropDown = document.getElementById("languages-dropdown");
|
||||
languagesMenuItem.addEventListener("click", function(){
|
||||
if(languagesDropDown.className == "hide") {
|
||||
languagesDropDown.className = "visible";
|
||||
} else {
|
||||
languagesDropDown.className = "hide";
|
||||
}
|
||||
});
|
||||
</script></span><li class="navSearchWrapper reactNavSearchWrapper"><input type="text" id="search_input_react" placeholder="Search" title="Search"/></li></ul></nav></div></header></div></div><div class="navPusher"><div class="docMainWrapper wrapper"><div class="container docsNavContainer" id="docsNav"><nav class="toc"><div class="toggleNav"><section class="navWrapper wrapper"><div class="navBreadcrumb wrapper"><div class="navToggle" id="navToggler"><i></i></div><h2><i>›</i><span>Guides</span></h2></div><div class="navGroups"><div class="navGroup navGroupActive"><h3>Getting Started</h3><ul><li class="navListItem"><a class="navItem" href="/docs/en/next/installation">Installation</a></li><li class="navListItem"><a class="navItem" href="/docs/en/next/site-preparation">Site Preparation</a></li><li class="navListItem"><a class="navItem" href="/docs/en/next/site-creation">Creating your site</a></li><li class="navListItem"><a class="navItem" href="/docs/en/next/publishing">Publishing your site</a></li></ul></div><div class="navGroup navGroupActive"><h3>Guides</h3><ul><li class="navListItem"><a class="navItem" href="/docs/en/next/blog">Adding a Blog</a></li><li class="navListItem"><a class="navItem" href="/docs/en/next/custom-pages">Custom Pages</a></li><li class="navListItem"><a class="navItem" href="/docs/en/next/search">Enabling Search</a></li><li class="navListItem"><a class="navItem" href="/docs/en/next/navigation">Navigation and Sidebars</a></li><li class="navListItem navListItemActive"><a class="navItem navItemActive" href="/docs/en/next/translation">Translations & Localization</a></li><li class="navListItem"><a class="navItem" href="/docs/en/next/versioning">Versioning</a></li></ul></div><div class="navGroup navGroupActive"><h3>API</h3><ul><li class="navListItem"><a class="navItem" href="/docs/en/next/commands">CLI Commands</a></li><li class="navListItem"><a class="navItem" href="/docs/en/next/doc-markdown">Markdown Features</a></li><li class="navListItem"><a class="navItem" href="/docs/en/next/api-pages">Pages and Styles</a></li><li class="navListItem"><a class="navItem" href="/docs/en/next/site-config">siteConfig.js</a></li></ul></div></div></section></div><script>
|
||||
var toggler = document.getElementById('navToggler');
|
||||
var nav = document.getElementById('docsNav');
|
||||
toggler.onclick = function() {
|
||||
nav.classList.toggle('docsSliderActive');
|
||||
};
|
||||
</script></nav></div><div class="container mainContainer"><div class="wrapper"><div class="post"><header class="postHeader"><a class="edit-page-link button" href="https://github.com/facebook/docusaurus/edit/master/docs/guides-translation.md" target="_blank" rel="noreferrer noopener">Edit</a><h1>Translations & Localization</h1></header><article><div><span><p>Docusaurus allows for easy translation functionality using <a href="https://crowdin.com/">Crowdin</a>. Documentation files written in English are uploaded to Crowdin for translation by users within a community. Top-level pages written with English strings can be translated by wrapping any strings you want to translate in a <code><translate></code> tag. Other titles and labels will also be found and properly translated.</p>
|
||||
<h2><a class="anchor" aria-hidden="true" id="docusaurus-translation-configurations"></a><a href="#docusaurus-translation-configurations" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Docusaurus Translation Configurations</h2>
|
||||
<p>To generate example files for translations with Docusaurus, run the <code>examples</code> script with the command line argument <code>translations</code>:</p>
|
||||
<pre><code class="hljs css bash">npm run examples translations
|
||||
</code></pre>
|
||||
<p>or</p>
|
||||
<pre><code class="hljs css bash">yarn examples translations
|
||||
</code></pre>
|
||||
<p>This will create the following files:</p>
|
||||
<pre><code class="hljs css bash">pages/en/<span class="hljs-built_in">help</span>-with-translations.js
|
||||
languages.js
|
||||
../crowdin.yaml
|
||||
</code></pre>
|
||||
<ul>
|
||||
<li>The <code>pages/en/help-with-translations.js</code> file includes the same starter help page generated by the <code>examples</code> script, but now includes translation tags.</li>
|
||||
</ul>
|
||||
<blockquote>
|
||||
<p>Generally, you will use <code>help-with-translations.js</code> as a guide to enable translations in your other pages, but not actually commit the file to your repo (i.e., you can delete it). However, if you want a Help page, and you currently do not have one, you can rename this file to <code>help.js</code> and use it as a starting point.</p>
|
||||
</blockquote>
|
||||
<ul>
|
||||
<li><p>The <code>languages.js</code> file tells Docusaurus what languages you want to enable for your site. By default, we expect English to be enabled.</p></li>
|
||||
<li><p>The <code>crowdin.yaml</code> file is used to configure Crowdin integration, and is copied up one level into your Docusaurus project repo. If your Docusaurus project resides in <code>/project/website</code>, then <code>crowdin.yaml</code> will be copied to <code>/project/crowdin.yaml</code>.</p></li>
|
||||
</ul>
|
||||
<h2><a class="anchor" aria-hidden="true" id="translating-your-existing-docs"></a><a href="#translating-your-existing-docs" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Translating Your Existing Docs</h2>
|
||||
<p>Your documentation files (e.g., the <code>.md</code> files that live in your <code>docs</code> directory) do not need to be changed or moved to support translations. They will be uploaded to Crowdin to be translated directly.</p>
|
||||
<h2><a class="anchor" aria-hidden="true" id="enabling-translations-on-pages"></a><a href="#enabling-translations-on-pages" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Enabling Translations on Pages</h2>
|
||||
<p>Pages allow you to customize layout and specific content of pages like a custom index page or help page.</p>
|
||||
<p>Pages with text that you want translated should be placed in <code>website/pages/en</code> folder.</p>
|
||||
<p>Wrap strings you want translated in a <code><translate></code> tag, and add the following <code>require</code> statement to the top of the file:</p>
|
||||
<pre><code class="hljs css jsx">...
|
||||
const translate = require('../../server/translate.js').translate;
|
||||
...
|
||||
<h2>
|
||||
<translate>This header will be translated</translate>
|
||||
</h2>
|
||||
...
|
||||
</code></pre>
|
||||
<p>You can also include an optional description attribute to give more context to a translator about how to translate the string:</p>
|
||||
<pre><code class="hljs css jsx"><p>
|
||||
<span class="xml"><span class="hljs-tag"><<span class="hljs-name">translate</span> <span class="hljs-attr">desc</span>=<span class="hljs-string">"flower, not verb"</span>></span>Rose<span class="hljs-tag"></<span class="hljs-name">translate</span>></span></span>
|
||||
<p>
|
||||
</code></pre>
|
||||
<blockquote>
|
||||
<p>The <code><translate></code> tag generally works well on pure strings. If you have a string like "Docusaurus currently provides support to help your website use <a href="${siteConfig.baseUrl}docs/${this.props.language}/translation.html">translations</a>", wrapping the <code><translation></code> tag around that entire string will cause issues because of the markdown linking, etc. Your options are to not translate those strings, or spread a bunch of <code><translate></code> tags amongst the pure substrings of that string.</p>
|
||||
</blockquote>
|
||||
<h2><a class="anchor" aria-hidden="true" id="gathering-strings-to-translate"></a><a href="#gathering-strings-to-translate" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Gathering Strings to Translate</h2>
|
||||
<p>The strings within localized Pages must be extracted and provided to Crowdin.</p>
|
||||
<p>Add the following script to your <code>website/package.json</code> file, if it does not exist already:</p>
|
||||
<pre><code class="hljs css js">{
|
||||
...
|
||||
<span class="hljs-string">"scripts"</span>: {
|
||||
<span class="hljs-string">"write-translations"</span>: <span class="hljs-string">"docusaurus-write-translations"</span>
|
||||
},
|
||||
...
|
||||
}
|
||||
</code></pre>
|
||||
<p>Running the script will generate a <code>website/i18n/en.json</code> file containing all the strings that will be translated from English into other languages.</p>
|
||||
<p>The script will include text from the following places:</p>
|
||||
<ul>
|
||||
<li><code>title</code> and <code>sidebar_label</code> strings in document markdown headers</li>
|
||||
<li>category names in <code>sidebars.json</code></li>
|
||||
<li>tagline in <code>siteConfig.js</code></li>
|
||||
<li>header link <code>label</code> strings in <code>siteConfig.js</code></li>
|
||||
<li>strings wrapped in the <code><translate></code> tag in any <code>.js</code> files inside <code>pages</code></li>
|
||||
</ul>
|
||||
<h2><a class="anchor" aria-hidden="true" id="how-strings-get-translated"></a><a href="#how-strings-get-translated" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>How Strings Get Translated</h2>
|
||||
<p>Docusaurus itself does not do any translation from one language to another. Instead, it integrates <a href="https://crowdin.com/">Crowdin</a> to upload translations and then downloads the appropriately translated files from Crowdin.</p>
|
||||
<h2><a class="anchor" aria-hidden="true" id="how-docusaurus-uses-string-translations"></a><a href="#how-docusaurus-uses-string-translations" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>How Docusaurus Uses String Translations</h2>
|
||||
<p>This section provides context about how translations in Docusaurus works.</p>
|
||||
<h3><a class="anchor" aria-hidden="true" id="strings"></a><a href="#strings" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Strings</h3>
|
||||
<p>A Docusaurus site has many strings used throughout it that require localization. However, maintaining a list of strings used through out a site can be laborious. Docusaurus simplifies this by centralizing strings.</p>
|
||||
<p>The header navigation, for example can have links to 'Home' or your 'Blog'. This and other strings found in the headers and sidebars of pages are extracted and placed into <code>i18n/en.json</code>. When your files are translated, say into Spanish, a <code>i18n/es-ES.json</code> file will be downloaded from Crowdin. Then, when the Spanish pages are generated, Docusaurus will replace the English version of corresponding strings with translated strings from the corresponding localized strings file (e.g. In a Spanish enabled site 'Help' will become 'Ayuda').</p>
|
||||
<h3><a class="anchor" aria-hidden="true" id="markdown-files"></a><a href="#markdown-files" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Markdown Files</h3>
|
||||
<p>For documentation files themselves, translated versions of these files are downloaded and then rendered through the proper layout template.</p>
|
||||
<h3><a class="anchor" aria-hidden="true" id="other-pages"></a><a href="#other-pages" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Other Pages</h3>
|
||||
<p>For other pages, Docusaurus will automatically transform all <code><translate></code> tags it finds into function calls that return the translated strings from the corresponding localized file <em><code>locale.json</code></em>.</p>
|
||||
<h2><a class="anchor" aria-hidden="true" id="crowdin"></a><a href="#crowdin" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Crowdin</h2>
|
||||
<p>Crowdin is a company that provides translation services. For Open Source projects, Crowdin provides free string translations.</p>
|
||||
<p>Create your translation project on <a href="https://crowdin.com/">Crowdin</a>. You can use <a href="https://support.crowdin.com/translation-process-overview/">Crowdin's guides</a> to learn more about the translations work flow. <em>We suggest that you deselect and do not include "English" as a translatable language to prevent the creation of <code>en-US</code> localization files as this can lead to confusion.</em></p>
|
||||
<blockquote>
|
||||
<p>Ensure in your Crowdin settings, in the Translations section, that "Duplicate Strings" are set to <a href="https://support.crowdin.com/api/create-project/">"Hide - all duplicates will share the same translation"</a>. This setting will ensure that identical strings between versions share a single translation.</p>
|
||||
</blockquote>
|
||||
<p>Your project will need a <code>crowdin.yaml</code> file generated. If you ran <code>yarn examples translations</code> or <code>npm run examples translations</code>, this file was created for you on the same level as your <code>website</code> directory.</p>
|
||||
<blockquote>
|
||||
<p>You will need to install the <code>crowdin</code> command line interface. Please follow the <a href="https://support.crowdin.com/cli-tool/">installation directions</a>.</p>
|
||||
</blockquote>
|
||||
<p>The example below can be automatically generated by the Docusaurus cli with the <code>examples</code> script. It should be placed in the top level of your project directory to configure how and what files are uploaded/downloaded.</p>
|
||||
<p>Below is an example Crowdin configuration for the respective languages: German, Spanish, French, Japanese, Korean, Bahasa Indonesia, Portuguese Brazilian, Chinese Simplified, and Chinese Traditional.</p>
|
||||
<pre><code class="hljs css yaml"><span class="hljs-attr">project_identifier_env:</span> <span class="hljs-string">CROWDIN_DOCUSAURUS_PROJECT_ID</span>
|
||||
<span class="hljs-attr">api_key_env:</span> <span class="hljs-string">CROWDIN_DOCUSAURUS_API_KEY</span>
|
||||
<span class="hljs-attr">base_path:</span> <span class="hljs-string">"./"</span>
|
||||
<span class="hljs-attr">preserve_hierarchy:</span> <span class="hljs-literal">true</span>
|
||||
|
||||
<span class="hljs-attr">files:</span>
|
||||
<span class="hljs-bullet"> -</span>
|
||||
<span class="hljs-attr"> source:</span> <span class="hljs-string">'/docs/*.md'</span>
|
||||
<span class="hljs-attr"> translation:</span> <span class="hljs-string">'/website/translated_docs/%locale%/%original_file_name%'</span>
|
||||
<span class="hljs-attr"> languages_mapping:</span> <span class="hljs-meta">&anchor</span>
|
||||
<span class="hljs-attr"> locale:</span>
|
||||
<span class="hljs-attr"> 'de':</span> <span class="hljs-string">'de'</span>
|
||||
<span class="hljs-attr"> 'es-ES':</span> <span class="hljs-string">'es-ES'</span>
|
||||
<span class="hljs-attr"> 'fr':</span> <span class="hljs-string">'fr'</span>
|
||||
<span class="hljs-attr"> 'ja':</span> <span class="hljs-string">'ja'</span>
|
||||
<span class="hljs-attr"> 'ko':</span> <span class="hljs-string">'ko'</span>
|
||||
<span class="hljs-attr"> 'mr':</span> <span class="hljs-string">'mr-IN'</span>
|
||||
<span class="hljs-attr"> 'pt-BR':</span> <span class="hljs-string">'pt-BR'</span>
|
||||
<span class="hljs-attr"> 'zh-CN':</span> <span class="hljs-string">'zh-CN'</span>
|
||||
<span class="hljs-attr"> 'zh-TW':</span> <span class="hljs-string">'zh-TW'</span>
|
||||
</code></pre>
|
||||
<p>You can go <a href="https://support.crowdin.com/configuration-file/">here</a> to learn more about customizing your <code>crowdin.yaml</code> file.</p>
|
||||
<h3><a class="anchor" aria-hidden="true" id="setup-the-crowdin-scripts"></a><a href="#setup-the-crowdin-scripts" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Setup the Crowdin Scripts</h3>
|
||||
<p>You will want to manually sync your files to and from Crowdin. The sync process will upload any markdown files in <code>/docs</code> as well as translatable strings in <code>website/i18n/en.json</code>. (These strings can be generated by running <code>yarn write-translations</code>.)</p>
|
||||
<p>You can add the following to your <code>package.json</code> to manually trigger Crowdin.</p>
|
||||
<pre><code class="hljs css js"><span class="hljs-string">"scripts"</span>: {
|
||||
<span class="hljs-string">"crowdin-upload"</span>: <span class="hljs-string">"crowdin --config ../crowdin.yaml upload sources --auto-update -b master"</span>,
|
||||
<span class="hljs-string">"crowdin-download"</span>: <span class="hljs-string">"crowdin --config ../crowdin.yaml download -b master"</span>
|
||||
},
|
||||
</code></pre>
|
||||
<h3><a class="anchor" aria-hidden="true" id="manual-file-sync"></a><a href="#manual-file-sync" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Manual File Sync</h3>
|
||||
<p>You will always want to upload your markdown files and translatable strings first and the download the translations section. So run the commands in this order:</p>
|
||||
<pre><code class="hljs css bash">CROWDIN_DOCUSAURUS_PROJECT_ID=YOUR_CROWDIN_PROJECT_ID CROWDIN_DOCUSAURUS_API_KEY=YOUR_CROWDIN_API_KEY yarn run crowdin-upload
|
||||
CROWDIN_DOCUSAURUS_PROJECT_ID=YOUR_CROWDIN_PROJECT_ID CROWDIN_DOCUSAURUS_API_KEY=YOUR_CROWDIN_API_KEY yarn run crowdin-download
|
||||
</code></pre>
|
||||
<blockquote>
|
||||
<p><code>YOUR_CROWDIN_PROJECT_ID</code> is the name of your Crowdin project. e.g., for <a href="https://crowdin.com/project/docusaurus/">https://crowdin.com/project/docusaurus/</a>, that variable would be set to <code>docusaurus</code>. <code>YOUR_CROWDIN_API_KEY</code> is a unique key that is like a password. You can find it in the <code>API</code> tab of your Crowdin project's <code>Settings</code>.</p>
|
||||
</blockquote>
|
||||
<blockquote>
|
||||
<p>These commands require having an environment variable set with your Crowdin project id and api key (<code>CROWDIN_PROJECT_ID</code>, <code>CROWDIN_API_KEY</code>). You can preface them inline as done above or add them permanently to your <code>.bashrc</code> or <code>.bash_profile</code>.</p>
|
||||
</blockquote>
|
||||
<blockquote>
|
||||
<p>If you run more than one localized Docusaurus project on your computer, you should change the name of the environment variables to something unique (<code>CROWDIN_PROJECTNAME_PROJECT_ID</code>, <code>CROWDIN_PROJECTNAME_API_KEY</code>).</p>
|
||||
</blockquote>
|
||||
<blockquote>
|
||||
<p>Since the files are generated, you do not need to have any files in your <code>website/i18n</code> or <code>website/translated_docs</code> directory as part of your repo. So you can can add <code>website/i18n/*</code> and <code>website/translated_docs</code> to your <code>.gitignore</code> file.</p>
|
||||
</blockquote>
|
||||
<h3><a class="anchor" aria-hidden="true" id="automated-file-sync-using-circleci"></a><a href="#automated-file-sync-using-circleci" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Automated File Sync Using CircleCI</h3>
|
||||
<p>You can automate pulling down and uploading translations for your files using the <a href="https://circleci.com">CircleCI</a> web continuous integration service.</p>
|
||||
<p>First, update the <code>circle.yml</code> file in your project directory to include steps to upload English files to be translated and download translated files using the Crowdin CLI. Here is an example <code>circle.yml</code> file:</p>
|
||||
<pre><code class="hljs css yaml"><span class="hljs-attr">machine:</span>
|
||||
<span class="hljs-attr"> node:</span>
|
||||
<span class="hljs-attr"> version:</span> <span class="hljs-number">6.10</span><span class="hljs-number">.3</span>
|
||||
<span class="hljs-attr"> npm:</span>
|
||||
<span class="hljs-attr"> version:</span> <span class="hljs-number">3.10</span><span class="hljs-number">.10</span>
|
||||
|
||||
<span class="hljs-attr">test:</span>
|
||||
<span class="hljs-attr"> override:</span>
|
||||
<span class="hljs-bullet"> -</span> <span class="hljs-string">"true"</span>
|
||||
|
||||
<span class="hljs-attr">deployment:</span>
|
||||
<span class="hljs-attr"> website:</span>
|
||||
<span class="hljs-attr"> branch:</span> <span class="hljs-string">master</span>
|
||||
<span class="hljs-attr"> commands:</span>
|
||||
<span class="hljs-comment"># configure git user</span>
|
||||
<span class="hljs-bullet"> -</span> <span class="hljs-string">git</span> <span class="hljs-string">config</span> <span class="hljs-bullet">--global</span> <span class="hljs-string">user.email</span> <span class="hljs-string">"test-site-bot@users.noreply.github.com"</span>
|
||||
<span class="hljs-bullet"> -</span> <span class="hljs-string">git</span> <span class="hljs-string">config</span> <span class="hljs-bullet">--global</span> <span class="hljs-string">user.name</span> <span class="hljs-string">"Website Deployment Script"</span>
|
||||
<span class="hljs-bullet"> -</span> <span class="hljs-string">echo</span> <span class="hljs-string">"machine github.com login test-site-bot password $GITHUB_TOKEN"</span> <span class="hljs-string">> ~/.netrc
|
||||
# install Docusaurus and generate file of English strings
|
||||
- cd website && npm install && npm run write-translations && cd ..
|
||||
# crowdin install
|
||||
- sudo apt-get install default-jre
|
||||
- wget https://artifacts.crowdin.com/repo/deb/crowdin.deb -O crowdin.deb
|
||||
- sudo dpkg -i crowdin.deb
|
||||
# translations upload/download
|
||||
- crowdin --config crowdin.yaml upload sources --auto-update -b master
|
||||
- crowdin --config crowdin.yaml download -b master
|
||||
# build and publish website
|
||||
- cd website && GIT_USER=test-site-bot npm run publish-gh-pages
|
||||
</span></code></pre>
|
||||
<p>The <code>crowdin</code> command uses the <code>crowdin.yaml</code> file generated with the <code>examples</code> script. It should be placed in your project directory to configure how and what files are uploaded/downloaded.</p>
|
||||
<p>Note that in the <code>crowdin.yaml</code> file, <code>CROWDIN_PROJECT_ID</code> and <code>CROWDIN_API_KEY</code> are environment variables set-up in Circle for your Crowdin project. They can be found in your Crowdin project settings.</p>
|
||||
<p>Now, Circle will help you automatically get translations prior to building your website. The provided <code>crowdin.yaml</code> file will copy translated documents into <code>website/translated_docs/</code>, and translated versions of the <code>i18n/en.json</code> strings file will into <code>i18n/${language}.json</code>.</p>
|
||||
<p>If you wish to use Crowdin on your machine locally, you can install the <a href="https://support.crowdin.com/cli-tool/">Crowdin CLI tool</a> and run the same commands found in the <code>circle.yaml</code> file. The only difference is that you must set <code>project_identifier</code> and <code>api_key</code> values in the <code>crowdin.yaml</code> file since you will not have Circle environment variables set up.</p>
|
||||
<h2><a class="anchor" aria-hidden="true" id="versioned-translations"></a><a href="#versioned-translations" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Versioned Translations</h2>
|
||||
<p>If you wish to have translation and versioning for your documentation, add the following section to the end of your <code>crowdin.yaml</code> file:</p>
|
||||
<pre><code class="hljs css yaml"><span class="hljs-bullet"> -</span>
|
||||
<span class="hljs-attr"> source:</span> <span class="hljs-string">'/website/versioned_docs/**/*.md'</span>
|
||||
<span class="hljs-attr"> translation:</span> <span class="hljs-string">'/website/translated_docs/%locale%/**/%original_file_name%'</span>
|
||||
<span class="hljs-attr"> languages_mapping:</span> <span class="hljs-meta">*anchor</span>
|
||||
</code></pre>
|
||||
<p>Translated, versioned documents will be copied into <code>website/translated_docs/${language}/${version}/</code>.</p>
|
||||
</span></div></article></div><div class="docs-prevnext"><a class="docs-prev button" href="navigation">← Navigation and Sidebars</a><a class="docs-next button" href="versioning">Versioning →</a></div></div></div><nav class="onPageNav"><ul class="toc-headings"><li><a href="#docusaurus-translation-configurations">Docusaurus Translation Configurations</a></li><li><a href="#translating-your-existing-docs">Translating Your Existing Docs</a></li><li><a href="#enabling-translations-on-pages">Enabling Translations on Pages</a></li><li><a href="#gathering-strings-to-translate">Gathering Strings to Translate</a></li><li><a href="#how-strings-get-translated">How Strings Get Translated</a></li><li><a href="#how-docusaurus-uses-string-translations">How Docusaurus Uses String Translations</a><ul class="toc-headings"><li><a href="#strings">Strings</a></li><li><a href="#markdown-files">Markdown Files</a></li><li><a href="#other-pages">Other Pages</a></li></ul></li><li><a href="#crowdin">Crowdin</a><ul class="toc-headings"><li><a href="#setup-the-crowdin-scripts">Setup the Crowdin Scripts</a></li><li><a href="#manual-file-sync">Manual File Sync</a></li><li><a href="#automated-file-sync-using-circleci">Automated File Sync Using CircleCI</a></li></ul></li><li><a href="#versioned-translations">Versioned Translations</a></li></ul></nav></div><footer class="nav-footer" id="footer"><section class="sitemap"><a href="/" class="nav-home"><img src="/img/docusaurus_monochrome.svg" alt="Docusaurus" width="66" height="58"/></a><div><h5>Docs</h5><a href="
|
||||
/docs/en/installation.html">Getting Started</a><a href="
|
||||
/docs/en/versioning.html">Versioning</a><a href="
|
||||
/docs/en/translation.html">Localization</a><a href="
|
||||
/docs/en/search.html">Adding Search</a></div><div><h5>Community</h5><a href="/en/users.html">User Showcase</a></div><div><h5>More</h5><div class="social"><a class="github-button" href="https://github.com/facebook/Docusaurus" data-count-href="/facebook/Docusaurus/stargazers" data-show-count="true" data-count-aria-label="# stargazers on GitHub" aria-label="Star this project on GitHub">Docusaurus</a></div><div class="social"><a href="https://twitter.com/docusaurus" class="twitter-follow-button">Follow @docusaurus</a></div><div class="social"><div class="fb-like" data-href="https://docusaurus.io" data-layout="standard" data-share="true" data-width="225" data-show-faces="false"></div></div></div></section><a href="https://code.facebook.com/projects/" target="_blank" rel="noreferrer noopener" class="fbOpenSource"><img src="/img/oss_logo.png" alt="Facebook Open Source" width="170" height="45"/></a><section class="copyright"><span>Copyright © 2018 Facebook Inc.</span></section></footer></div><script type="text/javascript" src="https://cdn.jsdelivr.net/docsearch.js/1/docsearch.min.js"></script><script>window.fbAsyncInit = function() {FB.init({appId:'199138890728411',xfbml:true,version:'v2.7'});};(function(d, s, id){var js, fjs = d.getElementsByTagName(s)[0];if (d.getElementById(id)) {return;}js = d.createElement(s); js.id = id;js.src = '//connect.facebook.net/en_US/sdk.js';fjs.parentNode.insertBefore(js, fjs);}(document, 'script','facebook-jssdk'));
|
||||
</script><script>window.twttr=(function(d,s, id){var js,fjs=d.getElementsByTagName(s)[0],t=window.twttr||{};if(d.getElementById(id))return t;js=d.createElement(s);js.id=id;js.src='https://platform.twitter.com/widgets.js';fjs.parentNode.insertBefore(js, fjs);t._e = [];t.ready = function(f) {t._e.push(f);};return t;}(document, 'script', 'twitter-wjs'));</script><script>
|
||||
var search = docsearch({
|
||||
|
||||
apiKey: '3eb9507824b8be89e7a199ecaa1a9d2c',
|
||||
indexName: 'docusaurus',
|
||||
inputSelector: '#search_input_react'
|
||||
});
|
||||
</script></body></html>
|
|
@ -12,7 +12,7 @@
|
|||
{"zIndex":100}
|
||||
)
|
||||
});
|
||||
</script><link rel="stylesheet" href="/css/main.css"/></head><body class="sideNavVisible doc separateOnPageNav"><div class="fixedHeaderContainer"><div class="headerWrapper wrapper"><header><a href="/en"><img class="logo" src="/img/docusaurus.svg" alt="Docusaurus"/><h2 class="headerTitleWithLogo">Docusaurus</h2></a><a href="/en/versions.html"><h3>next</h3></a><div class="navigationWrapper navigationSlider"><nav class="slidingNav"><ul class="nav-site nav-site-internal"><li class="siteNavGroupActive"><a href="/docs/en/next/installation.html" target="_self">Docs</a></li><li class=""><a href="/en/help.html" target="_self">Help</a></li><li class=""><a href="/en/users.html" target="_self">Users</a></li><li class=""><a href="/en/about-slash.html" target="_self">About /</a></li><li class=""><a href="/blog" target="_self">Blog</a></li><li class=""><a href="https://github.com/facebook/docusaurus" target="_self">GitHub</a></li><span><li><a id="languages-menu" href="#"><img class="languages-icon" src="/img/language.svg"/>English</a><div id="languages-dropdown" class="hide"><ul id="languages-dropdown-items"><li><a href="/es-ES">Español</a></li><li><a href="/ro">Română</a></li><li><a href="/tr">Türkçe</a></li><li><a href="/zh-CN">简体中文</a></li><li><a href="https://crowdin.com/project/docusaurus" target="_blank" rel="noreferrer noopener">Help Translate</a></li></ul></div></li><script>
|
||||
</script><link rel="stylesheet" href="/css/main.css"/></head><body class="sideNavVisible doc separateOnPageNav"><div class="fixedHeaderContainer"><div class="headerWrapper wrapper"><header><a href="/en"><img class="logo" src="/img/docusaurus.svg" alt="Docusaurus"/><h2 class="headerTitleWithLogo">Docusaurus</h2></a><a href="/en/versions.html"><h3>next</h3></a><div class="navigationWrapper navigationSlider"><nav class="slidingNav"><ul class="nav-site nav-site-internal"><li class="siteNavGroupActive"><a href="/docs/en/next/installation" target="_self">Docs</a></li><li class=""><a href="/en/help" target="_self">Help</a></li><li class=""><a href="/en/users" target="_self">Users</a></li><li class=""><a href="/en/about-slash" target="_self">About /</a></li><li class=""><a href="/blog" target="_self">Blog</a></li><li class=""><a href="https://github.com/facebook/docusaurus" target="_self">GitHub</a></li><span><li><a id="languages-menu" href="#"><img class="languages-icon" src="/img/language.svg"/>English</a><div id="languages-dropdown" class="hide"><ul id="languages-dropdown-items"><li><a href="/es-ES">Español</a></li><li><a href="/ro">Română</a></li><li><a href="/tr">Türkçe</a></li><li><a href="/zh-CN">简体中文</a></li><li><a href="https://crowdin.com/project/docusaurus" target="_blank" rel="noreferrer noopener">Help Translate</a></li></ul></div></li><script>
|
||||
const languagesMenuItem = document.getElementById("languages-menu");
|
||||
const languagesDropDown = document.getElementById("languages-dropdown");
|
||||
languagesMenuItem.addEventListener("click", function(){
|
||||
|
@ -22,7 +22,7 @@
|
|||
languagesDropDown.className = "hide";
|
||||
}
|
||||
});
|
||||
</script></span><li class="navSearchWrapper reactNavSearchWrapper"><input type="text" id="search_input_react" placeholder="Search" title="Search"/></li></ul></nav></div></header></div></div><div class="navPusher"><div class="docMainWrapper wrapper"><div class="container docsNavContainer" id="docsNav"><nav class="toc"><div class="toggleNav"><section class="navWrapper wrapper"><div class="navBreadcrumb wrapper"><div class="navToggle" id="navToggler"><i></i></div><h2><i>›</i><span>Guides</span></h2></div><div class="navGroups"><div class="navGroup navGroupActive"><h3>Getting Started</h3><ul><li class="navListItem"><a class="navItem" href="/docs/en/next/installation.html">Installation</a></li><li class="navListItem"><a class="navItem" href="/docs/en/next/site-preparation.html">Site Preparation</a></li><li class="navListItem"><a class="navItem" href="/docs/en/next/site-creation.html">Creating your site</a></li><li class="navListItem"><a class="navItem" href="/docs/en/next/publishing.html">Publishing your site</a></li></ul></div><div class="navGroup navGroupActive"><h3>Guides</h3><ul><li class="navListItem"><a class="navItem" href="/docs/en/next/blog.html">Adding a Blog</a></li><li class="navListItem"><a class="navItem" href="/docs/en/next/custom-pages.html">Custom Pages</a></li><li class="navListItem"><a class="navItem" href="/docs/en/next/search.html">Enabling Search</a></li><li class="navListItem"><a class="navItem" href="/docs/en/next/navigation.html">Navigation and Sidebars</a></li><li class="navListItem"><a class="navItem" href="/docs/en/next/translation.html">Translations & Localization</a></li><li class="navListItem navListItemActive"><a class="navItem navItemActive" href="/docs/en/next/versioning.html">Versioning</a></li></ul></div><div class="navGroup navGroupActive"><h3>API</h3><ul><li class="navListItem"><a class="navItem" href="/docs/en/next/commands.html">CLI Commands</a></li><li class="navListItem"><a class="navItem" href="/docs/en/next/doc-markdown.html">Markdown Features</a></li><li class="navListItem"><a class="navItem" href="/docs/en/next/api-pages.html">Pages and Styles</a></li><li class="navListItem"><a class="navItem" href="/docs/en/next/site-config.html">siteConfig.js</a></li></ul></div></div></section></div><script>
|
||||
</script></span><li class="navSearchWrapper reactNavSearchWrapper"><input type="text" id="search_input_react" placeholder="Search" title="Search"/></li></ul></nav></div></header></div></div><div class="navPusher"><div class="docMainWrapper wrapper"><div class="container docsNavContainer" id="docsNav"><nav class="toc"><div class="toggleNav"><section class="navWrapper wrapper"><div class="navBreadcrumb wrapper"><div class="navToggle" id="navToggler"><i></i></div><h2><i>›</i><span>Guides</span></h2></div><div class="navGroups"><div class="navGroup navGroupActive"><h3>Getting Started</h3><ul><li class="navListItem"><a class="navItem" href="/docs/en/next/installation">Installation</a></li><li class="navListItem"><a class="navItem" href="/docs/en/next/site-preparation">Site Preparation</a></li><li class="navListItem"><a class="navItem" href="/docs/en/next/site-creation">Creating your site</a></li><li class="navListItem"><a class="navItem" href="/docs/en/next/publishing">Publishing your site</a></li></ul></div><div class="navGroup navGroupActive"><h3>Guides</h3><ul><li class="navListItem"><a class="navItem" href="/docs/en/next/blog">Adding a Blog</a></li><li class="navListItem"><a class="navItem" href="/docs/en/next/custom-pages">Custom Pages</a></li><li class="navListItem"><a class="navItem" href="/docs/en/next/search">Enabling Search</a></li><li class="navListItem"><a class="navItem" href="/docs/en/next/navigation">Navigation and Sidebars</a></li><li class="navListItem"><a class="navItem" href="/docs/en/next/translation">Translations & Localization</a></li><li class="navListItem navListItemActive"><a class="navItem navItemActive" href="/docs/en/next/versioning">Versioning</a></li></ul></div><div class="navGroup navGroupActive"><h3>API</h3><ul><li class="navListItem"><a class="navItem" href="/docs/en/next/commands">CLI Commands</a></li><li class="navListItem"><a class="navItem" href="/docs/en/next/doc-markdown">Markdown Features</a></li><li class="navListItem"><a class="navItem" href="/docs/en/next/api-pages">Pages and Styles</a></li><li class="navListItem"><a class="navItem" href="/docs/en/next/site-config">siteConfig.js</a></li></ul></div></div></section></div><script>
|
||||
var toggler = document.getElementById('navToggler');
|
||||
var nav = document.getElementById('docsNav');
|
||||
toggler.onclick = function() {
|
||||
|
@ -84,8 +84,8 @@
|
|||
<pre><code class="hljs css bash">yarn run rename-version 1.0.0 1.0.1
|
||||
</code></pre>
|
||||
<h2><a class="anchor" aria-hidden="true" id="versioning-and-translations"></a><a href="#versioning-and-translations" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Versioning and Translations</h2>
|
||||
<p>If you wish to use versioning and translations features, the <code>crowdin.yaml</code> file should be set up to upload and download versioned documents to and from Crowdin for translation. Translated, versioned files will go into the folder <code>translated_docs/${language}/version-${version}/</code>. For more information, check out the <a href="/docs/en/next/translation.html">translations guide</a>.</p>
|
||||
</span></div></article></div><div class="docs-prevnext"><a class="docs-prev button" href="translation.html">← Translations & Localization</a><a class="docs-next button" href="commands.html">CLI Commands →</a></div></div></div><nav class="onPageNav"><ul class="toc-headings"><li><a href="#how-to-create-new-versions">How to Create New Versions</a></li><li><a href="#versioning-patterns">Versioning Patterns</a></li><li><a href="#storing-files-for-each-version">Storing Files for Each Version</a></li><li><a href="#fallback-functionality">Fallback Functionality</a></li><li><a href="#renaming-existing-versions">Renaming Existing Versions</a></li><li><a href="#versioning-and-translations">Versioning and Translations</a></li></ul></nav></div><footer class="nav-footer" id="footer"><section class="sitemap"><a href="/" class="nav-home"><img src="/img/docusaurus_monochrome.svg" alt="Docusaurus" width="66" height="58"/></a><div><h5>Docs</h5><a href="
|
||||
<p>If you wish to use versioning and translations features, the <code>crowdin.yaml</code> file should be set up to upload and download versioned documents to and from Crowdin for translation. Translated, versioned files will go into the folder <code>translated_docs/${language}/version-${version}/</code>. For more information, check out the <a href="/docs/en/next/translation">translations guide</a>.</p>
|
||||
</span></div></article></div><div class="docs-prevnext"><a class="docs-prev button" href="translation">← Translations & Localization</a><a class="docs-next button" href="commands">CLI Commands →</a></div></div></div><nav class="onPageNav"><ul class="toc-headings"><li><a href="#how-to-create-new-versions">How to Create New Versions</a></li><li><a href="#versioning-patterns">Versioning Patterns</a></li><li><a href="#storing-files-for-each-version">Storing Files for Each Version</a></li><li><a href="#fallback-functionality">Fallback Functionality</a></li><li><a href="#renaming-existing-versions">Renaming Existing Versions</a></li><li><a href="#versioning-and-translations">Versioning and Translations</a></li></ul></nav></div><footer class="nav-footer" id="footer"><section class="sitemap"><a href="/" class="nav-home"><img src="/img/docusaurus_monochrome.svg" alt="Docusaurus" width="66" height="58"/></a><div><h5>Docs</h5><a href="
|
||||
/docs/en/installation.html">Getting Started</a><a href="
|
||||
/docs/en/versioning.html">Versioning</a><a href="
|
||||
/docs/en/translation.html">Localization</a><a href="
|
||||
|
|
100
docs/en/next/versioning/index.html
Normal file
100
docs/en/next/versioning/index.html
Normal file
|
@ -0,0 +1,100 @@
|
|||
<!DOCTYPE html><html lang="en"><head><meta charSet="utf-8"/><meta http-equiv="X-UA-Compatible" content="IE=edge"/><title>Versioning · Docusaurus</title><meta name="viewport" content="width=device-width"/><meta name="generator" content="Docusaurus"/><meta property="og:title" content="Versioning · Docusaurus"/><meta property="og:type" content="website"/><meta property="og:url" content="https://docusaurus.io/index.html"/><meta property="og:description" content="You can use the `version` script to cut a new documentation version based on the latest content in the `docs` folder. That specific set of documentation will then be preserved and accessible even as the documentation in the `docs` folder changes moving forward."/><meta property="og:image" content="https://docusaurus.io/img/docusaurus.png"/><meta name="twitter:card" content="summary"/><meta name="twitter:image" content="https://docusaurus.io/img/docusaurus.png"/><link rel="shortcut icon" href="/img/docusaurus.ico"/><link rel="stylesheet" href="https://cdn.jsdelivr.net/docsearch.js/1/docsearch.min.css"/><link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/highlight.js/9.12.0/styles/atom-one-dark.min.css"/><link rel="alternate" type="application/atom+xml" href="https://docusaurus.io/blog/atom.xml" title="Docusaurus Blog ATOM Feed"/><link rel="alternate" type="application/rss+xml" href="https://docusaurus.io/blog/feed.xml" title="Docusaurus Blog RSS Feed"/><script>
|
||||
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
|
||||
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
|
||||
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
|
||||
})(window,document,'script','https://www.google-analytics.com/analytics.js','ga');
|
||||
|
||||
ga('create', 'UA-44373548-31', 'auto');
|
||||
ga('send', 'pageview');
|
||||
</script><link rel="stylesheet" href="/css/code-blocks-buttons.css"/><script type="text/javascript" src="https://buttons.github.io/buttons.js"></script><script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/clipboard.js/2.0.0/clipboard.min.js"></script><script type="text/javascript" src="/js/code-blocks-buttons.js"></script><script src="https://unpkg.com/vanilla-back-to-top@7.1.14/dist/vanilla-back-to-top.min.js"></script><script>
|
||||
document.addEventListener("DOMContentLoaded", function(){
|
||||
addBackToTop(
|
||||
{"zIndex":100}
|
||||
)
|
||||
});
|
||||
</script><link rel="stylesheet" href="/css/main.css"/></head><body class="sideNavVisible doc separateOnPageNav"><div class="fixedHeaderContainer"><div class="headerWrapper wrapper"><header><a href="/en"><img class="logo" src="/img/docusaurus.svg" alt="Docusaurus"/><h2 class="headerTitleWithLogo">Docusaurus</h2></a><a href="/en/versions.html"><h3>next</h3></a><div class="navigationWrapper navigationSlider"><nav class="slidingNav"><ul class="nav-site nav-site-internal"><li class="siteNavGroupActive"><a href="/docs/en/next/installation" target="_self">Docs</a></li><li class=""><a href="/en/help" target="_self">Help</a></li><li class=""><a href="/en/users" target="_self">Users</a></li><li class=""><a href="/en/about-slash" target="_self">About /</a></li><li class=""><a href="/blog" target="_self">Blog</a></li><li class=""><a href="https://github.com/facebook/docusaurus" target="_self">GitHub</a></li><span><li><a id="languages-menu" href="#"><img class="languages-icon" src="/img/language.svg"/>English</a><div id="languages-dropdown" class="hide"><ul id="languages-dropdown-items"><li><a href="/es-ES">Español</a></li><li><a href="/ro">Română</a></li><li><a href="/tr">Türkçe</a></li><li><a href="/zh-CN">简体中文</a></li><li><a href="https://crowdin.com/project/docusaurus" target="_blank" rel="noreferrer noopener">Help Translate</a></li></ul></div></li><script>
|
||||
const languagesMenuItem = document.getElementById("languages-menu");
|
||||
const languagesDropDown = document.getElementById("languages-dropdown");
|
||||
languagesMenuItem.addEventListener("click", function(){
|
||||
if(languagesDropDown.className == "hide") {
|
||||
languagesDropDown.className = "visible";
|
||||
} else {
|
||||
languagesDropDown.className = "hide";
|
||||
}
|
||||
});
|
||||
</script></span><li class="navSearchWrapper reactNavSearchWrapper"><input type="text" id="search_input_react" placeholder="Search" title="Search"/></li></ul></nav></div></header></div></div><div class="navPusher"><div class="docMainWrapper wrapper"><div class="container docsNavContainer" id="docsNav"><nav class="toc"><div class="toggleNav"><section class="navWrapper wrapper"><div class="navBreadcrumb wrapper"><div class="navToggle" id="navToggler"><i></i></div><h2><i>›</i><span>Guides</span></h2></div><div class="navGroups"><div class="navGroup navGroupActive"><h3>Getting Started</h3><ul><li class="navListItem"><a class="navItem" href="/docs/en/next/installation">Installation</a></li><li class="navListItem"><a class="navItem" href="/docs/en/next/site-preparation">Site Preparation</a></li><li class="navListItem"><a class="navItem" href="/docs/en/next/site-creation">Creating your site</a></li><li class="navListItem"><a class="navItem" href="/docs/en/next/publishing">Publishing your site</a></li></ul></div><div class="navGroup navGroupActive"><h3>Guides</h3><ul><li class="navListItem"><a class="navItem" href="/docs/en/next/blog">Adding a Blog</a></li><li class="navListItem"><a class="navItem" href="/docs/en/next/custom-pages">Custom Pages</a></li><li class="navListItem"><a class="navItem" href="/docs/en/next/search">Enabling Search</a></li><li class="navListItem"><a class="navItem" href="/docs/en/next/navigation">Navigation and Sidebars</a></li><li class="navListItem"><a class="navItem" href="/docs/en/next/translation">Translations & Localization</a></li><li class="navListItem navListItemActive"><a class="navItem navItemActive" href="/docs/en/next/versioning">Versioning</a></li></ul></div><div class="navGroup navGroupActive"><h3>API</h3><ul><li class="navListItem"><a class="navItem" href="/docs/en/next/commands">CLI Commands</a></li><li class="navListItem"><a class="navItem" href="/docs/en/next/doc-markdown">Markdown Features</a></li><li class="navListItem"><a class="navItem" href="/docs/en/next/api-pages">Pages and Styles</a></li><li class="navListItem"><a class="navItem" href="/docs/en/next/site-config">siteConfig.js</a></li></ul></div></div></section></div><script>
|
||||
var toggler = document.getElementById('navToggler');
|
||||
var nav = document.getElementById('docsNav');
|
||||
toggler.onclick = function() {
|
||||
nav.classList.toggle('docsSliderActive');
|
||||
};
|
||||
</script></nav></div><div class="container mainContainer"><div class="wrapper"><div class="post"><header class="postHeader"><a class="edit-page-link button" href="https://github.com/facebook/docusaurus/edit/master/docs/guides-versioning.md" target="_blank" rel="noreferrer noopener">Edit</a><h1>Versioning</h1></header><article><div><span><p>You can use the <code>version</code> script to cut a new documentation version based on the latest content in the <code>docs</code> folder. That specific set of documentation will then be preserved and accessible even as the documentation in the <code>docs</code> folder changes moving forward.</p>
|
||||
<h2><a class="anchor" aria-hidden="true" id="how-to-create-new-versions"></a><a href="#how-to-create-new-versions" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>How to Create New Versions</h2>
|
||||
<p>Run the following script to generate a starter versions page listing all the site versions:</p>
|
||||
<pre><code class="hljs css bash">yarn examples versions
|
||||
</code></pre>
|
||||
<p>This creates the <code>pages/en/versions.js</code> file.</p>
|
||||
<p>You can edit this file later on to customize how you display the versions.</p>
|
||||
<p>Add the following script to your <code>package.json</code> file if it doesn't already exist:</p>
|
||||
<pre><code class="hljs css js">...
|
||||
<span class="hljs-string">"scripts"</span>: {
|
||||
<span class="hljs-string">"version"</span>: <span class="hljs-string">"docusaurus-version"</span>
|
||||
},
|
||||
...
|
||||
</code></pre>
|
||||
<p>Run the script with a command line argument of the version you wish to create. e.g.,</p>
|
||||
<pre><code class="hljs css bash">yarn run version 1.0.0
|
||||
</code></pre>
|
||||
<p>This will preserve all documents currently in the <code>docs</code> folder and make them available as documentation for version <code>1.0.0</code>.</p>
|
||||
<p>If, for example, you ran the version script with <code>1.0.0</code> as the version number, version <code>1.0.0</code> is considered the latest release version for your project. The site will display the version number next to the title in the header. This version number links to a versions page that you created earlier.</p>
|
||||
<p>Documents in the <code>docs</code> folder will be considered part of version <code>next</code> and they are available, for example, at the url <code>docs/next/doc1.html</code>. Documents from the latest version use the url <code>docs/doc1.html</code>.</p>
|
||||
<p>Running the script again with <code>yarn run version 2.0.0</code> will create a version <code>2.0.0</code>, making version <code>2.0.0</code> the most recent set of documentation. Documents from version <code>1.0.0</code> will use the url <code>docs/1.0.0/doc1.html</code> while <code>2.0.0</code> will use <code>docs/doc1.html</code>.</p>
|
||||
<p>This table below summarizes Docusaurus versioning at a glance:</p>
|
||||
<table>
|
||||
<thead>
|
||||
<tr><th>Version</th><th>Tag</th><th>URL</th></tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr><td>1.0.0</td><td>1.0.0</td><td>docs/1.0.0/doc1.html</td></tr>
|
||||
<tr><td>1.0.1</td><td>1.0.1</td><td>docs/1.0.1/doc1.html</td></tr>
|
||||
<tr><td>2.0.0</td><td>current</td><td>docs/doc1.html</td></tr>
|
||||
<tr><td><code>master</code> branch</td><td>next</td><td>docs/next/doc1.html</td></tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<h2><a class="anchor" aria-hidden="true" id="versioning-patterns"></a><a href="#versioning-patterns" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Versioning Patterns</h2>
|
||||
<p>You can create version numbers in whatever format you wish, and a new version can be created with any version number as long as it does not match an existing version. Version ordering is determined by the order in which versions are created, independently of how they are numbered.</p>
|
||||
<h2><a class="anchor" aria-hidden="true" id="storing-files-for-each-version"></a><a href="#storing-files-for-each-version" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Storing Files for Each Version</h2>
|
||||
<p>Versioned documents are placed into <code>website/versioned_docs/version-${version}</code>, where <code>${version}</code> is the version number you supplied the <code>version</code> script.</p>
|
||||
<p>The markdown header for each versioned doc is altered by renaming the id front matter field to <code>original_id</code>, then using <code>"version-${version}-${original_id}"</code> as the value for the actual <code>id</code> field.</p>
|
||||
<p>Versioned sidebars are copied into <code>website/versioned_sidebars</code> and are named as <code>version-${version}-sidebars.json</code>.</p>
|
||||
<p>A <code>website/versions.json</code> file is created the first time you cut a version and is used by Docusaurus to detect what versions exist. Each time a new version is added, it gets added to the <code>versions.json</code> file.</p>
|
||||
<p>If you wish to change the documentation for a past version, you can access the files for that respective version.</p>
|
||||
<h2><a class="anchor" aria-hidden="true" id="fallback-functionality"></a><a href="#fallback-functionality" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Fallback Functionality</h2>
|
||||
<p>Only files in the <code>docs</code> folder and sidebar files that differ from those of the latest version will get copied each time a new version is specified. If there is no change across versions, Docusaurus will use the file from the latest version with that file.</p>
|
||||
<p>For example, a document with the original id <code>doc1</code> exists for the latest version, <code>1.0.0</code>, and has the same content as the document with the id <code>doc1</code> in the <code>docs</code> folder. When a new version <code>2.0.0</code> is created, the file for <code>doc1</code> will not be copied into <code>versioned_docs/version-2.0.0/</code>. There will still be a page for <code>docs/2.0.0/doc1.html</code>, but it will use the file from version <code>1.0.0</code>.</p>
|
||||
<h2><a class="anchor" aria-hidden="true" id="renaming-existing-versions"></a><a href="#renaming-existing-versions" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Renaming Existing Versions</h2>
|
||||
<p>To rename an existing version number to something else, first make sure the following script is in your <code>package.json</code> file:</p>
|
||||
<pre><code class="hljs css js">...
|
||||
<span class="hljs-string">"scripts"</span>: {
|
||||
<span class="hljs-string">"rename-version"</span>: <span class="hljs-string">"docusaurus-rename-version"</span>
|
||||
},
|
||||
...
|
||||
</code></pre>
|
||||
<p>Run the script with command line arguments of first, the current version name, then second, the new version name. e.g.,</p>
|
||||
<pre><code class="hljs css bash">yarn run rename-version 1.0.0 1.0.1
|
||||
</code></pre>
|
||||
<h2><a class="anchor" aria-hidden="true" id="versioning-and-translations"></a><a href="#versioning-and-translations" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Versioning and Translations</h2>
|
||||
<p>If you wish to use versioning and translations features, the <code>crowdin.yaml</code> file should be set up to upload and download versioned documents to and from Crowdin for translation. Translated, versioned files will go into the folder <code>translated_docs/${language}/version-${version}/</code>. For more information, check out the <a href="/docs/en/next/translation">translations guide</a>.</p>
|
||||
</span></div></article></div><div class="docs-prevnext"><a class="docs-prev button" href="translation">← Translations & Localization</a><a class="docs-next button" href="commands">CLI Commands →</a></div></div></div><nav class="onPageNav"><ul class="toc-headings"><li><a href="#how-to-create-new-versions">How to Create New Versions</a></li><li><a href="#versioning-patterns">Versioning Patterns</a></li><li><a href="#storing-files-for-each-version">Storing Files for Each Version</a></li><li><a href="#fallback-functionality">Fallback Functionality</a></li><li><a href="#renaming-existing-versions">Renaming Existing Versions</a></li><li><a href="#versioning-and-translations">Versioning and Translations</a></li></ul></nav></div><footer class="nav-footer" id="footer"><section class="sitemap"><a href="/" class="nav-home"><img src="/img/docusaurus_monochrome.svg" alt="Docusaurus" width="66" height="58"/></a><div><h5>Docs</h5><a href="
|
||||
/docs/en/installation.html">Getting Started</a><a href="
|
||||
/docs/en/versioning.html">Versioning</a><a href="
|
||||
/docs/en/translation.html">Localization</a><a href="
|
||||
/docs/en/search.html">Adding Search</a></div><div><h5>Community</h5><a href="/en/users.html">User Showcase</a></div><div><h5>More</h5><div class="social"><a class="github-button" href="https://github.com/facebook/Docusaurus" data-count-href="/facebook/Docusaurus/stargazers" data-show-count="true" data-count-aria-label="# stargazers on GitHub" aria-label="Star this project on GitHub">Docusaurus</a></div><div class="social"><a href="https://twitter.com/docusaurus" class="twitter-follow-button">Follow @docusaurus</a></div><div class="social"><div class="fb-like" data-href="https://docusaurus.io" data-layout="standard" data-share="true" data-width="225" data-show-faces="false"></div></div></div></section><a href="https://code.facebook.com/projects/" target="_blank" rel="noreferrer noopener" class="fbOpenSource"><img src="/img/oss_logo.png" alt="Facebook Open Source" width="170" height="45"/></a><section class="copyright"><span>Copyright © 2018 Facebook Inc.</span></section></footer></div><script type="text/javascript" src="https://cdn.jsdelivr.net/docsearch.js/1/docsearch.min.js"></script><script>window.fbAsyncInit = function() {FB.init({appId:'199138890728411',xfbml:true,version:'v2.7'});};(function(d, s, id){var js, fjs = d.getElementsByTagName(s)[0];if (d.getElementById(id)) {return;}js = d.createElement(s); js.id = id;js.src = '//connect.facebook.net/en_US/sdk.js';fjs.parentNode.insertBefore(js, fjs);}(document, 'script','facebook-jssdk'));
|
||||
</script><script>window.twttr=(function(d,s, id){var js,fjs=d.getElementsByTagName(s)[0],t=window.twttr||{};if(d.getElementById(id))return t;js=d.createElement(s);js.id=id;js.src='https://platform.twitter.com/widgets.js';fjs.parentNode.insertBefore(js, fjs);t._e = [];t.ready = function(f) {t._e.push(f);};return t;}(document, 'script', 'twitter-wjs'));</script><script>
|
||||
var search = docsearch({
|
||||
|
||||
apiKey: '3eb9507824b8be89e7a199ecaa1a9d2c',
|
||||
indexName: 'docusaurus',
|
||||
inputSelector: '#search_input_react'
|
||||
});
|
||||
</script></body></html>
|
Loading…
Add table
Add a link
Reference in a new issue