mirror of
https://github.com/facebook/docusaurus.git
synced 2025-08-04 01:09:20 +02:00
parent
81465cdbf9
commit
845333ebfa
129 changed files with 924 additions and 924 deletions
|
@ -81,10 +81,10 @@
|
|||
}
|
||||
});
|
||||
</script></nav></div><div class="container mainContainer docsContainer"><div class="wrapper"><div class="post"><header class="postHeader"><a class="edit-page-link button" href="https://crowdin.com/project/docusaurus/zh-CN" target="_blank" rel="noreferrer noopener">Translate</a><h1 id="__docusaurus" class="postHeaderTitle">Publish the Site</h1></header><article><div><span><p><img src="/img/undraw_docusaurus_fb.svg" alt="Docusaurus Facebook"> {.docImage}</p>
|
||||
<p>Next, we'll learn how to publish the site to the WWW for everyone to browse! For the purpose of the tutorial, we'll use GitHub pages to host our website. But you can use any static file hosting service that you want, e.g. Netlify, Amazon S3, etc.</p>
|
||||
<p>Next, we'll learn how to publish the site to the WWW for everyone to browse! 处于教学目的,我们将使用 Github pages 对我们的网站进行托管。 但是你可以选择使用任何其他的静态网页托管服务,例如Netlify、Amazon S3等。</p>
|
||||
<h2><a class="anchor" aria-hidden="true" id="put-the-site-online"></a><a href="#put-the-site-online" 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>Put the Site Online</h2>
|
||||
<p>Kill the web server first by pressing Cmd + C or Ctrl + C depending on your operating system.</p>
|
||||
<p>In <code>website/siteConfig.js</code>, fill in the following fields:</p>
|
||||
<p>先关闭你本地的服务Cmd+C 或 Ctrl+C (由你使用的操作系统决定)。</p>
|
||||
<p>在 <code>website/siteConfig.js</code> 在填写以下字段。</p>
|
||||
<pre><code class="hljs">const siteConfig = {
|
||||
...
|
||||
url: 'https://USERNAME.github.io', // Replace USERNAME with your GitHub username.
|
||||
|
@ -95,13 +95,13 @@
|
|||
}
|
||||
</code></pre>
|
||||
<ol start="2">
|
||||
<li><p>In the <code>website</code> directory, run <code>npm run build</code> or <code>yarn build</code>. 这将在 <code>website</code> 目录下生成一个 <code>build</code> 文件夹, 其中包含 <code>website</code> 目录下所有文档和其他页面中所含的 <code>.html</code> 文件。 Make sure the <code>build</code> directory is there before running the next step.</p></li>
|
||||
<li><p>Replace <code><GIT_USER></code> with your GitHub username and run the following command.</p>
|
||||
<li><p>在 <code>website</code> 目录下,运行 <code>npm run build</code> 或 <code>yarn build</code> 命令。 这将在 <code>website</code> 目录下生成一个 <code>build</code> 文件夹, 其中包含 <code>website</code> 目录下所有文档和其他页面中所含的 <code>.html</code> 文件。 保证 <code>build</code> 目录生成后才进行下一步骤。</p></li>
|
||||
<li><p>用您的GitHub 用户名替换<code><GIT_USER></code>并运行以下命令。</p>
|
||||
<p>$ GIT_USER=<GIT_USER> CURRENT_BRANCH=master USE_SSH=true npm run publish-gh-pages</p></li>
|
||||
</ol>
|
||||
<p>The built code will be pushed to the <code>gh-pages</code> branch of your repository.</p>
|
||||
<p>内置代码将被推送到你的 Github 仓库的 <code>gh-pages</code> 分支下。</p>
|
||||
<ol start="4">
|
||||
<li>Go to <code>https://USERNAME.github.io/docusaurus-tutorial/</code> and view your site in action!</li>
|
||||
<li>转到<code>https://USERNAME.github.io/docusaurus-tutorial/</code>并查看您的站点!</li>
|
||||
</ol>
|
||||
<blockquote>
|
||||
<p>Note that when you run <code>npm run start</code> again, the <code>baseUrl</code> will now be part of the path.</p>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue