Skip to content

Commit a268c70

Browse files
authored
feat(docs-site): setup docusaurus site (#57)
feat(nxdoc): show full collection:identifier syntax for builders + executors feat(docs-site): implementation of mkdocs docs site feat(docs-site): setup docusaurus publishing #53
1 parent cf7a0ff commit a268c70

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

48 files changed

+6551
-243
lines changed

.commitlintrc.json

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,15 @@
55
1,
66
"always",
77
[
8-
"repo",
98
"dotnet",
109
"core",
1110
"utils",
1211
"typescript",
12+
"nxdoc",
13+
"docs-site",
1314
"ci",
14-
"release",
15-
"nxdoc"
15+
"repo",
16+
"release"
1617
]
1718
],
1819
"type-enum": [1, "always", ["test", "docs", "chore", "feat", "fix"]]

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,3 +38,7 @@ testem.log
3838
# System Files
3939
.DS_Store
4040
Thumbs.db
41+
42+
# Generated Docusaurus files
43+
.docusaurus/
44+
.cache-loader/

.prettierignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,4 @@
22

33
/dist
44
/coverage
5+
.docusaurus/

.releaserc.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ module.exports = {
4141
publishCmd: [
4242
'npx ts-node tools/scripts/publish-all ${nextRelease.version} ${nextRelease.channel}',
4343
].join(' && '),
44+
successCmd: "nx deploy docs-site"
4445
},
4546
],
4647
[

apps/docs-site/babel.config.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
module.exports = {
2+
presets: [require.resolve('@docusaurus/core/lib/babel/preset')],
3+
};
Lines changed: 105 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,105 @@
1+
module.exports = {
2+
title: 'nx-dotnet',
3+
tagline: 'The tagline of my site',
4+
url: 'https://nx-dotnet.github.io',
5+
baseUrl: '/nx-dotnet/',
6+
onBrokenLinks: 'throw',
7+
onBrokenMarkdownLinks: 'warn',
8+
favicon: 'img/favicon.ico',
9+
organizationName: 'nx-dotnet', // Usually your GitHub org/user name.
10+
projectName: 'nx-dotnet', // Usually your repo name.
11+
themeConfig: {
12+
navbar: {
13+
title: 'nx-dotnet',
14+
// logo: {
15+
// alt: 'nx-dotnet logo',
16+
// src: 'img/nx-dotnet-logo.png',
17+
// },
18+
items: [
19+
{
20+
to: 'docs/',
21+
activeBasePath: 'docs',
22+
label: 'Docs',
23+
position: 'left',
24+
},
25+
// { to: 'blog', label: 'Blog', position: 'left' },
26+
{
27+
href: 'https://github.com/nx-dotnet/nx-dotnet',
28+
label: 'GitHub',
29+
position: 'right',
30+
},
31+
],
32+
},
33+
footer: {
34+
style: 'dark',
35+
links: [
36+
{
37+
title: 'Docs',
38+
items: [
39+
{
40+
label: '@nx-dotnet/core',
41+
to: 'docs/core',
42+
},
43+
{
44+
label: '@nx-dotnet/nxdoc',
45+
to: 'docs/nxdoc/',
46+
},
47+
],
48+
},
49+
{
50+
title: 'Community',
51+
items: [
52+
{
53+
label: 'Stack Overflow',
54+
href: 'https://stackoverflow.com/questions/tagged/nxdoc',
55+
},
56+
{
57+
label: 'Gitter',
58+
href: 'https://gitter.im/nx-dotnet-plugin/community',
59+
},
60+
// {
61+
// label: 'Twitter',
62+
// href: 'https://twitter.com/docusaurus',
63+
// },
64+
],
65+
},
66+
{
67+
title: 'More',
68+
items: [
69+
// {
70+
// label: 'Blog',
71+
// to: 'blog',
72+
// },
73+
{
74+
label: 'GitHub',
75+
href: 'https://github.com/nx-dotnet/nx-dotnet',
76+
},
77+
],
78+
},
79+
],
80+
copyright: `Copyright © ${new Date().getFullYear()} My Project, Inc. Built with Docusaurus.`,
81+
},
82+
},
83+
presets: [
84+
[
85+
'@docusaurus/preset-classic',
86+
{
87+
docs: {
88+
sidebarPath: require.resolve('./sidebars.js'),
89+
// Please change this to your repo.
90+
editUrl: 'https://github.com/nx-dotnet/nx-dotnet/edit/master/docs/',
91+
path: '../../docs',
92+
},
93+
blog: {
94+
showReadingTime: true,
95+
// Please change this to your repo.
96+
editUrl:
97+
'https://github.com/nx-dotnet/nx-dotnet/edit/master/apps/docs-site/blog/',
98+
},
99+
theme: {
100+
customCss: require.resolve('./src/css/custom.css'),
101+
},
102+
},
103+
],
104+
],
105+
};

apps/docs-site/sidebars.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
module.exports = {
2+
someSidebar: [
3+
{
4+
type: 'autogenerated',
5+
dirName: '.',
6+
},
7+
],
8+
};

apps/docs-site/src/css/custom.css

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
/* stylelint-disable docusaurus/copyright-header */
2+
/**
3+
* Any CSS included here will be global. The classic template
4+
* bundles Infima by default. Infima is a CSS framework designed to
5+
* work well for content-centric websites.
6+
*/
7+
8+
/* You can override the default Infima variables here. */
9+
:root {
10+
--ifm-color-primary: #25c2a0;
11+
--ifm-color-primary-dark: rgb(33, 175, 144);
12+
--ifm-color-primary-darker: rgb(31, 165, 136);
13+
--ifm-color-primary-darkest: rgb(26, 136, 112);
14+
--ifm-color-primary-light: rgb(70, 203, 174);
15+
--ifm-color-primary-lighter: rgb(102, 212, 189);
16+
--ifm-color-primary-lightest: rgb(146, 224, 208);
17+
--ifm-code-font-size: 95%;
18+
}
19+
20+
.docusaurus-highlight-code-line {
21+
background-color: rgb(72, 77, 91);
22+
display: block;
23+
margin: 0 calc(-1 * var(--ifm-pre-padding));
24+
padding: 0 var(--ifm-pre-padding);
25+
}

apps/docs-site/src/pages/index.js

Lines changed: 99 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,99 @@
1+
import React from 'react';
2+
import clsx from 'clsx';
3+
import Layout from '@theme/Layout';
4+
import Link from '@docusaurus/Link';
5+
import useDocusaurusContext from '@docusaurus/useDocusaurusContext';
6+
import useBaseUrl from '@docusaurus/useBaseUrl';
7+
import styles from './styles.module.css';
8+
9+
const features = [
10+
{
11+
title: 'Easy to Use',
12+
imageUrl: 'img/undraw_docusaurus_mountain.svg',
13+
description: (
14+
<>
15+
Docusaurus was designed from the ground up to be easily installed and
16+
used to get your website up and running quickly.
17+
</>
18+
),
19+
},
20+
{
21+
title: 'Focus on What Matters',
22+
imageUrl: 'img/undraw_docusaurus_tree.svg',
23+
description: (
24+
<>
25+
Docusaurus lets you focus on your docs, and we&apos;ll do the chores. Go
26+
ahead and move your docs into the <code>docs</code> directory.
27+
</>
28+
),
29+
},
30+
{
31+
title: 'Powered by React',
32+
imageUrl: 'img/undraw_docusaurus_react.svg',
33+
description: (
34+
<>
35+
Extend or customize your website layout by reusing React. Docusaurus can
36+
be extended while reusing the same header and footer.
37+
</>
38+
),
39+
},
40+
];
41+
42+
function Feature({ imageUrl, title, description }) {
43+
const imgUrl = useBaseUrl(imageUrl);
44+
return (
45+
<div className={clsx('col col--4', styles.feature)}>
46+
{imgUrl && (
47+
<div className="text--center">
48+
<img className={styles.featureImage} src={imgUrl} alt={title} />
49+
</div>
50+
)}
51+
<h3>{title}</h3>
52+
<p>{description}</p>
53+
</div>
54+
);
55+
}
56+
57+
function Home() {
58+
const context = useDocusaurusContext();
59+
const { siteConfig = {} } = context;
60+
return (
61+
<Layout
62+
title={`Hello from ${siteConfig.title}`}
63+
description="Description will go into a meta tag in <head />"
64+
>
65+
<header className={clsx('hero hero--primary', styles.heroBanner)}>
66+
<div className="container">
67+
<h1 className="hero__title">{siteConfig.title}</h1>
68+
<p className="hero__subtitle">{siteConfig.tagline}</p>
69+
<div className={styles.buttons}>
70+
<Link
71+
className={clsx(
72+
'button button--outline button--secondary button--lg',
73+
styles.getStarted,
74+
)}
75+
to={useBaseUrl('docs/')}
76+
>
77+
Get Started
78+
</Link>
79+
</div>
80+
</div>
81+
</header>
82+
<main>
83+
{features && features.length > 0 && (
84+
<section className={styles.features}>
85+
<div className="container">
86+
<div className="row">
87+
{features.map((props, idx) => (
88+
<Feature key={idx} {...props} />
89+
))}
90+
</div>
91+
</div>
92+
</section>
93+
)}
94+
</main>
95+
</Layout>
96+
);
97+
}
98+
99+
export default Home;
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
/* stylelint-disable docusaurus/copyright-header */
2+
/**
3+
* CSS files with the .module.css suffix will be treated as CSS modules
4+
* and scoped locally.
5+
*/
6+
7+
.heroBanner {
8+
padding: 4rem 0;
9+
text-align: center;
10+
position: relative;
11+
overflow: hidden;
12+
}
13+
14+
@media screen and (max-width: 966px) {
15+
.heroBanner {
16+
padding: 2rem;
17+
}
18+
}
19+
20+
.buttons {
21+
display: flex;
22+
align-items: center;
23+
justify-content: center;
24+
}
25+
26+
.features {
27+
display: flex;
28+
align-items: center;
29+
padding: 2rem 0;
30+
width: 100%;
31+
}
32+
33+
.featureImage {
34+
height: 200px;
35+
width: 200px;
36+
}

0 commit comments

Comments
 (0)