Files
hanko/docs/docusaurus.config.js
2022-09-13 14:00:42 +02:00

177 lines
4.7 KiB
JavaScript

// @ts-check
// Note: type annotations allow type checking and IDEs autocompletion
const lightCodeTheme = require('prism-react-renderer/themes/github');
const darkCodeTheme = require('prism-react-renderer/themes/dracula');
/** @type {import('@docusaurus/types').Config} */
const config = {
title: 'Hanko Documentation',
tagline: 'Hanko Documentation',
url: 'https://docs.hanko.io',
baseUrl: '/',
onBrokenLinks: 'throw',
onBrokenMarkdownLinks: 'warn',
favicon: 'img/favicon.ico',
// GitHub pages deployment config.
// If you aren't using GitHub pages, you don't need these.
organizationName: 'teamhanko', // Usually your GitHub org/user name.
projectName: 'docs', // Usually your repo name.
trailingSlash: false,
// Even if you don't use internalization, you can use this field to set useful
// metadata like html lang. For example, if your site is Chinese, you may want
// to replace "en" with "zh-Hans".
i18n: {
defaultLocale: 'en',
locales: ['en'],
},
presets: [
[
'redocusaurus',
{
// Plugin Options for loading OpenAPI files
specs: [
{
spec: 'static/spec/public.yaml',
route: '/api/public',
},
{
spec: 'static/spec/admin.yaml',
route: '/api/admin',
},
],
// Theme Options for modifying how redoc renders them
theme: {
primaryColor: '#ff2e4c',
primaryColorDark: '#aedfff',
options : {
nativeScrollbars: true,
scrollYOffset: 60,
disableSearch: true,
noAutoAuth: true,
expandResponses: '200',
jsonSampleExpandLevel: 3,
pathInMiddlePanel: false,
requiredPropsFirst: true,
hideDownloadButton: true
},
// Change with your site colors
theme: {
typography: {
fontSize: '16px',
fontWeightRegular: '500',
code: {
fontSize: '13px',
fontFamily: 'Courier, monospace',
}
},
sidebar: {
arrow: {
size: '1.7em',
color: '#7f7f7f'
},
width: '300px',
},
}
},
},
],
[
'classic',
/** @type {import('@docusaurus/preset-classic').Options} */
({
docs: {
routeBasePath: '/', // Serve the docs at the site's root
sidebarPath: require.resolve('./sidebars.js'),
remarkPlugins: [require('@docusaurus/remark-plugin-npm2yarn'), {sync: true}],
},
blog: false,
theme: {
customCss: [require.resolve('./src/css/custom.css'), require.resolve('./src/css/redoc.css')]
},
}),
],
],
themeConfig:
/** @type {import('@docusaurus/preset-classic').ThemeConfig} */
({
docs: {
sidebar: {
hideable: true
}
},
image: 'img/thumbnail.jpg',
announcementBar: {
id: 'support_us',
content:
'⚠️ This documentation is currently a work in progress, stay tuned for more content! ⚠️',
backgroundColor: '#83ceff',
textColor: '#091E42',
isCloseable: true,
},
colorMode: {
defaultMode: 'dark',
disableSwitch: true,
},
navbar: {
logo: {
alt: 'Hanko Logo',
src: 'img/logo.svg',
href: '/',
},
items: [
{
to: '/',
label: 'Docs',
position: 'left',
activeBaseRegex: '^((?!\/api).)*$'
},
{
type: 'dropdown',
label: 'API',
position: 'left',
items: [
{
label: 'Public',
to: 'api/public'
},
{
label: 'Admin',
to: 'api/admin'
}
]
},
{
type: 'dropdown',
label: 'SDK',
position: 'left',
items: [
{
to: 'jsdoc/@teamhanko/hanko-frontend-sdk/0.0.2-alpha/index.html',
label: 'Frontend 0.0.2-alpha',
target: '_blank'
}
]
},
{
href: 'https://github.com/teamhanko/hanko',
title: "Visit us on GitHub!",
position: 'right',
className: 'header-github-link',
'aria-label': 'Visit us on GitHub!',
},
],
},
prism: {
theme: lightCodeTheme,
darkTheme: darkCodeTheme,
},
}),
};
module.exports = config;