update website [ci skip]

This commit is contained in:
Facebook GitHub Bot 2017-10-03 22:22:17 +00:00
parent f9ab600c5f
commit e5569315ad

View file

@ -6,7 +6,7 @@
};
</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. This must match your GitHub repo project name (case sensitive).</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 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>
@ -17,7 +17,7 @@
<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><p><code>copyright</code> - The copyright string at footer of site and within feed</p><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><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><p><code>copyright</code> - The copyright string at footer of site and within feed</p><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><code>sourceCodeButton</code> - the type of button to use for pointing to your source code. If this field is non-null, the site will pull in the appropriate button code in the header, for you to be able to render as you see fit. Currently accepted values: <code>&quot;github&quot;</code>, <code>&quot;none&quot;</code>. Defaults to <code>&quot;github&quot;</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" 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>
@ -63,8 +63,9 @@
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>
gaTrackingId<span class="token punctuation">:</span> <span class="token string">&quot;U-A2352&quot;</span><span class="token punctuation">,</span>
sourceCodeButton<span class="token punctuation">:</span> <span class="token string">&quot;github&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="