mirror of
https://github.com/facebook/docusaurus.git
synced 2025-08-03 00:39:45 +02:00
parent
6bd08f7412
commit
7d749bf158
3 changed files with 75 additions and 57 deletions
|
@ -28,7 +28,9 @@
|
|||
<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>
|
||||
<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 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>
|
||||
|
@ -38,9 +40,9 @@
|
|||
<tr><th>Prop</th><th>Type</th><th>Default</th><th>Description</th></tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr><td>padding</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>background</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>className</td><td>String</td><td>-</td><td>Custom class to add to the element.</td></tr>
|
||||
<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>
|
||||
|
@ -48,7 +50,7 @@
|
|||
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 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>
|
||||
|
@ -59,10 +61,10 @@
|
|||
<tr><th>Prop</th><th>Type</th><th>Default</th><th>Description</th></tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr><td>align</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>layout</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>className</td><td>String</td><td>-</td><td>Custom class to add to the element.</td></tr>
|
||||
<tr><td>contents</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>
|
||||
<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>
|
||||
|
@ -71,19 +73,19 @@
|
|||
<tr><th>Key</th><th>Type</th><th>Default</th><th>Description</th></tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr><td>title</td><td>String</td><td>-</td><td>The display title of this section, which is parsed using Markdown</td></tr>
|
||||
<tr><td>content</td><td>String</td><td>-</td><td>The text of this section, which is parsed using Markdown</td></tr>
|
||||
<tr><td>image</td><td>String</td><td>-</td><td>The path of the display image</td></tr>
|
||||
<tr><td>imageAlt</td><td>String</td><td>-</td><td>The text that will be shown in case the image is not available</td></tr>
|
||||
<tr><td>imageAlign</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>imageLink</td><td>String</td><td>-</td><td>Link destination from clicking the image</td></tr>
|
||||
<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"><GridBlock
|
||||
align=<span class="hljs-string">"center"</span>
|
||||
layout=<span class="hljs-string">"threeColumn"</span>
|
||||
className=<span class="hljs-string">"myCustomClass"</span>
|
||||
className=<span class="hljs-string">"myCustomClass"</span>
|
||||
contents={[
|
||||
{
|
||||
title: `[Learn](${siteConfig.baseUrl}docs/tutorial.html)`,
|
||||
|
@ -109,15 +111,19 @@
|
|||
<h2><a class="anchor" aria-hidden="true" id="translating-strings"></a><a href="#translating-strings" 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>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><span class="xml"><span class="hljs-tag"><<span class="hljs-name">translate</span>></span>I like translations<span class="hljs-tag"></<span class="hljs-name">translate</span>></span></span><span class="xml"><span class="hljs-tag"></<span class="hljs-name">p</span>></span></span>
|
||||
<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>
|
||||
<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;
|
||||
<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 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>
|
||||
|
|
|
@ -22,7 +22,9 @@
|
|||
<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>
|
||||
<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 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>
|
||||
|
@ -32,9 +34,9 @@
|
|||
<tr><th>Prop</th><th>Type</th><th>Default</th><th>Description</th></tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr><td>padding</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>background</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>className</td><td>String</td><td>-</td><td>Custom class to add to the element.</td></tr>
|
||||
<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>
|
||||
|
@ -42,7 +44,7 @@
|
|||
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 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>
|
||||
|
@ -53,10 +55,10 @@
|
|||
<tr><th>Prop</th><th>Type</th><th>Default</th><th>Description</th></tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr><td>align</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>layout</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>className</td><td>String</td><td>-</td><td>Custom class to add to the element.</td></tr>
|
||||
<tr><td>contents</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>
|
||||
<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>
|
||||
|
@ -65,19 +67,19 @@
|
|||
<tr><th>Key</th><th>Type</th><th>Default</th><th>Description</th></tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr><td>title</td><td>String</td><td>-</td><td>The display title of this section, which is parsed using Markdown</td></tr>
|
||||
<tr><td>content</td><td>String</td><td>-</td><td>The text of this section, which is parsed using Markdown</td></tr>
|
||||
<tr><td>image</td><td>String</td><td>-</td><td>The path of the display image</td></tr>
|
||||
<tr><td>imageAlt</td><td>String</td><td>-</td><td>The text that will be shown in case the image is not available</td></tr>
|
||||
<tr><td>imageAlign</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>imageLink</td><td>String</td><td>-</td><td>Link destination from clicking the image</td></tr>
|
||||
<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"><GridBlock
|
||||
align=<span class="hljs-string">"center"</span>
|
||||
layout=<span class="hljs-string">"threeColumn"</span>
|
||||
className=<span class="hljs-string">"myCustomClass"</span>
|
||||
className=<span class="hljs-string">"myCustomClass"</span>
|
||||
contents={[
|
||||
{
|
||||
title: `[Learn](${siteConfig.baseUrl}docs/tutorial.html)`,
|
||||
|
@ -103,15 +105,19 @@
|
|||
<h2><a class="anchor" aria-hidden="true" id="translating-strings"></a><a href="#translating-strings" 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>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><span class="xml"><span class="hljs-tag"><<span class="hljs-name">translate</span>></span>I like translations<span class="hljs-tag"></<span class="hljs-name">translate</span>></span></span><span class="xml"><span class="hljs-tag"></<span class="hljs-name">p</span>></span></span>
|
||||
<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>
|
||||
<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;
|
||||
<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 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>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue