Skip to content

Commit 108b019

Browse files
committed
doc-site: packaged common elements
1 parent 19a5799 commit 108b019

File tree

4 files changed

+19
-44
lines changed

4 files changed

+19
-44
lines changed

doc-site/docusaurus.config.js

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,17 @@
11
/** @type {import('@docusaurus/types').DocusaurusConfig} */
2+
const { stylesheets, misc } = require('@commitdev/zero-doc-site-common-elements');
3+
4+
const siteUrl = process.env.BUILD_DOMAIN ? `https://${process.env.BUILD_DOMAIN}` : 'https://staging.getzero.dev';
5+
const baseUrl = '/';
6+
const repositoryName = 'zero';
27

38
module.exports = {
49
title: 'Zero',
510
tagline: 'Opinionated infrastructure to take you from idea to production on day one',
6-
url: process.env.BUILD_DOMAIN ? `https://${process.env.BUILD_DOMAIN}` : 'https://staging.getzero.dev',
7-
baseUrl: '/',
8-
onBrokenLinks: 'warn',
9-
onBrokenMarkdownLinks: 'warn',
10-
favicon: 'img/favicon.ico',
11-
organizationName: 'commitdev',
12-
projectName: 'zero',
11+
url: siteUrl,
12+
baseUrl,
13+
...misc(),
14+
projectName: repositoryName,
1315
themeConfig: {
1416

1517
colorMode: {
@@ -77,8 +79,7 @@ module.exports = {
7779
path: 'docs',
7880
routeBasePath: 'docs/zero/',
7981
include: ['**/*.md', '**/*.mdx'],
80-
// editUrl: 'https://github.com/commitdev/zero/blob/main/doc-site/',
81-
editUrl: 'https://github.com/commitdev/zero/blob/doc-site/doc-site/',
82+
editUrl: 'https://github.com/commitdev/zero/blob/main/doc-site/',
8283
},
8384
theme: {
8485
customCss: require.resolve('./src/css/custom.css'),
@@ -90,7 +91,5 @@ module.exports = {
9091
plugins: [
9192
'docusaurus-plugin-sass'
9293
],
93-
stylesheets: [
94-
"https://fonts.googleapis.com/css2?family=Lato:wght@400;700;900&family=Montserrat:wght@400;600;700;800&display=swap",
95-
]
94+
stylesheets: stylesheets(),
9695
};

doc-site/package-lock.json

Lines changed: 5 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

doc-site/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
"write-heading-ids": "docusaurus write-heading-ids"
1515
},
1616
"dependencies": {
17+
"@commitdev/zero-doc-site-common-elements": "0.0.1",
1718
"@docusaurus/core": "2.0.0-beta.0",
1819
"@docusaurus/preset-classic": "2.0.0-beta.0",
1920
"@mdx-js/react": "^1.6.21",

doc-site/sidebars.js

Lines changed: 2 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
const config = require('./docusaurus.config');
2+
const { sidebarsNavModules } = require('@commitdev/zero-doc-site-common-elements');
23

34
module.exports = {
45
zero: [
@@ -20,38 +21,7 @@ module.exports = {
2021
dirName: 'concepts',
2122
}],
2223
},
23-
{
24-
type: 'category',
25-
label: 'Modules',
26-
collapsed: false,
27-
items: [
28-
{
29-
type: 'link',
30-
label: 'Zero Core',
31-
href: `${config.url}/docs/zero`,
32-
},
33-
{
34-
type: 'link',
35-
label: 'AWS EKS stack',
36-
href: `${config.url}/docs/modules/aws-eks-stack`,
37-
},
38-
{
39-
type: 'link',
40-
label: 'Frontend',
41-
href: `${config.url}/docs/modules/frontend-react`,
42-
},
43-
{
44-
type: 'link',
45-
label: 'Backend - Go',
46-
href: `${config.url}/docs/modules/backend-go`,
47-
},
48-
{
49-
type: 'link',
50-
label: 'Backend - Node.js',
51-
href: `${config.url}/docs/modules/backend-nodejs`,
52-
}
53-
]
54-
}
24+
sidebarsNavModules(config),
5525
]
5626
}
5727

0 commit comments

Comments
 (0)