Merge pull request 'Disable color theme switch' (#31) from disable_color_theme_switch into main

Reviewed-on: D-Net/openaire-graph-docs#31
This commit is contained in:
Serafeim Chatzopoulos 2022-12-16 07:12:19 +01:00
commit f8fde1dba8
2 changed files with 10 additions and 35 deletions

View File

@ -5,11 +5,10 @@ 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');
const { filterItems } = require('./sidebar-utils');
/** @type {import('@docusaurus/types').Config} */
const config = {
title: 'OpenAIRE Documentation',
title: 'OpenAIRE Research Graph Documentation',
tagline: 'Open Access Infrastructure for Research in Europe',
url: 'http://snf-23385.ok-kno.grnetcloud.net',
baseUrl: '/', // serve the website at route
@ -37,18 +36,7 @@ const config = {
({
docs: {
routeBasePath: '/', // serve the docs at the site's route
sidebarPath: require.resolve('./sidebars.js'),
async sidebarItemsGenerator({ defaultSidebarItemsGenerator, ...args }) {
const sidebarItems = await defaultSidebarItemsGenerator(args);
const itemsToFilterOut = [
'data-model/entities/entity-identifiers',
'data-model/entities/other'
];
return filterItems(sidebarItems, itemsToFilterOut);
},
// Please change this to your repo.
// Remove this to remove the "edit this page" links.
// editUrl:
@ -64,7 +52,7 @@ const config = {
theme: {
customCss: require.resolve('./src/css/custom.css'),
},
sitemap: {
sitemap: {
changefreq: 'monthly',
priority: 0.5,
ignorePatterns: ['/tags/**'],
@ -105,14 +93,14 @@ const config = {
type: 'docsVersionDropdown',
position: 'right'
},
//
// link to blog, the blog must be enabled first
// {to: '/blog', label: 'Blog', position: 'left'},
//
// link to github repo
// {
// href: 'https://github.com/facebook/docusaurus',
// label: 'GitHub',
// label: 'Issues',
// position: 'right',
// },
],
@ -179,6 +167,11 @@ const config = {
],
copyright: `Copyright © ${new Date().getFullYear()} OpenAIRE`,
},
colorMode: {
defaultMode: 'light',
disableSwitch: true,
respectPrefersColorScheme: false,
},
prism: {
theme: lightCodeTheme,
darkTheme: darkCodeTheme,

View File

@ -1,18 +0,0 @@
// filter out specific items from the sidebar
function filterItems(items, itemsToFilter) {
// filter out items of categories
let result = items.map((item) => {
if (item.type === 'category') {
return {...item, items: filterItems(item.items, itemsToFilter)};
}
return item;
});
// filter out items in current level
return result.filter( item => !itemsToFilter.includes(item.id) );
}
module.exports = {
filterItems
};