Skip to content

Each Zero module's documentation site are built individually as part of the module, this repo stores the common elements for them.

Notifications You must be signed in to change notification settings

commitdev/zero-doc-site-common-elements

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

zero-doc-site-common-elements

This repository is used to store common elements used in Zero module's documentation websites, each module lives with its own documentation website so they can be updated together, but the themes should be updated at once.

It provides:

Common modules' doc site link for Docusaurus sidebar

Example Usage:

const config = require('./docusaurus.config');
const { sidebarsNavModules } = require('@commitdev/zero-doc-site-common-elements');

module.exports = {
  sidebar: [
    {
      type: 'autogenerated',
      dirName: '.'
    },
    sidebarsNavModules(config),
  ],
};

Common elements in docusaurus.config.js

exports replaces
themeConfig config.themeConfig
footer config.themeConfig.footer
navbar config.themeConfig.navbar
stylesheets config.stylesheets
misc { onBrokenLinks, onBrokenMarkdownLinks, favicon, organizationName }

Function to download common CSS file from upstream repo

Example Usage:

const { downloadCommonCustomCss, themeConfig, stylesheets, misc } = require('@commitdev/zero-doc-site-common-elements');

// should consider try/catch incase this fails
const customCss = require.resolve(downloadCommonCustomCss());

module.exports = {
  ...allYourRegularConfig,
  presets: [[
    '@docusaurus/preset-classic',
    {
      ...docs,
      theme: {
        customCss,
      },
    },
  ]],
}

About

Each Zero module's documentation site are built individually as part of the module, this repo stores the common elements for them.

Resources

Stars

Watchers

Forks

Packages

No packages published