Skip to content

Commit

Permalink
Docs: Bump Docusaurus to 3.2.0 and update config (+ replace JavaScrip…
Browse files Browse the repository at this point in the history
…t based config with TypeScript based config)
  • Loading branch information
kevin-lee committed Apr 3, 2024
1 parent 181b83b commit 5b5777b
Show file tree
Hide file tree
Showing 9 changed files with 10,486 additions and 8,082 deletions.
4 changes: 3 additions & 1 deletion docs/getting-started.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
---
sidebar_position: 1
id: 'getting-started'
title: 'Getting Started'
slug: '/'
---

## ![](../img/just-fp-logo-64x64.png) just-fp
## ![](/img/just-fp-logo-64x64.png) just-fp

[![Build Status](https://github.com/Kevin-Lee/just-fp/workflows/Build-All/badge.svg)](https://github.com/Kevin-Lee/just-fp/actions?workflow=Build-All)
[![Release Status](https://github.com/Kevin-Lee/just-fp/workflows/Release/badge.svg)](https://github.com/Kevin-Lee/just-fp/actions?workflow=Release)
Expand Down
5 changes: 5 additions & 0 deletions docs/syntax/_category_.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"position": 2,
"collapsible": true,
"collapsed": false
}
5 changes: 5 additions & 0 deletions docs/typeclass/_category_.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"position": 3,
"collapsible": true,
"collapsed": false
}
95 changes: 64 additions & 31 deletions website/docusaurus.config.js → website/docusaurus.config.ts
Original file line number Diff line number Diff line change
@@ -1,33 +1,77 @@
module.exports = {
import {themes as prismThemes} from 'prism-react-renderer';
import type {Config} from '@docusaurus/types';
import type * as Preset from '@docusaurus/preset-classic';

const config: Config = {
title: 'Just FP',
tagline: 'Just a small Functional Programming library',
favicon: 'img/favicon.png',

// Set the production url of your site here
url: 'https://just-fp.kevinly.dev',
// Set the /<baseUrl>/ pathname under which your site is served
// For GitHub pages deployment, it is often '/<projectName>/'
baseUrl: '/',
favicon: 'img/favicon.png',
organizationName: 'Kevin-Lee',

// GitHub pages deployment config.
// If you aren't using GitHub pages, you don't need these.
organizationName: 'kevin-lee',
projectName: 'just-fp',

onBrokenLinks: 'throw',
onBrokenMarkdownLinks: 'warn',

// Even if you don't use internationalization, 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',
{
docs: {
path: '../generated-docs/target/mdoc/',
sidebarPath: './sidebars.ts',
},
blog: {
showReadingTime: true,
},
theme: {
customCss: './src/css/custom.css',
},
} satisfies Preset.Options,
],
],

themeConfig: {
sidebarCollapsible: false,
prism: {
theme: require('prism-react-renderer/themes/nightOwl'),
darkTheme: require('prism-react-renderer/themes/nightOwl'),
additionalLanguages: ['scala'],
// Replace with your project's social card
image: 'img/docusaurus-social-card.jpg',
docs: {
sidebar: {
hideable: true,
},
},
navbar: {
title: 'Just FP',
logo: {
alt: 'Just FP Logo',
src: 'img/just-fp-logo-32x32.png',
},
links: [
items: [
{
type: 'docSidebar',
to: 'docs/',
sidebarId: 'docsSidebar',
activeBasePath: 'docs',
label: 'Docs',
position: 'left',
label: 'Docs',
},
{
href: 'https://github.com/Kevin-Lee/just-fp',
href: 'https://github.com/kevin-lee/just-fp',
label: 'GitHub',
position: 'right',
},
Expand Down Expand Up @@ -65,24 +109,13 @@ module.exports = {
],
copyright: `Copyright © ${new Date().getFullYear()} just-fp, <a href="https://github.com/Kevin-Lee" target="_blank">Kevin Lee</a>. Built with Docusaurus.`,
},
},
presets: [
[
'@docusaurus/preset-classic',
{
docs: {
path: '../generated-docs/target/mdoc/',
// It is recommended to set document id as docs home page (`docs/` path).
homePageId: 'getting-started',
sidebarPath: require.resolve('./sidebars.js'),
},
blog: {
showReadingTime: true,
},
theme: {
customCss: require.resolve('./src/css/custom.css'),
},
},
],
],
prism: {
theme: prismThemes.nightOwlLight,
darkTheme: prismThemes.nightOwl,
additionalLanguages: ['java', 'scala'],

},
} satisfies Preset.ThemeConfig,
};

export default config;
Loading

0 comments on commit 5b5777b

Please sign in to comment.