Revert "Deploy website"

This reverts commit 8db87ffa39.
This commit is contained in:
Yangshun Tay 2019-11-03 23:08:49 +08:00
parent 8db87ffa39
commit 09d11ceb49
742 changed files with 8947 additions and 8877 deletions

View file

@ -95,7 +95,7 @@
<pre><code class="hljs css language-yml"><span class="hljs-meta">---</span>
<span class="hljs-attr">title:</span> <span class="hljs-string">Introducing</span> <span class="hljs-string">Docusaurus</span>
<span class="hljs-attr">author:</span> <span class="hljs-string">Joel</span> <span class="hljs-string">Marcey</span>
<span class="hljs-attr">authorURL:</span> <span class="hljs-string">http://twitter.com/JoelMarcey</span>
<span class="hljs-attr">authorURL:</span> <span class="hljs-attr">http://twitter.com/JoelMarcey</span>
<span class="hljs-attr">authorFBID:</span> <span class="hljs-number">611217057</span>
<span class="hljs-attr">authorTwitter:</span> <span class="hljs-string">JoelMarcey</span>
<span class="hljs-meta">---</span>

View file

@ -95,7 +95,7 @@
<pre><code class="hljs css language-yml"><span class="hljs-meta">---</span>
<span class="hljs-attr">title:</span> <span class="hljs-string">Introducing</span> <span class="hljs-string">Docusaurus</span>
<span class="hljs-attr">author:</span> <span class="hljs-string">Joel</span> <span class="hljs-string">Marcey</span>
<span class="hljs-attr">authorURL:</span> <span class="hljs-string">http://twitter.com/JoelMarcey</span>
<span class="hljs-attr">authorURL:</span> <span class="hljs-attr">http://twitter.com/JoelMarcey</span>
<span class="hljs-attr">authorFBID:</span> <span class="hljs-number">611217057</span>
<span class="hljs-attr">authorTwitter:</span> <span class="hljs-string">JoelMarcey</span>
<span class="hljs-meta">---</span>

View file

@ -112,7 +112,7 @@
<pre><code class="hljs css language-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-string">https://github.com/facebook/docusaurus/edit/master/docs/api-doc-markdown.md</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>
@ -125,7 +125,7 @@
<pre><code class="hljs css language-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-string">http://twitter.com/franchementli</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>

View file

@ -112,7 +112,7 @@
<pre><code class="hljs css language-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-string">https://github.com/facebook/docusaurus/edit/master/docs/api-doc-markdown.md</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>
@ -125,7 +125,7 @@
<pre><code class="hljs css language-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-string">http://twitter.com/franchementli</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>

View file

@ -108,21 +108,21 @@
<pre><code class="hljs css language-yml"><span class="hljs-attr">version:</span> <span class="hljs-string">"3"</span>
<span class="hljs-attr">services:</span>
<span class="hljs-attr">docusaurus:</span>
<span class="hljs-attr">build:</span> <span class="hljs-string">.</span>
<span class="hljs-attr">ports:</span>
<span class="hljs-bullet">-</span> <span class="hljs-number">3000</span><span class="hljs-string">:3000</span>
<span class="hljs-bullet">-</span> <span class="hljs-number">35729</span><span class="hljs-string">:35729</span>
<span class="hljs-attr">volumes:</span>
<span class="hljs-bullet">-</span> <span class="hljs-string">./docs:/app/docs</span>
<span class="hljs-bullet">-</span> <span class="hljs-string">./website/blog:/app/website/blog</span>
<span class="hljs-bullet">-</span> <span class="hljs-string">./website/core:/app/website/core</span>
<span class="hljs-bullet">-</span> <span class="hljs-string">./website/i18n:/app/website/i18n</span>
<span class="hljs-bullet">-</span> <span class="hljs-string">./website/pages:/app/website/pages</span>
<span class="hljs-bullet">-</span> <span class="hljs-string">./website/static:/app/website/static</span>
<span class="hljs-bullet">-</span> <span class="hljs-string">./website/sidebars.json:/app/website/sidebars.json</span>
<span class="hljs-bullet">-</span> <span class="hljs-string">./website/siteConfig.js:/app/website/siteConfig.js</span>
<span class="hljs-attr">working_dir:</span> <span class="hljs-string">/app/website</span>
<span class="hljs-attr"> docusaurus:</span>
<span class="hljs-attr"> build:</span> <span class="hljs-string">.</span>
<span class="hljs-attr"> ports:</span>
<span class="hljs-bullet"> -</span> <span class="hljs-number">3000</span><span class="hljs-string">:3000</span>
<span class="hljs-bullet"> -</span> <span class="hljs-number">35729</span><span class="hljs-string">:35729</span>
<span class="hljs-attr"> volumes:</span>
<span class="hljs-bullet"> -</span> <span class="hljs-string">./docs:/app/docs</span>
<span class="hljs-bullet"> -</span> <span class="hljs-string">./website/blog:/app/website/blog</span>
<span class="hljs-bullet"> -</span> <span class="hljs-string">./website/core:/app/website/core</span>
<span class="hljs-bullet"> -</span> <span class="hljs-string">./website/i18n:/app/website/i18n</span>
<span class="hljs-bullet"> -</span> <span class="hljs-string">./website/pages:/app/website/pages</span>
<span class="hljs-bullet"> -</span> <span class="hljs-string">./website/static:/app/website/static</span>
<span class="hljs-bullet"> -</span> <span class="hljs-string">./website/sidebars.json:/app/website/sidebars.json</span>
<span class="hljs-bullet"> -</span> <span class="hljs-string">./website/siteConfig.js:/app/website/siteConfig.js</span>
<span class="hljs-attr"> working_dir:</span> <span class="hljs-string">/app/website</span>
</code></pre>
<p>To run a local web server with <code>docker-compose</code> run <code>docker-compose up</code>.</p>

View file

@ -108,21 +108,21 @@
<pre><code class="hljs css language-yml"><span class="hljs-attr">version:</span> <span class="hljs-string">"3"</span>
<span class="hljs-attr">services:</span>
<span class="hljs-attr">docusaurus:</span>
<span class="hljs-attr">build:</span> <span class="hljs-string">.</span>
<span class="hljs-attr">ports:</span>
<span class="hljs-bullet">-</span> <span class="hljs-number">3000</span><span class="hljs-string">:3000</span>
<span class="hljs-bullet">-</span> <span class="hljs-number">35729</span><span class="hljs-string">:35729</span>
<span class="hljs-attr">volumes:</span>
<span class="hljs-bullet">-</span> <span class="hljs-string">./docs:/app/docs</span>
<span class="hljs-bullet">-</span> <span class="hljs-string">./website/blog:/app/website/blog</span>
<span class="hljs-bullet">-</span> <span class="hljs-string">./website/core:/app/website/core</span>
<span class="hljs-bullet">-</span> <span class="hljs-string">./website/i18n:/app/website/i18n</span>
<span class="hljs-bullet">-</span> <span class="hljs-string">./website/pages:/app/website/pages</span>
<span class="hljs-bullet">-</span> <span class="hljs-string">./website/static:/app/website/static</span>
<span class="hljs-bullet">-</span> <span class="hljs-string">./website/sidebars.json:/app/website/sidebars.json</span>
<span class="hljs-bullet">-</span> <span class="hljs-string">./website/siteConfig.js:/app/website/siteConfig.js</span>
<span class="hljs-attr">working_dir:</span> <span class="hljs-string">/app/website</span>
<span class="hljs-attr"> docusaurus:</span>
<span class="hljs-attr"> build:</span> <span class="hljs-string">.</span>
<span class="hljs-attr"> ports:</span>
<span class="hljs-bullet"> -</span> <span class="hljs-number">3000</span><span class="hljs-string">:3000</span>
<span class="hljs-bullet"> -</span> <span class="hljs-number">35729</span><span class="hljs-string">:35729</span>
<span class="hljs-attr"> volumes:</span>
<span class="hljs-bullet"> -</span> <span class="hljs-string">./docs:/app/docs</span>
<span class="hljs-bullet"> -</span> <span class="hljs-string">./website/blog:/app/website/blog</span>
<span class="hljs-bullet"> -</span> <span class="hljs-string">./website/core:/app/website/core</span>
<span class="hljs-bullet"> -</span> <span class="hljs-string">./website/i18n:/app/website/i18n</span>
<span class="hljs-bullet"> -</span> <span class="hljs-string">./website/pages:/app/website/pages</span>
<span class="hljs-bullet"> -</span> <span class="hljs-string">./website/static:/app/website/static</span>
<span class="hljs-bullet"> -</span> <span class="hljs-string">./website/sidebars.json:/app/website/sidebars.json</span>
<span class="hljs-bullet"> -</span> <span class="hljs-string">./website/siteConfig.js:/app/website/siteConfig.js</span>
<span class="hljs-attr"> working_dir:</span> <span class="hljs-string">/app/website</span>
</code></pre>
<p>To run a local web server with <code>docker-compose</code> run <code>docker-compose up</code>.</p>

View file

@ -142,7 +142,7 @@
<pre><code class="hljs css language-js"><span class="hljs-keyword">const</span> siteConfig = {
...
url: <span class="hljs-string">'https://__userName__.github.io'</span>, <span class="hljs-comment">// Your website URL</span>
<span class="hljs-attr">baseUrl</span>: <span class="hljs-string">'/testProject/'</span>,
baseUrl: <span class="hljs-string">'/testProject/'</span>,
<span class="hljs-attr">projectName</span>: <span class="hljs-string">'testProject'</span>,
<span class="hljs-attr">organizationName</span>: <span class="hljs-string">'userName'</span>
...
@ -213,26 +213,26 @@
<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-attr"> deploy-website:</span>
<span class="hljs-attr"> docker:</span>
<span class="hljs-comment"># specify the version you desire here</span>
<span class="hljs-bullet">-</span> <span class="hljs-attr">image:</span> <span class="hljs-string">circleci/node:8.11.1</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-bullet">-</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">|
<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 "&lt;GITHUB_USERNAME&gt;@users.noreply.github.com"
git config --global user.name "&lt;YOUR_NAME&gt;"
echo "machine github.com login &lt;GITHUB_USERNAME&gt; password $GITHUB_TOKEN" &gt; ~/.netrc
cd website &amp;&amp; yarn install &amp;&amp; GIT_USER=&lt;GIT_USER&gt; 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-bullet">-</span> <span class="hljs-attr">deploy-website:</span>
</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>&lt;....&gt;</code> in the <code>command:</code> sequence with appropriate values. For <code>&lt;GIT_USER&gt;</code>, it should be a GitHub account that has access to push documentation to your GitHub repository. Many times <code>&lt;GIT_USER&gt;</code> and <code>&lt;GITHUB_USERNAME&gt;</code> will be the same.</p>
@ -264,12 +264,12 @@ e.g.</li>
<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-bullet">-</span> <span class="hljs-attr">run:</span> <span class="hljs-string">echo</span> <span class="hljs-string">"Skipping tests on gh-pages branch"</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> directory inside your <code>website/static</code> directory.</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>
@ -283,18 +283,18 @@ e.g.</li>
<pre><code class="hljs css language-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-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"> 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"> 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-string">--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-string">--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">&gt;</span> <span class="hljs-string">~/.netrc</span>
<span class="hljs-bullet">-</span> <span class="hljs-string">cd</span> <span class="hljs-string">website</span> <span class="hljs-string">&amp;&amp;</span> <span class="hljs-string">yarn</span> <span class="hljs-string">install</span> <span class="hljs-string">&amp;&amp;</span> <span class="hljs-string">GIT_USER="${GH_NAME}"</span> <span class="hljs-string">yarn</span> <span class="hljs-string">run</span> <span class="hljs-string">publish-gh-pages</span>
</code></pre>
<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">&gt; ~/.netrc
- cd website &amp;&amp; yarn install &amp;&amp; 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-zeit-now"></a><a href="#hosting-on-zeit-now" 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 ZEIT Now</h3>
<p>With <a href="#using-zeit-now">ZEIT Now</a>, you can deploy your site easily and connect it to <a href="https://zeit.co/github">GitHub</a> or <a href="https://zeit.co/gitlab">GitLab</a> to automatically receive a new deployment every time you push a commit.</p>

View file

@ -142,7 +142,7 @@
<pre><code class="hljs css language-js"><span class="hljs-keyword">const</span> siteConfig = {
...
url: <span class="hljs-string">'https://__userName__.github.io'</span>, <span class="hljs-comment">// Your website URL</span>
<span class="hljs-attr">baseUrl</span>: <span class="hljs-string">'/testProject/'</span>,
baseUrl: <span class="hljs-string">'/testProject/'</span>,
<span class="hljs-attr">projectName</span>: <span class="hljs-string">'testProject'</span>,
<span class="hljs-attr">organizationName</span>: <span class="hljs-string">'userName'</span>
...
@ -213,26 +213,26 @@
<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-attr"> deploy-website:</span>
<span class="hljs-attr"> docker:</span>
<span class="hljs-comment"># specify the version you desire here</span>
<span class="hljs-bullet">-</span> <span class="hljs-attr">image:</span> <span class="hljs-string">circleci/node:8.11.1</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-bullet">-</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">|
<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 "&lt;GITHUB_USERNAME&gt;@users.noreply.github.com"
git config --global user.name "&lt;YOUR_NAME&gt;"
echo "machine github.com login &lt;GITHUB_USERNAME&gt; password $GITHUB_TOKEN" &gt; ~/.netrc
cd website &amp;&amp; yarn install &amp;&amp; GIT_USER=&lt;GIT_USER&gt; 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-bullet">-</span> <span class="hljs-attr">deploy-website:</span>
</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>&lt;....&gt;</code> in the <code>command:</code> sequence with appropriate values. For <code>&lt;GIT_USER&gt;</code>, it should be a GitHub account that has access to push documentation to your GitHub repository. Many times <code>&lt;GIT_USER&gt;</code> and <code>&lt;GITHUB_USERNAME&gt;</code> will be the same.</p>
@ -264,12 +264,12 @@ e.g.</li>
<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-bullet">-</span> <span class="hljs-attr">run:</span> <span class="hljs-string">echo</span> <span class="hljs-string">"Skipping tests on gh-pages branch"</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> directory inside your <code>website/static</code> directory.</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>
@ -283,18 +283,18 @@ e.g.</li>
<pre><code class="hljs css language-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-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"> 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"> 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-string">--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-string">--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">&gt;</span> <span class="hljs-string">~/.netrc</span>
<span class="hljs-bullet">-</span> <span class="hljs-string">cd</span> <span class="hljs-string">website</span> <span class="hljs-string">&amp;&amp;</span> <span class="hljs-string">yarn</span> <span class="hljs-string">install</span> <span class="hljs-string">&amp;&amp;</span> <span class="hljs-string">GIT_USER="${GH_NAME}"</span> <span class="hljs-string">yarn</span> <span class="hljs-string">run</span> <span class="hljs-string">publish-gh-pages</span>
</code></pre>
<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">&gt; ~/.netrc
- cd website &amp;&amp; yarn install &amp;&amp; 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-zeit-now"></a><a href="#hosting-on-zeit-now" 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 ZEIT Now</h3>
<p>With <a href="#using-zeit-now">ZEIT Now</a>, you can deploy your site easily and connect it to <a href="https://zeit.co/github">GitHub</a> or <a href="https://zeit.co/gitlab">GitLab</a> to automatically receive a new deployment every time you push a commit.</p>

View file

@ -209,17 +209,17 @@ If unset, it is defaulted to <code>docs</code>.</p>
<p><a href="/docs/en/next/doc-markdown">Syntax highlighting</a> options:</p>
<pre><code class="hljs css language-js">{
<span class="hljs-comment">// ...</span>
<span class="hljs-attr">highlight</span>: {
highlight: {
<span class="hljs-comment">// The name of the theme used by Highlight.js when highlighting code.</span>
<span class="hljs-comment">// You can find the list of supported themes here:</span>
<span class="hljs-comment">// https://github.com/isagalaev/highlight.js/tree/master/src/styles</span>
<span class="hljs-attr">theme</span>: <span class="hljs-string">'default'</span>,
theme: <span class="hljs-string">'default'</span>,
<span class="hljs-comment">// The particular version of Highlight.js to be used.</span>
<span class="hljs-attr">version</span>: <span class="hljs-string">'9.12.0'</span>,
version: <span class="hljs-string">'9.12.0'</span>,
<span class="hljs-comment">// Escape valve by passing an instance of Highlight.js to the function specified here, allowing additional languages to be registered for syntax highlighting.</span>
<span class="hljs-attr">hljs</span>: <span class="hljs-function"><span class="hljs-keyword">function</span>(<span class="hljs-params">highlightJsInstance</span>) </span>{
hljs: <span class="hljs-function"><span class="hljs-keyword">function</span>(<span class="hljs-params">highlightJsInstance</span>) </span>{
<span class="hljs-comment">// do something here</span>
},
@ -227,10 +227,10 @@ If unset, it is defaulted to <code>docs</code>.</p>
<span class="hljs-comment">// It will be used if one is not specified at the top of the code block. You can find the list of supported languages here:</span>
<span class="hljs-comment">// https://github.com/isagalaev/highlight.js/tree/master/src/languages</span>
<span class="hljs-attr">defaultLang</span>: <span class="hljs-string">'javascript'</span>,
defaultLang: <span class="hljs-string">'javascript'</span>,
<span class="hljs-comment">// custom URL of CSS theme file that you want to use with Highlight.js. If this is provided, the `theme` and `version` fields will be ignored.</span>
<span class="hljs-attr">themeUrl</span>: <span class="hljs-string">'http://foo.bar/custom.css'</span>
themeUrl: <span class="hljs-string">'http://foo.bar/custom.css'</span>
},
}
</code></pre>
@ -312,12 +312,12 @@ If unset, it is defaulted to <code>docs</code>.</p>
<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>
<span class="hljs-attr">defaultVersionShown</span>: <span class="hljs-string">'1.0.0'</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 -&gt; headerLinks: [],</span>
<span class="hljs-attr">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>},

View file

@ -209,17 +209,17 @@ If unset, it is defaulted to <code>docs</code>.</p>
<p><a href="/docs/en/next/doc-markdown">Syntax highlighting</a> options:</p>
<pre><code class="hljs css language-js">{
<span class="hljs-comment">// ...</span>
<span class="hljs-attr">highlight</span>: {
highlight: {
<span class="hljs-comment">// The name of the theme used by Highlight.js when highlighting code.</span>
<span class="hljs-comment">// You can find the list of supported themes here:</span>
<span class="hljs-comment">// https://github.com/isagalaev/highlight.js/tree/master/src/styles</span>
<span class="hljs-attr">theme</span>: <span class="hljs-string">'default'</span>,
theme: <span class="hljs-string">'default'</span>,
<span class="hljs-comment">// The particular version of Highlight.js to be used.</span>
<span class="hljs-attr">version</span>: <span class="hljs-string">'9.12.0'</span>,
version: <span class="hljs-string">'9.12.0'</span>,
<span class="hljs-comment">// Escape valve by passing an instance of Highlight.js to the function specified here, allowing additional languages to be registered for syntax highlighting.</span>
<span class="hljs-attr">hljs</span>: <span class="hljs-function"><span class="hljs-keyword">function</span>(<span class="hljs-params">highlightJsInstance</span>) </span>{
hljs: <span class="hljs-function"><span class="hljs-keyword">function</span>(<span class="hljs-params">highlightJsInstance</span>) </span>{
<span class="hljs-comment">// do something here</span>
},
@ -227,10 +227,10 @@ If unset, it is defaulted to <code>docs</code>.</p>
<span class="hljs-comment">// It will be used if one is not specified at the top of the code block. You can find the list of supported languages here:</span>
<span class="hljs-comment">// https://github.com/isagalaev/highlight.js/tree/master/src/languages</span>
<span class="hljs-attr">defaultLang</span>: <span class="hljs-string">'javascript'</span>,
defaultLang: <span class="hljs-string">'javascript'</span>,
<span class="hljs-comment">// custom URL of CSS theme file that you want to use with Highlight.js. If this is provided, the `theme` and `version` fields will be ignored.</span>
<span class="hljs-attr">themeUrl</span>: <span class="hljs-string">'http://foo.bar/custom.css'</span>
themeUrl: <span class="hljs-string">'http://foo.bar/custom.css'</span>
},
}
</code></pre>
@ -312,12 +312,12 @@ If unset, it is defaulted to <code>docs</code>.</p>
<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>
<span class="hljs-attr">defaultVersionShown</span>: <span class="hljs-string">'1.0.0'</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 -&gt; headerLinks: [],</span>
<span class="hljs-attr">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>},

View file

@ -208,20 +208,20 @@ languages.js
<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">&amp;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>
<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">&amp;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>
@ -263,16 +263,16 @@ CROWDIN_DOCUSAURUS_PROJECT_ID=YOUR_CROWDIN_PROJECT_ID CROWDIN_DOCUSAURUS_API_KEY
<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-attr"> deploy-website:</span>
<span class="hljs-attr"> docker:</span>
<span class="hljs-comment"># specify the version you desire here</span>
<span class="hljs-bullet">-</span> <span class="hljs-attr">image:</span> <span class="hljs-string">circleci/node:8.11.1</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-bullet">-</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">|
<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 "&lt;GITHUB_USERNAME&gt;@users.noreply.github.com"
git config --global user.name "&lt;YOUR_NAME&gt;"
echo "machine github.com login &lt;GITHUB_USERNAME&gt; password $GITHUB_TOKEN" &gt; ~/.netrc
@ -287,12 +287,12 @@ CROWDIN_DOCUSAURUS_PROJECT_ID=YOUR_CROWDIN_PROJECT_ID CROWDIN_DOCUSAURUS_API_KEY
- crowdin --config crowdin.yaml download -b master
# build and publish website
cd website &amp;&amp; GIT_USER=&lt;GIT_USER&gt; 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-bullet">-</span> <span class="hljs-attr">deploy-website:</span>
</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>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>
@ -301,10 +301,10 @@ CROWDIN_DOCUSAURUS_PROJECT_ID=YOUR_CROWDIN_PROJECT_ID CROWDIN_DOCUSAURUS_API_KEY
<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 language-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>
<pre><code class="hljs css language-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="docLastUpdate"><em>Last updated on 2019-5-17 by Hongarc</em></div><div class="docs-prevnext"><a class="docs-prev button" href="/docs/en/next/navigation"><span class="arrow-prev"></span><span>Navigation and Sidebars</span></a><a class="docs-next button" href="/docs/en/next/versioning"><span>Versioning</span><span class="arrow-next"></span></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><ul class="toc-headings"><li><a href="#custom-translation-strings">Custom Translation Strings</a></li></ul></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 class="footerSection"><h5>Docs</h5><a href="

View file

@ -208,20 +208,20 @@ languages.js
<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">&amp;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>
<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">&amp;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>
@ -263,16 +263,16 @@ CROWDIN_DOCUSAURUS_PROJECT_ID=YOUR_CROWDIN_PROJECT_ID CROWDIN_DOCUSAURUS_API_KEY
<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-attr"> deploy-website:</span>
<span class="hljs-attr"> docker:</span>
<span class="hljs-comment"># specify the version you desire here</span>
<span class="hljs-bullet">-</span> <span class="hljs-attr">image:</span> <span class="hljs-string">circleci/node:8.11.1</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-bullet">-</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">|
<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 "&lt;GITHUB_USERNAME&gt;@users.noreply.github.com"
git config --global user.name "&lt;YOUR_NAME&gt;"
echo "machine github.com login &lt;GITHUB_USERNAME&gt; password $GITHUB_TOKEN" &gt; ~/.netrc
@ -287,12 +287,12 @@ CROWDIN_DOCUSAURUS_PROJECT_ID=YOUR_CROWDIN_PROJECT_ID CROWDIN_DOCUSAURUS_API_KEY
- crowdin --config crowdin.yaml download -b master
# build and publish website
cd website &amp;&amp; GIT_USER=&lt;GIT_USER&gt; 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-bullet">-</span> <span class="hljs-attr">deploy-website:</span>
</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>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>
@ -301,10 +301,10 @@ CROWDIN_DOCUSAURUS_PROJECT_ID=YOUR_CROWDIN_PROJECT_ID CROWDIN_DOCUSAURUS_API_KEY
<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 language-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>
<pre><code class="hljs css language-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="docLastUpdate"><em>Last updated on 2019-5-17 by Hongarc</em></div><div class="docs-prevnext"><a class="docs-prev button" href="/docs/en/next/navigation"><span class="arrow-prev"></span><span>Navigation and Sidebars</span></a><a class="docs-next button" href="/docs/en/next/versioning"><span>Versioning</span><span class="arrow-next"></span></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><ul class="toc-headings"><li><a href="#custom-translation-strings">Custom Translation Strings</a></li></ul></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 class="footerSection"><h5>Docs</h5><a href="

View file

@ -86,13 +86,13 @@
<ol>
<li>Edit the file <code>docusaurus-tutorial/website/siteConfig.js</code> and fill in the following values:</li>
</ol>
<pre><code class="hljs"><span class="hljs-keyword">const</span> siteConfig = {
...
<pre><code class="hljs">const siteConfig = {
<span class="hljs-params">...</span>
url: <span class="hljs-string">'https://USERNAME.github.io'</span>, <span class="hljs-comment">// Replace USERNAME with your GitHub username.</span>
baseUrl: <span class="hljs-string">'/docusaurus-tutorial/'</span>, <span class="hljs-comment">// The name of your GitHub project.</span>
projectName: <span class="hljs-string">'docusaurus-tutorial'</span>, <span class="hljs-comment">// The name of your GitHub project. Same as above.</span>
organizationName: <span class="hljs-string">'USERNAME'</span> <span class="hljs-comment">// Your GitHub username.</span>
...
<span class="hljs-params">...</span>
}
</code></pre>
<ol start="2">

View file

@ -86,13 +86,13 @@
<ol>
<li>Edit the file <code>docusaurus-tutorial/website/siteConfig.js</code> and fill in the following values:</li>
</ol>
<pre><code class="hljs"><span class="hljs-keyword">const</span> siteConfig = {
...
<pre><code class="hljs">const siteConfig = {
<span class="hljs-params">...</span>
url: <span class="hljs-string">'https://USERNAME.github.io'</span>, <span class="hljs-comment">// Replace USERNAME with your GitHub username.</span>
baseUrl: <span class="hljs-string">'/docusaurus-tutorial/'</span>, <span class="hljs-comment">// The name of your GitHub project.</span>
projectName: <span class="hljs-string">'docusaurus-tutorial'</span>, <span class="hljs-comment">// The name of your GitHub project. Same as above.</span>
organizationName: <span class="hljs-string">'USERNAME'</span> <span class="hljs-comment">// Your GitHub username.</span>
...
<span class="hljs-params">...</span>
}
</code></pre>
<ol start="2">