0.0.9 • Published 3 years ago

@commitdev/zero-doc-site-common-elements v0.0.9

Weekly downloads
-
License
ISC
Repository
-
Last release
3 years ago

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

exportsreplaces
themeConfigconfig.themeConfig
footerconfig.themeConfig.footer
navbarconfig.themeConfig.navbar
stylesheetsconfig.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,
      },
    },
  ]],
}
0.0.9

3 years ago

0.0.8

3 years ago

0.0.5

3 years ago

0.0.7

3 years ago

0.0.6

3 years ago

0.0.3

3 years ago

0.0.2

3 years ago

0.0.4

3 years ago

0.0.1

3 years ago