This is the source code for the Authress Knowledge Base.
Keep this in mind: How to write documentation - diataxis
- run
yarn
(every time the package manifest changes, unlikely) - run
yarn start
yarn
yarn build
To add something to a page or content, find the relevant react component generating that content from ./node_modules/@docusaurus/theme-classic/src/theme/ and copy that directory into the /src/theme directory.
https://docusaurus.io/docs/api/plugins/@docusaurus/plugin-content-blog#markdown-front-matter
- Replace bad top level links with:
pathname:///knowledge-base/whole path
instead: https://docusaurus.io/docs/advanced/routing - search: https://docusaurus.io/community/resources#search
- Add * og:image image meta overrides to doc pages
See Internal Authress kb-processor
If you get a page not found when running yarn start
for a linked page:
- Check to make sure that page is in the same hierarchy, you can't link from docs => articles, it must start with /knowledge-base in those cases
- If it is in the same hierarchy, then run
yarn build
and fix the errors that show up, sometimes there are issues thatyarn start
doesn't catch.
import useDocusaurusContext from '@docusaurus/useDocusaurusContext';
console.log('****', useDocusaurusContext());
import {useLocation} from '@docusaurus/router';
import useDocusaurusContext from '@docusaurus/useDocusaurusContext';
/**
* Get the pathname of current route, without the optional site baseUrl.
* - `/docs/myDoc` => `/docs/myDoc`
* - `/baseUrl/docs/myDoc` => `/docs/myDoc`
*/
export function useLocalPathname(): string {
const {
siteConfig: {baseUrl},
} = useDocusaurusContext();
const {pathname} = useLocation();
return pathname.replace(baseUrl, '/');
}
- Make sure all plugins work