-
-
Notifications
You must be signed in to change notification settings - Fork 8.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
docs(v2): update config docs #1885
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,9 @@ | ||
--- | ||
id: docusaurus.config.js | ||
title: docusaurus.config.js | ||
description: API reference for Docusaurus configuration file. | ||
--- | ||
|
||
<!-- | ||
Goal: To serve as a manual for all configurations in docusaurus.config.js | ||
Should keep the titles to themselves for cleaner link | ||
--> | ||
|
||
## Overview | ||
|
||
`docusaurus.config.js` contains configurations for your site and is placed in the root directory of your site. | ||
|
@@ -18,7 +14,7 @@ title: docusaurus.config.js | |
|
||
- Type: `string` | ||
|
||
Title is used in a number of places in your site including the title for the web page, headings, etc. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Less word is better. |
||
Title for your website. | ||
|
||
```js | ||
// docusaurus.config.js | ||
|
@@ -31,7 +27,7 @@ module.exports = { | |
|
||
- Type: `string` | ||
|
||
Tagline is used in a number of places in your site including the title for the web page, sub headings, etc. | ||
The tagline for your website. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Actually is this field strictly necessary? If we don't use it in the pages/index it's not used right? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. i think not really required, i think we can make it theme-specific. but It is used in theme-fallback layout now (which we can remove). Its only used as default title in @theme/Layout. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. but this PR is only about docs change. I'm gonna take a rest. do you want to remove it from required field of docusaurus.config and make it as themeConfig instead ? I think we're still missing a doc page for @docusaurus-theme-classic Theme Configuration |
||
|
||
```js | ||
// docusaurus.config.js | ||
|
@@ -45,7 +41,16 @@ module.exports = { | |
|
||
- Type: `string` | ||
|
||
If you use an official template, your site will be generated with the following directory | ||
URL for site favicon. Example: | ||
|
||
```js | ||
// docusaurus.config.js | ||
module.exports = { | ||
favicon: 'https://v2.docusaurus.io/favicon.ico', | ||
}; | ||
``` | ||
|
||
You can also use the favicon URL relative to the `static` directory of your site. For example, your site has the following directory structure: | ||
|
||
```bash | ||
. | ||
|
@@ -56,7 +61,7 @@ If you use an official template, your site will be generated with the following | |
└── favicon.ico | ||
``` | ||
|
||
And your generated `docusaurus.config.js` will contain this the field for your favicon URL relative to the `static` directory of your site. | ||
So you can refer it like below: | ||
|
||
```js | ||
// docusaurus.config.js | ||
|
@@ -65,15 +70,11 @@ module.exports = { | |
}; | ||
``` | ||
|
||
**Note**: It does accept external nor absolute url. | ||
|
||
### `url` | ||
|
||
<!-- TODO: where else is this used other than GH Pages? --> | ||
|
||
- Type: `string` | ||
|
||
If you use GitHub Pages, this will be the URL for your GitHub Page's user/organization page, commonly https://_username_.github.io. | ||
URL for your website. This can also be considered the top-level hostname. For example, `https://facebook.github.io` is the URL of https://facebook.github.io/metro/, and `https://docusaurus.io` is the URL for https://docusaurus.io. This field is related to the [baseUrl](#baseurl) field. | ||
|
||
```js | ||
// docusaurus.config.js | ||
|
@@ -86,7 +87,7 @@ module.exports = { | |
|
||
- Type: `string` | ||
|
||
Base URL for your project. For projects hosted on GitHub pages, it follows the format "/_projectName_/". For https://github.com/facebook/docusaurus, `baseUrl` is `/docusaurus/`. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I modified this because its not always specific to github pages and can be confusing especially if they use custom domain |
||
Base URL for your site. This can also be considered the path after the host. For example, `/metro/` is the baseUrl of https://facebook.github.io/metro/. For URLs that have no path, the baseUrl should be set to `/`. This field is related to the [url](#url) field. | ||
|
||
```js | ||
// docusaurus.config.js | ||
|
@@ -147,6 +148,8 @@ An object containing data needed by the theme you use.<!--, see [theme configura | |
|
||
For Docusaurus' default theme _classic_, we use `themeConfig` to customize your navbar and footer links: | ||
|
||
Example: | ||
|
||
```js | ||
// docusaurus.config.js | ||
module.exports = { | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Simplify example