Docusaurus
npx create-docusaurus@latest my-website classic
cd my-website
npm start
# npx docusaurus start
# http://localhost:3000
# Search
npm install --save @easyops-cn/docusaurus-search-local
# config - https://github.com/easyops-cn/docusaurus-search-local
# https://docusaurus.io/docs/api/plugins/@docusaurus/plugin-pwa
npm install --save @docusaurus/plugin-pwa
npm install --save @docusaurus/plugin-google-gtag
npm install --save @docusaurus/plugin-ideal-image
# Build and serve
npm run build
npm run serve
# Publishes the website to GitHub pages
npm deploy
Docusaurus authentication with Firebase | by Thomasdevshare | Medium
Extensions
swizzling - allows deeper site customizations
swizzling permits to swap a theme component with your own implementation, and it comes in 2 patterns
- Ejecting: creates a copy of the original theme component, which you can fully customize
- Wrapping: creates a wrapper around the original theme component, which you can enhance
Plugins
- 📦 plugin-client-redirects | Docusaurus
- 📦 plugin-ideal-image | Docusaurus
- 📦 plugin-google-gtag | Docusaurus
- 📦 plugin-content-docs | Docusaurus
- Serving Optimized Docusaurus Images with Rehype, Markdown and Cloudinary - DevJams Episode #21 - YouTube
- Docusaurus
- GitHub - Arsero/docusaurus-graph: The Docusaurus GraphView Plugin is an open source plugin designed to generate a graph view from your Docusaurus documentation files.
Upgrading from v2 to v3
Announcing Docusaurus 3.0 | Docusaurus
Upgrading to Docusaurus v3 | Docusaurus
# check if all files compile successfully
npx docusaurus-mdx-checker
Upgrading minor versions
To upgrade a minor version in Docusaurus v3, simply open your package.json
file, locate the "@docusaurus/core"
dependency, and change the minor version number to the desired one, then run npm install
or yarn install
to install the updated version and its dependencies; ensure all "@docusaurus" packages are updated to the same minor version for consistency.
npm i @docusaurus/core@latest @docusaurus/plugin-google-gtag@latest @docusaurus/plugin-ideal-image@latest @docusaurus/plugin-pwa@latest @docusaurus/preset-classic@latest @docusaurus/module-type-aliases@latest @docusaurus/types@latest
Search
Local Search (not compatible with v3)
themes: [
[
require.resolve("@easyops-cn/docusaurus-search-local"),
({
hashed: true,
docsRouteBasePath: '/',
highlightSearchTermsOnTargetPage: true,
}),
],
],
Releases · cmfcmf/docusaurus-search-local
Algolia
Run your own | DocSearch by Algolia
algolia: {
// The application ID provided by Algolia
appId: 'X3OY8NGHVH',
// Public API key: it is safe to commit it
apiKey: '55231a2d373a93253025c5b165065e15',
indexName: 'deepaksood619io',
// Optional: see doc section below
contextualSearch: true,
// Optional: Specify domains where the navigation should occur through window.location instead on history.push. Useful when our Algolia config crawls multiple documentation sites and we want to navigate with window.location.href to them.
externalUrlRegex: 'external\\.com|domain\\.com',
// Optional: Replace parts of the item URLs from Algolia. Useful when using the same search index for multiple deployments using a different baseUrl. You can use regexp or string in the `from` param. For example: localhost:3000 vs myCompany.com/docs
replaceSearchResultPathname: {
from: '/docs/', // or as RegExp: /\/docs\//
to: '/',
},
// Optional: Algolia search parameters
searchParameters: {},
// Optional: path for search page that enabled by default (`false` to disable it)
searchPagePath: 'search',
//... other Algolia params
},
CMS
- I was looking for a Docusaurus-friendly CMS : r/Docusaurus
- A minimal CMS for Docusaurus | Spinal
- Docusaurus | Decap CMS | Open-Source Content Management System
- Gitten - Your Git Assistant
- Docusaurus