Skip to content

Commit

Permalink
Merge pull request #122 from data-derp/feature/#121-no-navigation
Browse files Browse the repository at this point in the history
121 | ks | add no navigation toggle script
  • Loading branch information
KrisSimon authored Feb 20, 2024
2 parents dd5a648 + d6685e9 commit 1762154
Show file tree
Hide file tree
Showing 2 changed files with 136 additions and 112 deletions.
229 changes: 117 additions & 112 deletions docusaurus.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,122 +6,127 @@ const darkCodeTheme = require('prism-react-renderer/themes/dracula');

/** @type {import('@docusaurus/types').Config} */
const config = {
title: 'Data Derp',
title: 'Data Derp',
// tagline: 'Data Derp',
url: 'https://data-derp.github.io',
baseUrl: '/',
onBrokenLinks: 'ignore',
onBrokenMarkdownLinks: 'warn',
// favicon: 'img/favicon.ico',
organizationName: 'data-derp', // Usually your GitHub org/user name.
projectName: 'data-derp.github.io', // Usually your repo name.
deploymentBranch: 'gh-pages',
staticDirectories: ['public', 'static'],

presets: [
[
'@docusaurus/preset-classic',
/** @type {import('@docusaurus/preset-classic').Options} */
({
docs: {
sidebarPath: require.resolve('./sidebars.js'),
// Please change this to your repo.
editUrl: 'https://github.com/data-derp/data-derp.github.io/tree/master/docs',
showLastUpdateAuthor: true,
lastVersion: '2.0',
versions: {
"1.0": {
label: '1.0',
path: '1.0',
banner: 'none'
},
"2.0": {
label: '2.0',
path: '2.0',
banner: 'none'
},
},
},
// blog: {
// showReadingTime: true,
// // Please change this to your repo.
// editUrl:
// 'https://github.com/data-derp/data-derp.github.io/tree/master/blog',
// },
theme: {
customCss: require.resolve('./src/css/custom.css'),
},
}),
url: 'https://data-derp.github.io',
baseUrl: '/',
onBrokenLinks: 'ignore',
onBrokenMarkdownLinks: 'warn',
// favicon: 'img/favicon.ico',
organizationName: 'data-derp', // Usually your GitHub org/user name.
projectName: 'data-derp.github.io', // Usually your repo name.
deploymentBranch: 'gh-pages',
staticDirectories: ['public', 'static'],
scripts: [
{
src: '/js/nav.js',
async: false
}
],
presets: [
[
'@docusaurus/preset-classic',
/** @type {import('@docusaurus/preset-classic').Options} */
({
docs: {
sidebarPath: require.resolve('./sidebars.js'),
// Please change this to your repo.
editUrl: 'https://github.com/data-derp/data-derp.github.io/tree/master/docs',
showLastUpdateAuthor: true,
lastVersion: '2.0',
versions: {
"1.0": {
label: '1.0',
path: '1.0',
banner: 'none'
},
"2.0": {
label: '2.0',
path: '2.0',
banner: 'none'
},
},
},
// blog: {
// showReadingTime: true,
// // Please change this to your repo.
// editUrl:
// 'https://github.com/data-derp/data-derp.github.io/tree/master/blog',
// },
theme: {
customCss: require.resolve('./src/css/custom.css'),
},
}),
],
],
],

themeConfig:
themeConfig:
/** @type {import('@docusaurus/preset-classic').ThemeConfig} */
({
navbar: {
title: 'Data Derp',
// logo: {
// alt: 'Data Derp logo',
// src: 'img/logo.svg',
// },
items: [
{
type: 'doc',
docId: 'intro',
position: 'left',
label: 'Lessons',
},
{to: '/blog', label: 'Blog', position: 'left'},
{
href: 'https://github.com/data-derp/data-derp.github.io',
label: 'GitHub',
position: 'right',
},
],
},
footer: {
style: 'dark',
links: [
{
title: 'Docs',
items: [
{
label: 'Lessons',
to: '/docs/intro',
},
],
},
{
title: 'Community',
items: [
{
label: 'Slack',
href: '#',
},
],
},
{
title: 'More',
items: [
{
label: 'Blog',
to: '/blog',
},
{
label: 'GitHub',
href: 'https://github.com/data-derp',
},
],
},
],
copyright: `Copyright © ${new Date().getFullYear()} Data Derp`,
},
prism: {
theme: lightCodeTheme,
darkTheme: darkCodeTheme,
},
}),
themes: ['docusaurus-theme-frontmatter'],
({
navbar: {
title: 'Data Derp',
// logo: {
// alt: 'Data Derp logo',
// src: 'img/logo.svg',
// },
items: [
{
type: 'doc',
docId: 'intro',
position: 'left',
label: 'Lessons',
},
{to: '/blog', label: 'Blog', position: 'left'},
{
href: 'https://github.com/data-derp/data-derp.github.io',
label: 'GitHub',
position: 'right',
},
],
},
footer: {
style: 'dark',
links: [
{
title: 'Docs',
items: [
{
label: 'Lessons',
to: '/docs/intro',
},
],
},
{
title: 'Community',
items: [
{
label: 'Slack',
href: '#',
},
],
},
{
title: 'More',
items: [
{
label: 'Blog',
to: '/blog',
},
{
label: 'GitHub',
href: 'https://github.com/data-derp',
},
],
},
],
copyright: `Copyright © ${new Date().getFullYear()} Data Derp`,
},
prism: {
theme: lightCodeTheme,
darkTheme: darkCodeTheme,
},
}),
themes: ['docusaurus-theme-frontmatter'],
};

module.exports = config;
19 changes: 19 additions & 0 deletions static/js/nav.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
window.addEventListener("load", function (event) {

// Disable naviagation container, when page is called from gather.town
// add query parameter nav=false to embedded links
const displayNavigation = getQueryParameterByName('nav');
if (displayNavigation !== 'false') {
return
}

const asides = document.getElementsByTagName('aside');
if (asides.length > 0) {
asides[0].style.display = 'none'
}
});

function getQueryParameterByName(name) {
var match = RegExp('[?&]' + name + '=([^&]*)').exec(window.location.search);
return match && decodeURIComponent(match[1].replace(/\+/g, ' '));
}

0 comments on commit 1762154

Please sign in to comment.