Skip to content

Commit

Permalink
📕 docs: improve docs (#2368)
Browse files Browse the repository at this point in the history
- /getting-started/ => /learn/
- /docs/ => /reference/

## Type of change

**PATCH: backwards compatible change**
  • Loading branch information
kellymears committed Jul 12, 2023
1 parent b5535b2 commit 813a336
Show file tree
Hide file tree
Showing 179 changed files with 1,871 additions and 2,013 deletions.
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

0 comments on commit 813a336

Please sign in to comment.