Configuring Docusaurus
Introduction​
In this section, we will explore how to customize your Docusaurus site by modifying configuration files, themes, and plugins.
Useful Links​
Getting Started with Configuration​
To get started with configuration, you need to locate the docusaurus.config.js
file at the root of your project. This file contains all the settings for your site, including the title, URL, and theme configuration. You can customize various options here to tailor your Docusaurus site to your needs.
The high-level overview of Docusaurus configuration can be categorized into:
- Site metadata
- Deployment configurations
- Theme, plugin, and preset configurations
- Custom configurations
Site metadata​
Site metadata includes crucial global information like the title, URL, base URL, and favicon. These elements are utilized in various parts of your site, such as the title and headings, browser tab icon, social media sharing (Facebook, Twitter), and to ensure the correct paths for serving static files.
Set the title and tagline of your site.
title: 'Digital Reflections',
tagline: 'Mapping a personal odyssey into the frontiers of Cloud and DevOps',
Then for the favicon, pop the .ico image into the static/img
folder and then reference it in the config.
favicon: 'img/cloudFavicon.ico',
Then set the URL and baseUrl for your site.
url: 'https://www.digital-reflections.com',
baseUrl: '/',
Deployment configurations​
Link: - Docusaurus Deployment
Key fields to update: -
Field | Description | Example |
---|---|---|
url | Set this to the URL where your site will be hosted. | https://www.digital-reflections.com |
baseUrl | The base URL for your site. It is the sub-path of the domain where your site is located. For example, if your site is served at https://example.com/docs/ , then baseUrl should be set to /docs/ . This setting is essential for proper routing and linking of resources within your Docusaurus site. | '/' |
organizationName | The name of your GitHub organization | cldy450 |
projectName | The GitHub repository name | digital-reflections |
Theme, plugin, and preset configurations​
Docusaurus uses themes to define the overall look and feel of your site. By default, Docusaurus uses the @docusaurus/preset-classic
preset, which includes several useful components like a navbar, footer, and sidebar.
You can also use plugins to add additional functionality to your site, such as search or analytics.