mirror of
https://github.com/facebook/docusaurus.git
synced 2025-06-02 02:42:41 +02:00
parent
81465cdbf9
commit
845333ebfa
129 changed files with 924 additions and 924 deletions
|
@ -82,9 +82,9 @@
|
|||
});
|
||||
</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">Create Pages</h1></header><article><div><span><p>In this section, we will learn about creating two types of pages in Docusaurus: a regular page and a documentation page.</p>
|
||||
<p><img src="/img/undraw_docusaurus_tree.svg" alt="Docusaurus MacBook"> {.docImage}</p>
|
||||
<h2><a class="anchor" aria-hidden="true" id="creating-a-regular-page"></a><a href="#creating-a-regular-page" 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>Creating a Regular Page</h2>
|
||||
<h2><a class="anchor" aria-hidden="true" id="创建一个常规页面"></a><a href="#创建一个常规页面" 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>创建一个常规页面</h2>
|
||||
<ol>
|
||||
<li><p>Go into the <code>pages/en</code> directory and create a file called <code>hello-world.js</code> with the following contents:</p>
|
||||
<li><p>进入<code>pages/en</code> 目录创建一个叫做 <code>hello-world.js</code> 的文件,并复制以下内容到该文件下。</p>
|
||||
<p>const React = require('react');</p>
|
||||
<p>const CompLibrary = require('../../core/CompLibrary.js');</p>
|
||||
<p>const Container = CompLibrary.Container;
|
||||
|
@ -103,7 +103,7 @@ return (
|
|||
</ol>
|
||||
<ol start="2">
|
||||
<li>Go to <a href="http://localhost:3000/hello-world">http://localhost:3000/hello-world</a> and you should be able to see the new page.</li>
|
||||
<li>Change the text within the <code><p>...</p></code> to "I can write JSX here!". The browser should refresh automatically to reflect the changes.</li>
|
||||
<li>Change the text within the <code><p>...</p></code> to "I can write JSX here!". 保存文件你就可以在浏览器中看到页面内容的变化啦。</li>
|
||||
</ol>
|
||||
<pre><code class="hljs css language-diff"><span class="hljs-deletion">- <p>This is my first page!</p></span>
|
||||
<span class="hljs-addition">+ <p>I can write JSX here!</p></span>
|
||||
|
@ -152,9 +152,9 @@ id sem consectetuer libero luctus adipiscing.</p>
|
|||
<li>A server restart is needed to pick up sidebar changes, so kill your dev server (<kbd>Cmd</kbd> + <kbd>C</kbd> or <kbd>Ctrl</kbd> + <kbd>C</kbd>) and restart it with <code>npm run start</code>.</li>
|
||||
<li>Navigate to <a href="http://localhost:3000/docs/doc4">http://localhost:3000/docs/doc4</a>.</li>
|
||||
</ol>
|
||||
<p>You've created your first documentation page on Docusaurus!</p>
|
||||
<p>你已经创建了你一个文档页面到 Docusaurus!</p>
|
||||
<p>Learn more about creating docs pages <a href="navigation">here</a>.</p>
|
||||
</span></div></article></div><div class="docs-prevnext"><a class="docs-prev button" href="/docs/zh-CN/1.12.0/tutorial-create-new-site"><span class="arrow-prev">← </span><span>Create a New Site</span></a><a class="docs-next button" href="/docs/zh-CN/1.12.0/tutorial-publish-site"><span>Publish the Site</span><span class="arrow-next"> →</span></a></div></div></div><nav class="onPageNav"><ul class="toc-headings"><li><a href="#creating-a-regular-page">Creating a Regular Page</a></li><li><a href="#create-a-documentation-page">Create a Documentation Page</a></li><li><a href="#markdown-syntax">Markdown Syntax</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="
|
||||
</span></div></article></div><div class="docs-prevnext"><a class="docs-prev button" href="/docs/zh-CN/1.12.0/tutorial-create-new-site"><span class="arrow-prev">← </span><span>Create a New Site</span></a><a class="docs-next button" href="/docs/zh-CN/1.12.0/tutorial-publish-site"><span>Publish the Site</span><span class="arrow-next"> →</span></a></div></div></div><nav class="onPageNav"><ul class="toc-headings"><li><a href="#创建一个常规页面">创建一个常规页面</a></li><li><a href="#create-a-documentation-page">Create a Documentation Page</a></li><li><a href="#markdown-syntax">Markdown Syntax</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="
|
||||
/docs/zh-CN/installation">Getting Started</a><a href="
|
||||
/docs/zh-CN/versioning">Versioning</a><a href="
|
||||
/docs/zh-CN/translation">Localization</a><a href="
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue