openaire-graph-docs/docusaurus.config.js

135 lines
3.8 KiB
JavaScript
Raw Normal View History

2022-09-01 09:26:04 +02:00
// @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');
const math = require('remark-math');
const katex = require('rehype-katex');
2022-12-12 08:35:53 +01:00
const dotenv = require('dotenv');
// load env variables (see .env file)
const env = dotenv.config();
if (env.error) {
throw env.error;
}
console.info("ENV VARIABLES:");
console.info(env.parsed);
2022-09-01 09:26:04 +02:00
/** @type {import('@docusaurus/types').Config} */
const config = {
title: 'OpenAIRE Research Graph Documentation',
2022-09-01 13:35:24 +02:00
tagline: 'Open Access Infrastructure for Research in Europe',
2022-12-12 08:35:53 +01:00
url: process.env.URL,
baseUrl: process.env.BASE_URL, // serve the website at route
2022-09-01 09:26:04 +02:00
onBrokenLinks: 'throw',
onBrokenMarkdownLinks: 'warn',
favicon: 'img/favicon.ico',
// GitHub pages deployment config.
// If you aren't using GitHub pages, you don't need these.
2022-09-20 18:25:30 +02:00
organizationName: 'openaire', // Usually your GitHub org/user name.
projectName: 'openaire-graph-docs', // Usually your repo name.
2022-09-01 09:26:04 +02:00
// 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: [
[
'classic',
/** @type {import('@docusaurus/preset-classic').Options} */
({
docs: {
2022-09-20 18:25:30 +02:00
routeBasePath: '/', // serve the docs at the site's route
2022-09-01 09:26:04 +02:00
sidebarPath: require.resolve('./sidebars.js'),
// Please change this to your repo.
// Remove this to remove the "edit this page" links.
2022-09-01 13:35:24 +02:00
// editUrl:
// 'https://github.com/facebook/docusaurus/tree/main/packages/create-docusaurus/templates/shared/',
2022-09-20 18:25:30 +02:00
remarkPlugins: [ math ],
rehypePlugins: [ katex ],
2022-09-01 09:26:04 +02:00
},
2022-09-20 18:25:30 +02:00
blog: false,
// {
// showReadingTime: true,
// },
2022-09-01 09:26:04 +02:00
theme: {
customCss: require.resolve('./src/css/custom.css'),
},
sitemap: {
changefreq: 'monthly',
priority: 0.5,
ignorePatterns: ['/tags/**'],
filename: 'sitemap.xml',
},
2022-09-01 09:26:04 +02:00
}),
],
],
// required for katex styling of equations
stylesheets: [
{
href: 'https://cdn.jsdelivr.net/npm/katex@0.13.24/dist/katex.min.css',
type: 'text/css',
integrity:
'sha384-odtC+0UGzzFL/6PNoE8rX/SPcQDXBJ+uRepguP4QkPCm2LBxH3FA3y+fKSiJ+AmM',
crossorigin: 'anonymous',
},
],
2022-09-01 09:26:04 +02:00
themeConfig:
/** @type {import('@docusaurus/preset-classic').ThemeConfig} */
({
navbar: {
2022-11-29 15:43:06 +01:00
title: 'documentation',
2022-09-01 09:26:04 +02:00
logo: {
2022-09-01 13:35:24 +02:00
alt: 'OpenAIRE',
src: 'img/logo.png',
2022-09-01 09:26:04 +02:00
},
items: [
2022-09-01 13:35:24 +02:00
// {
2022-11-29 15:43:06 +01:00
// type: 'doc',
// docId: 'intro',
// position: 'left',
// label: 'Research graph v5.0',
2022-09-01 13:35:24 +02:00
// },
//
2022-11-29 15:43:06 +01:00
// documentation version in the navbar
{
type: 'docsVersionDropdown',
position: 'right'
},
// link to blog, the blog must be enabled first
2022-09-01 13:35:24 +02:00
// {to: '/blog', label: 'Blog', position: 'left'},
// link to github repo
2022-09-01 13:35:24 +02:00
// {
// href: 'https://github.com/facebook/docusaurus',
// label: 'Issues',
2022-09-01 13:35:24 +02:00
// position: 'right',
// },
2022-09-01 09:26:04 +02:00
],
},
footer: {
2022-12-20 14:20:50 +01:00
style: 'light',
2022-09-01 13:35:24 +02:00
copyright: `Copyright © ${new Date().getFullYear()} OpenAIRE`,
2022-09-01 09:26:04 +02:00
},
colorMode: {
defaultMode: 'light',
disableSwitch: true,
respectPrefersColorScheme: false,
},
2022-09-01 09:26:04 +02:00
prism: {
theme: lightCodeTheme,
darkTheme: darkCodeTheme,
},
}),
};
module.exports = config;