custom-links-hook
TL;DR
Integrates the map of links into the header or footer of the documentation.
Integration:
1. Add dependency
- yarn
- npm
yarn add -WD "@docusaurus-tde/custom-links-hook"
npm i "@docusaurus-tde/custom-links-hook"
2. Create a map of links
custom-links-hook uses the map of links with the following structure:
type linksMap = {
[category: string]: {
title: string;
items: Array<{ label: string; href: string; }>,
}
}
3. Connect the hook
docusaurus-tde.config.js
const linksMap = require('./linksMap')
module.exports = {
hooks: [
['@docusaurus-tde/custom-links-hook', { linksMap }],
]
}
Hook configuration:
type contentHookProps = {
linksMap: linksMap;
viewType?: 'header' | 'footer' // default: 'header'
}