Publishing your site
现在, 您应该有一个 站点, 并在本地运行 。 一旦您有了 自定义 的喜好, 就该发布它了。 Docusaurus 生成一个静态 HTML 网站, 它可以由您喜爱的 web 服务器或在线托管解决方案提供服务。
-+ 构建静态 HTML 页
生成静态网页
要创建网站的静态生成, 请从 网站
目录中运行以下脚本:
yarn run build # 或是 `npm run build`
这将在 website
目录下生成一个 build
文件夹, 其中包含 website
目录下所有文档和其他页面中所含的 .html
文件。
+ 构建静态 HTML 页
托管静态网页
此时,您会在 website/build
目录中得到所有的文件,并将它们复制到您青睐的 Web 服务器的 html
目录中。
For example, both Apache and Nginx serve content from
@@ -318,11 +318,11 @@/var/www/html
by default. 也就是说,选择 web 服务端或提供相应服务都超出了Docusaurus 的范围。Alter your
-siteConfig.js
to add a property'githubHost'
which represents the GitHub Enterprise hostname. Alternatively, set an environment variableGITHUB_HOST
when executing the publish command.