mirror of
https://github.com/facebook/docusaurus.git
synced 2025-08-04 01:09:20 +02:00
parent
c0919ac674
commit
3e5025b3c6
14 changed files with 136 additions and 138 deletions
|
@ -101,7 +101,7 @@
|
|||
</ul>
|
||||
<h3><a class="anchor" aria-hidden="true" id="using-zeit-now"></a><a href="#using-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>Using ZEIT Now</h3>
|
||||
<p>Deploying your Docusaurus project to <a href="https://zeit.co/now">ZEIT Now</a> will provide you with <a href="https://zeit.co/now">various benefits</a> in the areas of performance and ease of use.</p>
|
||||
<p>Most importantly, however, deploying a Docusaurus project only takes a couple seconds:</p>
|
||||
<p>Most importantly, however, deploying a Docusaurus project only takes a couple of seconds:</p>
|
||||
<ol>
|
||||
<li>First, install their <a href="https://zeit.co/download">command-line interface</a>:</li>
|
||||
</ol>
|
||||
|
@ -114,10 +114,10 @@
|
|||
</code></pre>
|
||||
<p><strong>That's all.</strong> Your docs will automatically be deployed.</p>
|
||||
<blockquote>
|
||||
<p>Note that the directory structure Now supports is slightly different from the default directory structure of a Docusaurus project - The <code>docs</code> directory has to be within the <code>website</code> directory, ideally following the directory structure in this example. You will also have to specify a <code>customDocsPath</code> value in <code>siteConfig.js</code>. Take a look at the the <a href="https://github.com/zeit/now-examples/tree/master/docusaurus">now-examples repository for a Docusaurus project</a>.</p>
|
||||
<p>Note that the directory structure Now supports is slightly different from the default directory structure of a Docusaurus project - The <code>docs</code> directory has to be within the <code>website</code> directory, ideally following the directory structure in this example. You will also have to specify a <code>customDocsPath</code> value in <code>siteConfig.js</code>. Take a look at the <a href="https://github.com/zeit/now-examples/tree/master/docusaurus">now-examples repository for a Docusaurus project</a>.</p>
|
||||
</blockquote>
|
||||
<h3><a class="anchor" aria-hidden="true" id="usando-o-github-pages"></a><a href="#usando-o-github-pages" 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>Usando o GitHub Pages</h3>
|
||||
<p>Docusaurus was designed to work really well with one of the most popular hosting solutions for open source projects: <a href="https://pages.github.com/">GitHub Pages</a>.</p>
|
||||
<p>Docusaurus was designed to work well with one of the most popular hosting solutions for open source projects: <a href="https://pages.github.com/">GitHub Pages</a>.</p>
|
||||
<h4><a class="anchor" aria-hidden="true" id="deploying-to-github-pages"></a><a href="#deploying-to-github-pages" 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>Deploying to GitHub Pages</h4>
|
||||
<ol>
|
||||
<li>Docusaurus supports deploying as <a href="https://help.github.com/articles/user-organization-and-project-pages">project pages or user/organization pages</a>, your code repository does not even need to be public.</li>
|
||||
|
@ -135,7 +135,7 @@
|
|||
</thead>
|
||||
<tbody>
|
||||
<tr><td><code>organizationName</code></td><td>O usuário ou organização que é dona do repositório. If you are the owner, then it is your GitHub username. In the case of Docusaurus, that would be the "<em>facebook</em>" GitHub organization.</td></tr>
|
||||
<tr><td><code>projectName</code></td><td>O nome do repositório do seu projeto no GitHub. For example, the source code for Docusaurus is hosted at <a href="https://github.com/facebook/docusaurus">https://github.com/facebook/docusaurus</a>, so our project name in this case would be "docusaurus".</td></tr>
|
||||
<tr><td><code>projectName</code></td><td>O nome do repositório do seu projeto no GitHub. For example, the source code for Docusaurus is hosted at <a href="https://github.com/facebook/docusaurus">https://github.com/facebook/docusaurus</a>, so our project name, in this case, would be "docusaurus".</td></tr>
|
||||
<tr><td><code>url</code></td><td>Your website's URL. For projects hosted on GitHub pages, this will be "https://<em>username</em>.github.io"</td></tr>
|
||||
<tr><td><code>baseUrl</code></td><td>Base URL for your project. For projects hosted on GitHub pages, it follows the format "/<em>projectName</em>/". For <a href="https://github.com/facebook/docusaurus">https://github.com/facebook/docusaurus</a>, <code>baseUrl</code> is <code>/docusaurus/</code>.</td></tr>
|
||||
</tbody>
|
||||
|
@ -162,7 +162,7 @@
|
|||
<tr><th>Nome</th><th>Descrição</th></tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr><td><code>GIT_USER</code></td><td>O nome de usuário de uma conta do GitHub que tenha permissão para fazer commits para este repositório. No caso dos seus próprios repositórios, você pode usar seu próprio nome de usuário do GitHub. O <code>GIT_USER</code> especificado precisa ter acesso de push no repositório especificado pela combinação de <code>organizationName</code> e <code>projectName</code>.</td></tr>
|
||||
<tr><td><code>GIT_USER</code></td><td>The username for a GitHub account that has to commit access to this repo. For your repositories, this will usually be your own GitHub username. O <code>GIT_USER</code> especificado precisa ter acesso de push no repositório especificado pela combinação de <code>organizationName</code> e <code>projectName</code>.</td></tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<p>Para rodar o script diretamente da linha de comando, você pode usar o seguinte comando, preenchendo os valores de parâmetros conforme apropriado.</p>
|
||||
|
@ -191,7 +191,7 @@
|
|||
<p>Você pode executar o comando acima a qualquer momento que você atualizar sua documentação e desejar publicar as alterações no seu site. Executar o script manualmente pode funcionar bem para sites onde a documentação raramente muda e não seja muito inconveniente lembrar de publicar as alterações manualmente.</p>
|
||||
<p>No entanto, você pode automatizar o processo de publicação com integração contínua (CI).</p>
|
||||
<h2><a class="anchor" aria-hidden="true" id="automatizando-deploys-usando-integração-contínua"></a><a href="#automatizando-deploys-usando-integração-contínua" 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>Automatizando deploys usando integração contínua</h2>
|
||||
<p>Serviços de integração contínua (CI) são normalmente usados para realizar tarefas de rotina sempre que novos commits são enviados para o controle de código fonte. Dentre essas tarefas estão a execução de testes unitários e de integração, a automatização de builds, a publicação de pacotes ao NPM e, sim, a implementação de alterações ao seu site. Tudo o que você precisa fazer para automatizar os deploys do seu site é invocar o script <code>publish-gh-pages</code> sempre que sua documentação for atualizada. In the following section, we'll be covering how to do just that using <a href="https://circleci.com/">CircleCI</a>, a popular continuous integration service provider.</p>
|
||||
<p>Serviços de integração contínua (CI) são normalmente usados para realizar tarefas de rotina sempre que novos commits são enviados para o controle de código fonte. Dentre essas tarefas estão a execução de testes unitários e de integração, a automatização de builds, a publicação de pacotes ao NPM e, sim, a implementação de alterações ao seu site. All you need to do to automate the deployment of your website is to invoke the <code>publish-gh-pages</code> script whenever your docs get updated. In the following section, we'll be covering how to do just that using <a href="https://circleci.com/">CircleCI</a>, a popular continuous integration service provider.</p>
|
||||
<h3><a class="anchor" aria-hidden="true" id="usando-circleci-20"></a><a href="#usando-circleci-20" 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>Usando CircleCI 2.0</h3>
|
||||
<p>Se ainda não tiver o feito, você pode <a href="https://circleci.com/signup/">configurar o CircleCI</a> para seu projeto de código aberto. Depois disso, para poder fazer o deploy automático do seu site e documentação via CircleCI, basta configurar o Circle para executar o script <code>publish-gh-pages</code> como parte do processo de deploy. Você pode seguir este passo-a-passo para configurar certinho:</p>
|
||||
<ol>
|
||||
|
@ -203,9 +203,8 @@
|
|||
<li>Crie um diretório <code>.circleci</code> e crie um arquivo <code>config.yml</code> dentro dele.</li>
|
||||
<li>Copie o texto abaixo para o <code>.circleci/config.yml</code>.</li>
|
||||
</ol>
|
||||
<pre><code class="hljs css language-yaml"><span class="hljs-comment"># Se você quiser que o Circle entre em ação apenas em commits diretos à master,</span>
|
||||
<span class="hljs-comment"># você pode descomentar as linhas seguintes e também o filtro `*filter-only-master`</span>
|
||||
<span class="hljs-comment"># lá no fim do arquivo</span>
|
||||
<pre><code class="hljs css language-yaml"><span class="hljs-comment"># If you only want the circle to run on direct commits to master, you can uncomment this out</span>
|
||||
<span class="hljs-comment"># and uncomment the filters: *filter-only-master down below too</span>
|
||||
<span class="hljs-comment">#</span>
|
||||
<span class="hljs-comment"># aliases:</span>
|
||||
<span class="hljs-comment"># - &filter-only-master</span>
|
||||
|
@ -217,7 +216,7 @@
|
|||
<span class="hljs-attr">jobs:</span>
|
||||
<span class="hljs-attr">deploy-website:</span>
|
||||
<span class="hljs-attr">docker:</span>
|
||||
<span class="hljs-comment"># Especifique aqui a versão desejada</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>
|
||||
|
||||
|
@ -225,7 +224,7 @@
|
|||
|
||||
<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">Fazendo</span> <span class="hljs-string">deploy</span> <span class="hljs-literal">no</span> <span class="hljs-string">GitHub</span> <span class="hljs-string">Pages</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 "<GITHUB_USERNAME>@users.noreply.github.com"
|
||||
git config --global user.name "<YOUR_NAME>"
|
||||
|
@ -315,7 +314,7 @@
|
|||
</ol>
|
||||
<p>Você também pode configurar o Netlify para repetir esse processo a cada commit no seu repositório, ou apenas para commits na branch <code>master</code>.</p>
|
||||
<h3><a class="anchor" aria-hidden="true" id="hosting-on-render"></a><a href="#hosting-on-render" 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 Render</h3>
|
||||
<p>Render offers free <a href="https://render.com/docs/static-sites">static site</a> hosting with fully managed SSL, custom domains, a global CDN and continuous auto deploys from your Git repo. Deploy your app in just a few minutes by following these steps.</p>
|
||||
<p>Render offers free <a href="https://render.com/docs/static-sites">static site</a> hosting with fully managed SSL, custom domains, a global CDN and continuous auto deploy from your Git repo. Deploy your app in just a few minutes by following these steps.</p>
|
||||
<ol>
|
||||
<li><p>Create a new <strong>Web Service</strong> on Render, and give Render's GitHub app permission to access your Docusaurus repo.</p></li>
|
||||
<li><p>Selecione a branch a ser publicada. The default is <code>master</code>.</p></li>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue