You can add pages to your site that are not part of the standard docs or blog markdown files. You can do this by adding .js
files to the website/pages
directory. These files are React components and the render()
is called to create them, backed by CSS classes, etc.
Customizing Your Home Page
The easiest way to get started customizing your home page is to use the example site that was created when you ran the Docusaurus initialization script.
-You can start your local server and go to http://localhost:3000
to see what the example home page looks like. From there, edit the website/pages/en/index.js
file and its various components to use the images and text you want for your project.
+You can start your local server and go to http://localhost:3000
to see what the example home page looks like. From there, edit the website/pages/en/index.js
file and its various components to use the images and text you want for your project.
Adding Other Custom Pages
Docusaurus provides some simple example pages in the website/pages/en
directory, including index.js
, users.js
, and help.js
. These are good examples to showcase how to create a custom page for Docusaurus.
root-of-repo
diff --git a/docs/en/publishing.html b/docs/en/publishing.html
index be332a4d48..1cca14dc56 100644
--- a/docs/en/publishing.html
+++ b/docs/en/publishing.html
@@ -21,7 +21,7 @@
Even if your repo is private, anything published to a gh-pages
branch will be public.
-Most of the work to publish to GitHub pages is done for you automatically through the publish-gh-pages
script. You just need to determine the values for a few parameters required by the script.
+Most of the work to publish to GitHub pages is done for you automatically through the publish-gh-pages
script. You just need to determine the values for a few parameters required by the script.
Two of the required parameters are set in the siteConfig.js
:
organizationName
: The GitHub user or organization that owns the repository. In the case of Docusaurus, that would be the "facebook" GitHub organization.
@@ -50,7 +50,7 @@
The specified GIT_USER
must have push access to the repository specified in the combination of organizationName
and projectName
.
-You should now be able to load your website by visiting its GitHub Pages URL, which could be something along the lines of https://username.github.io/projectName, or a custom domain if you have set that up. For example, Docusaurus' own GitHub Pages URL is https://docusaurus.io (it can also be accessed via https://facebook.github.io/docusaurus), because it is served from the gh-pages
branch of the https://github.com/facebook/docusaurus GitHub repo. We highly encourage reading through the GitHub Pages documentation to learn more about how this hosting solution works.
+You should now be able to load your website by visiting its GitHub Pages URL, which could be something along the lines of https://username.github.io/projectName, or a custom domain if you have set that up. For example, Docusaurus' own GitHub Pages URL is https://docusaurus.io (it can also be accessed via https://docusaurus.io/), because it is served from the gh-pages
branch of the https://github.com/facebook/docusaurus GitHub repo. We highly encourage reading through the GitHub Pages documentation to learn more about how this hosting solution works.
You can run the command above any time you update the docs and wish to deploy the changes to your site. Running the script manually may be fine for sites where the documentation rarely changes and it is not too much of an inconvenience to remember to manually deploy changes.
However, you can automate the publishing process with continuous integration (CI).
Automating Deployments Using Continuous Integration
diff --git a/docs/en/versioning.html b/docs/en/versioning.html
index 17293b4d1f..9a185743db 100644
--- a/docs/en/versioning.html
+++ b/docs/en/versioning.html
@@ -50,7 +50,7 @@
yarn run rename-version 1.0.0 1.0.1
Versioning and Translations
-If you wish to use versioning and translations features, the crowdin.yaml
file should be set up to upload and download versioned documents to and from Crowdin for translation. Translated, versioned files will go into the folder translated_docs/${language}/version-${version}/
. For more information, check out the translations guide.
+If you wish to use versioning and translations features, the crowdin.yaml
file should be set up to upload and download versioned documents to and from Crowdin for translation. Translated, versioned files will go into the folder translated_docs/${language}/version-${version}/
. For more information, check out the translations guide.