docusaurus/docs/site-config.html
2017-08-17 02:31:45 +00:00

71 lines
No EOL
18 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>siteConfig.js · Docusaurus</title><meta name="viewport" content="width=device-width"/><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 name="robots" content="noindex"/><link rel="shortcut icon" href="/img/docusaurus.ico"/><link rel="stylesheet" href="/css/main.css"/><script async="" defer="" src="https://buttons.github.io/buttons.js"></script></head><body class="sideNavVisible"><div class="fixedHeaderContainer"><div class="headerWrapper wrapper"><header><a href="/"><img src="/img/docusaurus.svg"/><h2>Docusaurus</h2></a><div class="navigationWrapper navigationSlider"><nav class="slidingNav"><ul class="nav-site nav-site-internal"><li><a href="/docs/installation.html" target="_self">Docs</a></li><li><a href="/en/help.html" target="_self">Help</a></li><li><a href="https://github.com/facebookexperimental/docusaurus" target="_self">GitHub</a></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/installation.html#content">Installation</a></li><li class="navListItem"><a class="navItem" href="/docs/site-preparation.html#content">Site Preparation</a></li><li class="navListItem"><a class="navItem" href="/docs/site-creation.html#content">Creating your site</a></li></ul></div><div class="navGroup navGroupActive"><h3>Guides</h3><ul><li class="navListItem"><a class="navItem" href="/docs/custom-pages.html#content">Custom Pages</a></li><li class="navListItem"><a class="navItem" href="/docs/navigation.html#content">Navigation and Sidebars</a></li><li class="navListItem"><a class="navItem" href="/docs/blog.html#content">Adding a Blog</a></li><li class="navListItem"><a class="navItem" href="/docs/translation.html#content">Translations</a></li><li class="navListItem"><a class="navItem" href="/docs/search.html#content">Enabling Search</a></li><li class="navListItem"><a class="navItem" href="/docs/versioning.html#content">Versioning</a></li></ul></div><div class="navGroup navGroupActive"><h3>API</h3><ul><li class="navListItem"><a class="navItem" href="/docs/commands.html#content">CLI Commands</a></li><li class="navListItem"><a class="navItem" href="/docs/api-pages.html#content">Pages and Styles</a></li><li class="navListItem navListItemActive"><a class="navItem navItemActive" href="/docs/site-config.html#content">siteConfig.js</a></li><li class="navListItem"><a class="navItem" href="/docs/doc-markdown.html#content">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/api-site-config.md" target="_blank">Edit this Doc</a><h1>siteConfig.js</h1></header><article><div><p>A large part of site configuration is done by editing the <code>siteConfig.js</code> file.</p><h2><a class="anchor" name="user-showcase"></a>User Showcase <a class="hash-link" href="#user-showcase">#</a></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 someon. 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" name="siteconfig-fields"></a>siteConfig Fields <a class="hash-link" href="#siteconfig-fields">#</a></h2><p>The <code>siteConfig</code> object contains the bulk of the configuration settings for your website.</p><h3><a class="anchor" name="mandatory-fields"></a>Mandatory Fields <a class="hash-link" href="#mandatory-fields">#</a></h3><p><code>title</code> - Title for your website.</p><p><code>tagline</code> - Tagline for your website. </p><p><code>url</code> - url for your site.</p><p><code>baseUrl</code> - baseUrl for your site.</p><p><code>projectName</code> - Project name.</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 class="prism language-js">headerLinks<span class="token punctuation">:</span> <span class="token punctuation">[</span>
<span spellcheck="true" class="token comment">// Links to document with id doc1 for current language/version</span>
<span class="token punctuation">{</span> doc<span class="token punctuation">:</span> <span class="token string">&quot;doc1&quot;</span><span class="token punctuation">,</span> label<span class="token punctuation">:</span> <span class="token string">&quot;Getting Started&quot;</span> <span class="token punctuation">}</span><span class="token punctuation">,</span>
<span spellcheck="true" class="token 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="token punctuation">{</span> page<span class="token punctuation">:</span> <span class="token string">&quot;help&quot;</span><span class="token punctuation">,</span> label<span class="token punctuation">:</span> <span class="token string">&quot;Help&quot;</span> <span class="token punctuation">}</span><span class="token punctuation">,</span>
<span spellcheck="true" class="token comment">// Links to href destination</span>
<span class="token punctuation">{</span> href<span class="token punctuation">:</span> <span class="token string">&quot;https://github.com/&quot;</span><span class="token punctuation">,</span> label<span class="token punctuation">:</span> <span class="token string">&quot;GitHub&quot;</span> <span class="token punctuation">}</span><span class="token punctuation">,</span>
<span spellcheck="true" class="token comment">// Links to blog generated by Docusaurus (${baseUrl}blog)</span>
<span class="token punctuation">{</span> blog<span class="token punctuation">:</span> <span class="token boolean">true</span><span class="token punctuation">,</span> label<span class="token punctuation">:</span> <span class="token string">&quot;Blog&quot;</span> <span class="token punctuation">}</span><span class="token punctuation">,</span>
<span spellcheck="true" class="token comment">// Determines search bar position among links</span>
<span class="token punctuation">{</span> search<span class="token punctuation">:</span> <span class="token boolean">true</span> <span class="token punctuation">}</span><span class="token punctuation">,</span>
<span spellcheck="true" class="token comment">// Determines language drop down position among links</span>
<span class="token punctuation">{</span> languages<span class="token punctuation">:</span> <span class="token boolean">true</span> <span class="token punctuation">}</span>
<span class="token punctuation">]</span><span class="token punctuation">,</span></pre><p><code>headerIcon</code> - url for icon used in header navigation bar.</p><p><code>favicon</code> - url for site favicon.</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><code>prismColor</code> is the color used in the background of syntax highlighting for code in documentation. It is recommended to be the same color as <code>primaryColor</code> in <code>rgba</code> form with an alpha value of <code>0.03</code>. Other fields can be added</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><h3><a class="anchor" name="optional-fields"></a>Optional Fields <a class="hash-link" href="#optional-fields">#</a></h3><p><code>editUrl</code> - url for editing docs, usage example: <code>editUrl + &#x27;en/doc1.md&#x27;</code>. If this field is omitted, there will be no &quot;Edit this Doc&quot; button for each document.</p><p><code>users</code> - The <code>users</code> array mentioned earlier.</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>separateCss</code> - Folders inside which any <code>css</code> files will not be processed and concatenated to Docusaurus&#x27;s styles. This is to support static <code>html</code> pages that may be separate from Docusaurus with completely separate styles.</p><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>recruitingLink</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>algolia</code> - Information for Algolia search integration. If this field is excluded, the search bar will not appear in the header.</p><p><code>gaTrackingId</code> - Google Analytics tracking ID to track page views.</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" name="example-siteconfigjs-with-all-fields"></a>Example siteConfig.js with all fields <a class="hash-link" href="#example-siteconfigjs-with-all-fields">#</a></h2><pre class="prism language-javascript"><span class="token keyword">const</span> users <span class="token operator">=</span> <span class="token punctuation">[</span>
<span class="token punctuation">{</span>
caption<span class="token punctuation">:</span> <span class="token string">&quot;User1&quot;</span><span class="token punctuation">,</span>
image<span class="token punctuation">:</span> <span class="token string">&quot;/test-site/img/docusaurus.svg&quot;</span><span class="token punctuation">,</span>
infoLink<span class="token punctuation">:</span> <span class="token string">&quot;https://www.example.com&quot;</span><span class="token punctuation">,</span>
pinned<span class="token punctuation">:</span> <span class="token boolean">true</span>
<span class="token punctuation">}</span>
<span class="token punctuation">]</span><span class="token punctuation">;</span>
<span class="token keyword">const</span> siteConfig <span class="token operator">=</span> <span class="token punctuation">{</span>
title<span class="token punctuation">:</span> <span class="token string">&quot;Docusaurus&quot;</span><span class="token punctuation">,</span>
tagline<span class="token punctuation">:</span> <span class="token string">&quot;Generate websites!&quot;</span><span class="token punctuation">,</span>
url<span class="token punctuation">:</span> <span class="token string">&quot;https://deltice.github.io&quot;</span><span class="token punctuation">,</span>
<span spellcheck="true" class="token comment">// url: &quot;https://www.example.com&quot;,</span>
baseUrl<span class="token punctuation">:</span> <span class="token string">&quot;/test-site/&quot;</span><span class="token punctuation">,</span>
<span spellcheck="true" class="token comment">// baseUrl: &quot;/&quot;,</span>
projectName<span class="token punctuation">:</span> <span class="token string">&quot;docusaurus&quot;</span><span class="token punctuation">,</span>
headerLinks<span class="token punctuation">:</span> <span class="token punctuation">[</span>
<span class="token punctuation">{</span> doc<span class="token punctuation">:</span> <span class="token string">&quot;doc1&quot;</span><span class="token punctuation">,</span> label<span class="token punctuation">:</span> <span class="token string">&quot;Docs&quot;</span> <span class="token punctuation">}</span><span class="token punctuation">,</span>
<span class="token punctuation">{</span> page<span class="token punctuation">:</span> <span class="token string">&quot;help&quot;</span><span class="token punctuation">,</span> label<span class="token punctuation">:</span> <span class="token string">&quot;Help&quot;</span> <span class="token punctuation">}</span><span class="token punctuation">,</span>
<span class="token punctuation">{</span> search<span class="token punctuation">:</span> <span class="token boolean">true</span> <span class="token punctuation">}</span><span class="token punctuation">,</span>
<span class="token punctuation">{</span> blog<span class="token punctuation">:</span> <span class="token boolean">true</span> <span class="token punctuation">}</span>
<span class="token punctuation">]</span><span class="token punctuation">,</span>
<span spellcheck="true" class="token comment">// headerLinks: [],</span>
headerIcon<span class="token punctuation">:</span> <span class="token string">&quot;img/docusaurus.svg&quot;</span><span class="token punctuation">,</span>
favicon<span class="token punctuation">:</span> <span class="token string">&quot;img/favicon.png&quot;</span><span class="token punctuation">,</span>
colors<span class="token punctuation">:</span> <span class="token punctuation">{</span>
primaryColor<span class="token punctuation">:</span> <span class="token string">&quot;#2E8555&quot;</span><span class="token punctuation">,</span>
secondaryColor<span class="token punctuation">:</span> <span class="token string">&quot;#205C3B&quot;</span><span class="token punctuation">,</span>
prismColor<span class="token punctuation">:</span>
<span class="token string">&quot;rgba(46, 133, 85, 0.03)&quot;</span>
<span class="token punctuation">}</span><span class="token punctuation">,</span>
editUrl<span class="token punctuation">:</span> <span class="token string">&quot;https://github.com/deltice/test-site/edit/master/docs/&quot;</span><span class="token punctuation">,</span>
users<span class="token punctuation">,</span>
disableHeaderTitle<span class="token punctuation">:</span> <span class="token boolean">true</span><span class="token punctuation">,</span>
disableTitleTagline<span class="token punctuation">:</span> <span class="token boolean">true</span><span class="token punctuation">,</span>
separateCss<span class="token punctuation">:</span> <span class="token punctuation">[</span><span class="token string">&quot;static/css/non-docusaurus&quot;</span><span class="token punctuation">,</span> <span class="token string">&quot;static/assets/separate-css&quot;</span><span class="token punctuation">]</span><span class="token punctuation">,</span>
footerIcon<span class="token punctuation">:</span> <span class="token string">&quot;img/docusaurus.svg&quot;</span><span class="token punctuation">,</span>
recruitingLink<span class="token punctuation">:</span>
<span class="token string">&quot;https://crowdin.com/project/docusaurus&quot;</span><span class="token punctuation">,</span>
algolia<span class="token punctuation">:</span> <span class="token punctuation">{</span>
apiKey<span class="token punctuation">:</span>
<span class="token string">&quot;0f9f28b9ab9efae89810921a351753b5&quot;</span><span class="token punctuation">,</span>
indexName<span class="token punctuation">:</span> <span class="token string">&quot;github&quot;</span>
<span class="token punctuation">}</span>
gaTrackingId<span class="token punctuation">:</span> <span class="token string">&quot;U-A2352&quot;</span>
<span class="token punctuation">}</span><span class="token punctuation">;</span>
module<span class="token punctuation">.</span>exports <span class="token operator">=</span> siteConfig<span class="token punctuation">;</span></pre></div></article></div><div class="docs-prevnext"><a class="docs-prev button" href="api-pages.html#content">← Previous</a><a class="docs-next button" href="doc-markdown.html#content">Next →</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-count-href="/facebookexperimental/docusaurus/stargazers" data-count-api="/repos/facebookexperimental/docusaurus#stargazers_count" data-count-aria-label="# stargazers on GitHub" 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">Copyright © 2017 Facebook Inc.</section></footer></div></body></html>