docusaurus/docs/en/navigation.html
Website Deployment Script c85228b830 Deploy website
Deploy website version based on e95c3a87b7
2017-10-26 23:13:03 +00:00

94 lines
No EOL
16 KiB
HTML
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<html><head><meta charset="utf-8"/><meta http-equiv="X-UA-Compatible" content="IE=edge, chrome=1"/><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="## New Hidden Docs"/><meta name="robots" content="noindex"/><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="/css/main.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"/><link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/highlight.js/9.12.0/styles/solarized-dark.min.css"/></head><body class="sideNavVisible"><div class="fixedHeaderContainer"><div class="headerWrapper wrapper"><header><a href="/"><img class="logo" src="/img/docusaurus.svg"/><h2 class="headerTitle">Docusaurus</h2></a><div class="navigationWrapper navigationSlider"><nav class="slidingNav"><ul class="nav-site nav-site-internal"><li><a href="/docs/en/installation.html" target="_self">Docs</a></li><li><a href="/en/help.html" target="_self">Help</a></li><li><a href="/blog" target="_self">Blog</a></li><li><a href="https://github.com/facebookexperimental/docusaurus" target="_self">GitHub</a></li><li class="navSearchWrapper reactNavSearchWrapper"><input type="text" id="search_input_react" placeholder="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/installation.html">Installation</a></li><li class="navListItem"><a class="navItem" href="/docs/en/site-preparation.html">Site Preparation</a></li><li class="navListItem"><a class="navItem" href="/docs/en/site-creation.html">Creating your site</a></li><li class="navListItem"><a class="navItem" href="/docs/en/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/custom-pages.html">Custom Pages</a></li><li class="navListItem navListItemActive"><a class="navItem navItemActive" href="/docs/en/navigation.html">Navigation and Sidebars</a></li><li class="navListItem"><a class="navItem" href="/docs/en/blog.html">Adding a Blog</a></li><li class="navListItem"><a class="navItem" href="/docs/en/translation.html">Translations &amp; Localization</a></li><li class="navListItem"><a class="navItem" href="/docs/en/search.html">Enabling Search</a></li><li class="navListItem"><a class="navItem" href="/docs/en/versioning.html">Versioning</a></li></ul></div><div class="navGroup navGroupActive"><h3>API</h3><ul><li class="navListItem"><a class="navItem" href="/docs/en/commands.html">CLI Commands</a></li><li class="navListItem"><a class="navItem" href="/docs/en/api-pages.html">Pages and Styles</a></li><li class="navListItem"><a class="navItem" href="/docs/en/site-config.html">siteConfig.js</a></li><li class="navListItem"><a class="navItem" href="/docs/en/doc-markdown.html">Markdown Features</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/facebookexperimental/docusaurus/edit/master/docs/guides-navigation.md" target="_blank">Edit</a><h1>Navigation and Sidebars</h1></header><article><div><span><h2><a class="anchor" aria-hidden="true" name="new-hidden-docs"></a><a href="#new-hidden-docs" aria-hidden="true" class="hash-link" ><svg 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>New Hidden Docs</h2>
<p>New markdown files within <code>docs</code> will show up as pages on the website. Creating a file such as &quot;docs/getting-started.md&quot; will enable the new page <code>/docs/getting-started.html</code>.</p>
<p>To change the id (link name) of the file, set the <code>id</code> field in the markdown header. At the top of <code>getting-started.md</code>:</p>
<pre><code class="hljs"><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-meta">*new</span> <span class="hljs-string">content*</span> <span class="hljs-string">here..</span>
</code></pre>
<p>Now, the doc can be accessed from <code>/docs/intro.html</code>.</p>
<h2><a class="anchor" aria-hidden="true" name="adding-docs-to-a-sidebar"></a><a href="#adding-docs-to-a-sidebar" aria-hidden="true" class="hash-link" ><svg 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 Docs to a Sidebar</h2>
<p>Now we want our new page to show up on the sidebar. We configure the order of the sidebar in <code>website/sidebars.json</code>.</p>
<p>Within <code>sidebars.json</code>, add the doc ID within an existing sidebar/category:</p>
<pre><code class="hljs">{
<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">{
<span class="hljs-string">"docs"</span>: {
...
<span class="hljs-string">"My New Sidebar Category"</span>: [
<span class="hljs-string">"getting-started"</span>
],
...
</code></pre>
<h2><a class="anchor" aria-hidden="true" name="new-hidden-sections"></a><a href="#new-hidden-sections" aria-hidden="true" class="hash-link" ><svg 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>New Hidden Sections</h2>
<p>You can also put the doc in a new sidebar. In this case we are creating a <code>intro</code> section within <code>sidebars.json</code>.</p>
<pre><code class="hljs">{
<span class="hljs-string">"intro"</span>: {
<span class="hljs-string">"My Sidebar Category"</span>: [
<span class="hljs-string">"getting-started"</span>
],
},
...
</code></pre>
<p>Keep in mind, until you add the section to the nav bar (below), this new &quot;intro&quot; section of the site will be hidden with no links going to it.</p>
<h2><a class="anchor" aria-hidden="true" name="adding-doc-to-site-nav-bar"></a><a href="#adding-doc-to-site-nav-bar" aria-hidden="true" class="hash-link" ><svg 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 doc to site nav bar</h2>
<p>After creating a new section of the site by adding to <code>sidebars.json</code>, you can link to the new doc from the top navigation bar by editing the <code>headerLinks</code> field of <code>siteConfig.js</code>.</p>
<pre><code class="hljs">headerLinks: [
...
{ doc: <span class="hljs-string">'intro'</span>, <span class="hljs-keyword">label</span><span class="bash">: <span class="hljs-string">'Getting Started'</span> },
</span> ...
],
</code></pre>
<h2><a class="anchor" aria-hidden="true" name="custom-page-links-in-nav-bar"></a><a href="#custom-page-links-in-nav-bar" aria-hidden="true" class="hash-link" ><svg 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>Custom page links in nav bar</h2>
<p>To add custom pages to the 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">headerLinks: [
...
{ page: <span class="hljs-string">'help'</span>, <span class="hljs-keyword">label</span><span class="bash">: <span class="hljs-string">'Help'</span> },
</span> ...
],
</code></pre>
<h2><a class="anchor" aria-hidden="true" name="external-links-in-nav-bar"></a><a href="#external-links-in-nav-bar" aria-hidden="true" class="hash-link" ><svg 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>External links in nav bar</h2>
<p>Custom links can be added to the nav bar with the following entry in <code>siteConfig.js</code>:</p>
<pre><code class="hljs">headerLinks: [
...
{ href: <span class="hljs-string">'https://github.com/facebookexperimental/Docusaurus'</span>, <span class="hljs-keyword">label</span><span class="bash">: <span class="hljs-string">'GitHub'</span> },
</span> ...
],
</code></pre>
<p>To open external links in a new tab, provide an <code>external: true</code> flag within the header link config.</p>
<h2><a class="anchor" aria-hidden="true" name="search-bar-position-in-nav-bar"></a><a href="#search-bar-position-in-nav-bar" aria-hidden="true" class="hash-link" ><svg 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 bar position in nav bar</h2>
<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"><span class="hljs-string">headerLinks:</span> [
{ <span class="hljs-string">doc:</span> <span class="hljs-string">'foo'</span>, <span class="hljs-string">label:</span> <span class="hljs-string">'Foo'</span> },
{ <span class="hljs-string">search:</span> <span class="hljs-literal">true</span> },
{ <span class="hljs-string">doc:</span> <span class="hljs-string">'bar'</span>, <span class="hljs-string">label:</span> <span class="hljs-string">'Bar'</span> },
],
</code></pre>
<h2><a class="anchor" aria-hidden="true" name="languages-dropdown-position-in-nav-bar"></a><a href="#languages-dropdown-position-in-nav-bar" aria-hidden="true" class="hash-link" ><svg 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 position in nav bar</h2>
<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"><span class="hljs-string">headerLinks:</span> [
{ <span class="hljs-string">doc:</span> <span class="hljs-string">'foo'</span>, <span class="hljs-string">label:</span> <span class="hljs-string">'Foo'</span> },
{ <span class="hljs-string">languages:</span> <span class="hljs-literal">true</span> },
{ <span class="hljs-string">doc:</span> <span class="hljs-string">'bar'</span>, <span class="hljs-string">label:</span> <span class="hljs-string">'Bar'</span> },
],
</code></pre>
</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="blog.html">Adding a Blog →</a></div></div></div></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/installation.html">Getting Started</a></div><div><h5>Community</h5><a href="/en/users.html">User Showcase</a></div><div><h5>More</h5><a href="https://github.com/facebookexperimental/docusaurus">GitHub</a><a class="github-button" href="https://github.com/facebookexperimental/docusaurus" data-icon="octicon-star" data-show-count="true" aria-label="Star this project on GitHub">Star</a></div></section><a href="https://code.facebook.com/projects/" target="_blank" class="fbOpenSource"><img src="/img/oss_logo.png" alt="Facebook Open Source" width="170" height="45"/></a><section class="copyright"><span>Copyright © 2017 Facebook Inc.</span></section></footer></div><script type="text/javascript" src="//cdn.jsdelivr.net/docsearch.js/1/docsearch.min.js"></script><script>
var search = docsearch({
apiKey: '3eb9507824b8be89e7a199ecaa1a9d2c',
indexName: 'docusaurus',
inputSelector: '#search_input_react'
});
</script></body></html>