openaire-graph-docs/docusaurus.config.js

200 lines
5.6 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-09-21 19:35:12 +02:00
const { filterItems } = require('./sidebar-utils');
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 = {
2022-09-01 13:35:24 +02:00
title: 'OpenAIRE Documentation',
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 13:35:24 +02:00
2022-09-01 09:26:04 +02:00
sidebarPath: require.resolve('./sidebars.js'),
2022-09-21 19:35:12 +02:00
async sidebarItemsGenerator({ defaultSidebarItemsGenerator, ...args }) {
const sidebarItems = await defaultSidebarItemsGenerator(args);
2022-09-20 18:25:30 +02:00
2022-09-21 19:35:12 +02:00
const itemsToFilterOut = [
'data-model/entities/entity-identifiers',
'data-model/entities/other'
];
return filterItems(sidebarItems, itemsToFilterOut);
},
2022-09-01 09:26:04 +02:00
// 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: 'GitHub',
// position: 'right',
// },
2022-09-01 09:26:04 +02:00
],
},
footer: {
style: 'dark',
links: [
{
title: 'Docs',
items: [
{
2022-09-01 13:35:24 +02:00
label: 'Research Graph',
to: '/',
2022-09-01 09:26:04 +02:00
},
],
},
{
2022-09-01 13:35:24 +02:00
title: 'Dashboards',
2022-09-01 09:26:04 +02:00
items: [
{
2022-09-01 13:35:24 +02:00
label: 'Explore',
href: 'https://explore.openaire.eu/',
2022-09-01 09:26:04 +02:00
},
{
2022-09-01 13:35:24 +02:00
label: 'Provide',
href: 'https://provide.openaire.eu/',
2022-09-01 09:26:04 +02:00
},
{
2022-09-01 13:35:24 +02:00
label: 'Connect',
href: 'https://connect.openaire.eu/',
},
{
label: 'Monitor',
href: 'https://monitor.openaire.eu/',
},
{
label: 'Develop',
href: 'https://graph.openaire.eu/',
2022-09-01 09:26:04 +02:00
},
],
},
{
2022-09-01 13:35:24 +02:00
title: 'Community',
2022-09-01 09:26:04 +02:00
items: [
2022-09-01 13:35:24 +02:00
{
label: 'Facebook',
href: 'http://www.facebook.com/groups/openaire/'
},
2022-09-01 09:26:04 +02:00
{
2022-09-01 13:35:24 +02:00
label: 'Linkedin',
href: 'https://www.linkedin.com/company/openaire-eu/',
},
{
label: 'Twitter',
href: 'https://twitter.com/OpenAIRE_eu',
2022-09-01 09:26:04 +02:00
},
{
2022-09-01 13:35:24 +02:00
label: 'Youtube',
href: 'https://www.youtube.com/channel/UChFYqizc-S6asNjQSoWuwjw',
2022-09-01 09:26:04 +02:00
},
],
},
2022-09-01 13:35:24 +02:00
2022-09-01 09:26:04 +02:00
],
2022-09-01 13:35:24 +02:00
copyright: `Copyright © ${new Date().getFullYear()} OpenAIRE`,
2022-09-01 09:26:04 +02:00
},
prism: {
theme: lightCodeTheme,
darkTheme: darkCodeTheme,
},
}),
};
module.exports = config;