Skip to content

Commit

Permalink
Updated Docusaurus
Browse files Browse the repository at this point in the history
  • Loading branch information
tgreyuk committed Apr 9, 2022
1 parent 9f53c19 commit b87a0ad
Show file tree
Hide file tree
Showing 7 changed files with 856 additions and 955 deletions.
7 changes: 4 additions & 3 deletions packages/docusaurus-plugin-typedoc/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@
"scripts": {
"lint": "eslint ./src --ext .ts",
"prepublishOnly": "yarn run lint && yarn run build && yarn run test",
"build": "rm -rf ./dist && tsc",
"build": "rimraf ./dist && tsc",
"build-and-test": "yarn run build && yarn run test",
"test:init": "rm -rf test/site && npx npx create-docusaurus@latest test/site classic",
"test:init": "rimraf test/site && npx create-docusaurus@latest test/site classic",
"test:demo:start": "yarn run build && cd test/site && yarn run start",
"test:demo:build": "yarn run build && cd test/site && yarn run build && yarn run serve",
"test": "jest --colors"
Expand All @@ -38,5 +38,6 @@
"markdown",
"typescript",
"api"
]
],
"gitHead": "9f53c19295c5db082e0143eb9e833994c8d5bcec"
}
2 changes: 1 addition & 1 deletion packages/docusaurus-plugin-typedoc/test/site/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,4 @@ yarn-error.log*
/blog
/docs
README.md
sidebars.js

186 changes: 100 additions & 86 deletions packages/docusaurus-plugin-typedoc/test/site/docusaurus.config.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@
const path = require('path');
module.exports = {
// add some test configs

// @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');

/** @type {import('@docusaurus/types').Config} */
const config = {
plugins: [
[
path.resolve(__dirname, '..', '..', 'dist'),
Expand All @@ -15,112 +22,119 @@ module.exports = {
],
],
title: 'My Site',
tagline: 'The tagline of my site',
tagline: 'Dinosaurs are cool',
url: 'https://your-docusaurus-test-site.com',
baseUrl: '/',
onBrokenLinks: 'throw',
onBrokenMarkdownLinks: 'warn',
favicon: 'img/favicon.ico',
organizationName: 'facebook', // Usually your GitHub org/user name.
projectName: 'docusaurus', // Usually your repo name.
themeConfig: {
navbar: {
title: 'My Site',
logo: {
alt: 'My Site Logo',
src: 'img/logo.svg',
},
items: [
{
to: 'docs/api/',
activeBasePath: 'docs',
label: 'API',
position: 'left',
},
{
to: 'docs/',
activeBasePath: 'docs',
label: 'Docs',
position: 'left',
},
{ to: 'blog', label: 'Blog', position: 'left' },
{
href: 'https://github.com/facebook/docusaurus',
label: 'GitHub',
position: 'right',
},
],
},
footer: {
style: 'dark',
links: [
{
title: 'Docs',
items: [
{
label: 'Style Guide',
to: 'docs/',
},
{
label: 'Second Doc',
to: 'docs/doc2/',
},
],
},
{
title: 'Community',
items: [
{
label: 'Stack Overflow',
href: 'https://stackoverflow.com/questions/tagged/docusaurus',
},
{
label: 'Discord',
href: 'https://discordapp.com/invite/docusaurus',
},
{
label: 'Twitter',
href: 'https://twitter.com/docusaurus',
},
],
},
{
title: 'More',
items: [
{
label: 'Blog',
to: 'blog',
},
{
label: 'GitHub',
href: 'https://github.com/facebook/docusaurus',
},
],
},
],
copyright: `Copyright © ${new Date().getFullYear()} My Project, Inc. Built with Docusaurus.`,
},
},

presets: [
[
'@docusaurus/preset-classic',
{
'classic',
/** @type {import('@docusaurus/preset-classic').Options} */
({
docs: {
sidebarPath: require.resolve('./sidebars.js'),
// Please change this to your repo.
editUrl:
'https://github.com/facebook/docusaurus/edit/master/website/',
'https://github.com/facebook/docusaurus/tree/main/packages/create-docusaurus/templates/shared/',
},
blog: {
showReadingTime: true,
// Please change this to your repo.
editUrl:
'https://github.com/facebook/docusaurus/edit/master/website/blog/',
'https://github.com/facebook/docusaurus/tree/main/packages/create-docusaurus/templates/shared/',
},
theme: {
customCss: require.resolve('./src/css/custom.css'),
},
},
}),
],
],

themeConfig:
/** @type {import('@docusaurus/preset-classic').ThemeConfig} */
({
navbar: {
title: 'My Site',
logo: {
alt: 'My Site Logo',
src: 'img/logo.svg',
},
items: [
{
to: 'docs/api/',
activeBasePath: 'docs',
label: 'API',
position: 'left',
},
{
type: 'doc',
docId: 'intro',
position: 'left',
label: 'Tutorial',
},
{ to: '/blog', label: 'Blog', position: 'left' },
{
href: 'https://github.com/facebook/docusaurus',
label: 'GitHub',
position: 'right',
},
],
},
footer: {
style: 'dark',
links: [
{
title: 'Docs',
items: [
{
label: 'Tutorial',
to: '/docs/intro',
},
],
},
{
title: 'Community',
items: [
{
label: 'Stack Overflow',
href: 'https://stackoverflow.com/questions/tagged/docusaurus',
},
{
label: 'Discord',
href: 'https://discordapp.com/invite/docusaurus',
},
{
label: 'Twitter',
href: 'https://twitter.com/docusaurus',
},
],
},
{
title: 'More',
items: [
{
label: 'Blog',
to: '/blog',
},
{
label: 'GitHub',
href: 'https://github.com/facebook/docusaurus',
},
],
},
],
copyright: `Copyright © ${new Date().getFullYear()} My Project, Inc. Built with Docusaurus.`,
},
prism: {
theme: lightCodeTheme,
darkTheme: darkCodeTheme,
},
}),
};

module.exports = config;
10 changes: 5 additions & 5 deletions packages/docusaurus-plugin-typedoc/test/site/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,13 @@
"write-heading-ids": "docusaurus write-heading-ids"
},
"dependencies": {
"@docusaurus/core": "2.0.0-beta.17",
"@docusaurus/preset-classic": "2.0.0-beta.17",
"@docusaurus/core": "2.0.0-beta.18",
"@docusaurus/preset-classic": "2.0.0-beta.18",
"@mdx-js/react": "^1.6.22",
"clsx": "^1.1.1",
"prism-react-renderer": "^1.2.1",
"react": "^17.0.1",
"react-dom": "^17.0.1"
"prism-react-renderer": "^1.3.1",
"react": "^17.0.2",
"react-dom": "^17.0.2"
},
"browserslist": {
"production": [
Expand Down
31 changes: 31 additions & 0 deletions packages/docusaurus-plugin-typedoc/test/site/sidebars.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
/**
* Creating a sidebar enables you to:
- create an ordered group of docs
- render a sidebar for each doc of that group
- provide next/previous navigation
The sidebars can be generated from the filesystem, or explicitly defined here.
Create as many sidebars as you want.
*/

// @ts-check

/** @type {import('@docusaurus/plugin-content-docs').SidebarsConfig} */
const sidebars = {
// By default, Docusaurus generates a sidebar from the docs folder structure
tutorialSidebar: [{type: 'autogenerated', dirName: '.'}],

// But you can create a sidebar manually
/*
tutorialSidebar: [
{
type: 'category',
label: 'Tutorial',
items: ['hello'],
},
],
*/
};

module.exports = sidebars;
Loading

0 comments on commit b87a0ad

Please sign in to comment.