Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

📕 docs: improve docs #2368

Merged
merged 11 commits into from
Jul 12, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 0 additions & 7 deletions sources/@repo/docs/_redirects

This file was deleted.

110 changes: 33 additions & 77 deletions sources/@repo/docs/config/docusaurus.theme.cjs
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
const dracula = require(`prism-react-renderer/themes/dracula`)
const config = require(`../../../../config/monorepo.config.cjs`)
const releaseData = require(`../generated/releases/data.json`)

/**
* Announcement bar config
* Color mode
*/
const announcementBar = {
content: `Support bud.js <a href="https://github.com/sponsors/roots">on github sponsors</a>`,
id: `announcementBar-5`, // Increment on change
const colorMode = {
disableSwitch: true,
respectPrefersColorScheme: true,
}

/**
Expand All @@ -16,52 +17,6 @@ const footer = {
copyright: `Copyright © ${new Date().getFullYear()} ${
config.organization.name
}.`,
links: [
{
items: [
{
label: `Getting started`,
to: `/guides/getting-started/`,
},
{
label: `Configuration`,
to: `/docs/config/`,
},
{
label: `Extensions`,
to: `/extensions/`,
},
],
title: `Links`,
},
{
items: [
{
href: config.organization.twitter,
label: `Twitter`,
},
{
href: config.url.discourse,
label: `Discourse`,
},
],
title: `Community`,
},
{
items: [
{
label: `Releases`,
to: `/releases`,
},
{
href: config.url.web,
label: `GitHub`,
},
],
title: `More`,
},
],
style: `dark`,
}

/**
Expand Down Expand Up @@ -105,15 +60,15 @@ const navbar = {
hideOnScroll: true,
items: [
{
docId: `index`,
docsPluginId: `guides`,
label: `Guides`,
docId: `getting-started/index`,
docsPluginId: `learn`,
label: `Learn`,
position: `left`,
type: `doc`,
},
{
href: `/docs/config`,
label: `Docs`,
href: `/reference/bud.after`,
label: `Reference`,
position: `left`,
},
{
Expand All @@ -124,39 +79,40 @@ const navbar = {
type: `doc`,
},
{
items: [
{label: `latest`, to: `/releases/tags/6-14`},
{label: `6.13`, to: `/releases/tags/6-13`},
{label: `6.12`, to: `/releases/tags/6-12`},
{label: `6.11`, to: `/releases/tags/6-11`},
{label: `6.9`, to: `/releases/tags/6-9`},
{label: `6.8`, to: `/releases/tags/6-8`},
{label: `6.7`, to: `/releases/tags/6-7`},
{label: `6.6`, to: `/releases/tags/6-6`},
{label: `6.5`, to: `/releases/tags/6-5`},
{label: `6.4`, to: `/releases/tags/6-4`},
],
items: releaseData.reduce((items, release, i) => {
if (i === 0) {
return [
...items,
{label: `Latest`, to: `/releases/${release.semver}`},
]
}
if (release.patch === 0) {
return [
...items,
{
label: release.semver,
to: `/releases/tags/${release.major}-${release.minor}`,
},
]
}
return items
}, []),
label: `Releases`,
position: `left`,
to: `/releases`,
},
{
className: `header-github-link`,
href: `/dev`,
label: `Dev`,
position: `right`,
},
{
'aria-label': `Discourse`,
className: `header-discourse-link`,
href: config.url.discourse,
label: `Community`,
label: ` `,
position: `right`,
},
{
'aria-label': `GitHub repository`,
'aria-label': `GitHub`,
className: `header-github-link`,
href: config.url.web,
label: `GitHub`,
label: ` `,
position: `right`,
},
],
Expand All @@ -176,7 +132,7 @@ const prism = {
}

module.exports = {
announcementBar,
colorMode,
footer,
metadata,
navbar,
Expand Down
25 changes: 7 additions & 18 deletions sources/@repo/docs/config/index.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ const pluginSearch = require.resolve(`docusaurus-lunr-search`)

const docsPath = path => resolve(__dirname, `..`, path ?? ``)

const sidebarPath = docsPath(`sidebars/docs.cjs`)
const sidebarPath = docsPath(`sidebars/reference.cjs`)

const remarkPlugins = [[npm2yarn, {sync: true}]]

Expand Down Expand Up @@ -45,24 +45,12 @@ module.exports = {
pluginDocs,
{
editUrl: join(config.url.web, `edit/main/sources/@repo/docs/`),
id: `dev`,
id: `learn`,
include: [`**/*.md`, `**/*.mdx`],
path: docsPath(`content/dev`),
path: docsPath(`content/learn`),
remarkPlugins,
routeBasePath: `dev`,
sidebarPath: docsPath(`sidebars/sidebar.cjs`),
},
],
[
pluginDocs,
{
editUrl: join(config.url.web, `edit/main/sources/@repo/docs/`),
id: `guides`,
include: [`**/*.md`, `**/*.mdx`],
path: docsPath(`content/guides`),
remarkPlugins,
routeBasePath: `guides`,
sidebarPath: docsPath(`sidebars/guides.cjs`),
routeBasePath: `learn`,
sidebarPath: docsPath(`sidebars/learn.cjs`),
},
],
[
Expand Down Expand Up @@ -93,8 +81,9 @@ module.exports = {
},
docs: {
editUrl: join(config.url.web, `edit/main/sources/@repo/docs/`),
path: docsPath(`content/docs`),
path: docsPath(`content/reference`),
remarkPlugins,
routeBasePath: `reference`,
sidebarPath,
},
pages: {
Expand Down
170 changes: 0 additions & 170 deletions sources/@repo/docs/content/dev/index.md

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ It includes the following extensisons:
- [@roots/bud-postcss](/extensions/bud-postcss)
- [@roots/bud-react](/extensions/bud-react)
- [@roots/bud-entrypoints](/extensions/bud-entrypoints)
- [@roots/bud-wordpress-manifests](/extensions/bud-wordpress-manifests)
- [@roots/wordpress-hmr](/extensions/bud-preset-wordpress/editor-integration)

## Installation
Expand Down
Loading
Loading