Skip to content

Commit

Permalink
feat(docs-site): setup docusaurus site (#57)
Browse files Browse the repository at this point in the history
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
  • Loading branch information
AgentEnder authored May 23, 2021
1 parent cf7a0ff commit a268c70
Show file tree
Hide file tree
Showing 48 changed files with 6,551 additions and 243 deletions.
7 changes: 4 additions & 3 deletions .commitlintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,15 @@
1,
"always",
[
"repo",
"dotnet",
"core",
"utils",
"typescript",
"nxdoc",
"docs-site",
"ci",
"release",
"nxdoc"
"repo",
"release"
]
],
"type-enum": [1, "always", ["test", "docs", "chore", "feat", "fix"]]
Expand Down
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -38,3 +38,7 @@ testem.log
# System Files
.DS_Store
Thumbs.db

# Generated Docusaurus files
.docusaurus/
.cache-loader/
1 change: 1 addition & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@

/dist
/coverage
.docusaurus/
1 change: 1 addition & 0 deletions .releaserc.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ module.exports = {
publishCmd: [
'npx ts-node tools/scripts/publish-all ${nextRelease.version} ${nextRelease.channel}',
].join(' && '),
successCmd: "nx deploy docs-site"
},
],
[
Expand Down
3 changes: 3 additions & 0 deletions apps/docs-site/babel.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
module.exports = {
presets: [require.resolve('@docusaurus/core/lib/babel/preset')],
};
105 changes: 105 additions & 0 deletions apps/docs-site/docusaurus.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,105 @@
module.exports = {
title: 'nx-dotnet',
tagline: 'The tagline of my site',
url: 'https://nx-dotnet.github.io',
baseUrl: '/nx-dotnet/',
onBrokenLinks: 'throw',
onBrokenMarkdownLinks: 'warn',
favicon: 'img/favicon.ico',
organizationName: 'nx-dotnet', // Usually your GitHub org/user name.
projectName: 'nx-dotnet', // Usually your repo name.
themeConfig: {
navbar: {
title: 'nx-dotnet',
// logo: {
// alt: 'nx-dotnet logo',
// src: 'img/nx-dotnet-logo.png',
// },
items: [
{
to: 'docs/',
activeBasePath: 'docs',
label: 'Docs',
position: 'left',
},
// { to: 'blog', label: 'Blog', position: 'left' },
{
href: 'https://github.com/nx-dotnet/nx-dotnet',
label: 'GitHub',
position: 'right',
},
],
},
footer: {
style: 'dark',
links: [
{
title: 'Docs',
items: [
{
label: '@nx-dotnet/core',
to: 'docs/core',
},
{
label: '@nx-dotnet/nxdoc',
to: 'docs/nxdoc/',
},
],
},
{
title: 'Community',
items: [
{
label: 'Stack Overflow',
href: 'https://stackoverflow.com/questions/tagged/nxdoc',
},
{
label: 'Gitter',
href: 'https://gitter.im/nx-dotnet-plugin/community',
},
// {
// label: 'Twitter',
// href: 'https://twitter.com/docusaurus',
// },
],
},
{
title: 'More',
items: [
// {
// label: 'Blog',
// to: 'blog',
// },
{
label: 'GitHub',
href: 'https://github.com/nx-dotnet/nx-dotnet',
},
],
},
],
copyright: `Copyright © ${new Date().getFullYear()} My Project, Inc. Built with Docusaurus.`,
},
},
presets: [
[
'@docusaurus/preset-classic',
{
docs: {
sidebarPath: require.resolve('./sidebars.js'),
// Please change this to your repo.
editUrl: 'https://github.com/nx-dotnet/nx-dotnet/edit/master/docs/',
path: '../../docs',
},
blog: {
showReadingTime: true,
// Please change this to your repo.
editUrl:
'https://github.com/nx-dotnet/nx-dotnet/edit/master/apps/docs-site/blog/',
},
theme: {
customCss: require.resolve('./src/css/custom.css'),
},
},
],
],
};
8 changes: 8 additions & 0 deletions apps/docs-site/sidebars.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
module.exports = {
someSidebar: [
{
type: 'autogenerated',
dirName: '.',
},
],
};
25 changes: 25 additions & 0 deletions apps/docs-site/src/css/custom.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
/* stylelint-disable docusaurus/copyright-header */
/**
* Any CSS included here will be global. The classic template
* bundles Infima by default. Infima is a CSS framework designed to
* work well for content-centric websites.
*/

/* You can override the default Infima variables here. */
:root {
--ifm-color-primary: #25c2a0;
--ifm-color-primary-dark: rgb(33, 175, 144);
--ifm-color-primary-darker: rgb(31, 165, 136);
--ifm-color-primary-darkest: rgb(26, 136, 112);
--ifm-color-primary-light: rgb(70, 203, 174);
--ifm-color-primary-lighter: rgb(102, 212, 189);
--ifm-color-primary-lightest: rgb(146, 224, 208);
--ifm-code-font-size: 95%;
}

.docusaurus-highlight-code-line {
background-color: rgb(72, 77, 91);
display: block;
margin: 0 calc(-1 * var(--ifm-pre-padding));
padding: 0 var(--ifm-pre-padding);
}
99 changes: 99 additions & 0 deletions apps/docs-site/src/pages/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,99 @@
import React from 'react';
import clsx from 'clsx';
import Layout from '@theme/Layout';
import Link from '@docusaurus/Link';
import useDocusaurusContext from '@docusaurus/useDocusaurusContext';
import useBaseUrl from '@docusaurus/useBaseUrl';
import styles from './styles.module.css';

const features = [
{
title: 'Easy to Use',
imageUrl: 'img/undraw_docusaurus_mountain.svg',
description: (
<>
Docusaurus was designed from the ground up to be easily installed and
used to get your website up and running quickly.
</>
),
},
{
title: 'Focus on What Matters',
imageUrl: 'img/undraw_docusaurus_tree.svg',
description: (
<>
Docusaurus lets you focus on your docs, and we&apos;ll do the chores. Go
ahead and move your docs into the <code>docs</code> directory.
</>
),
},
{
title: 'Powered by React',
imageUrl: 'img/undraw_docusaurus_react.svg',
description: (
<>
Extend or customize your website layout by reusing React. Docusaurus can
be extended while reusing the same header and footer.
</>
),
},
];

function Feature({ imageUrl, title, description }) {
const imgUrl = useBaseUrl(imageUrl);
return (
<div className={clsx('col col--4', styles.feature)}>
{imgUrl && (
<div className="text--center">
<img className={styles.featureImage} src={imgUrl} alt={title} />
</div>
)}
<h3>{title}</h3>
<p>{description}</p>
</div>
);
}

function Home() {
const context = useDocusaurusContext();
const { siteConfig = {} } = context;
return (
<Layout
title={`Hello from ${siteConfig.title}`}
description="Description will go into a meta tag in <head />"
>
<header className={clsx('hero hero--primary', styles.heroBanner)}>
<div className="container">
<h1 className="hero__title">{siteConfig.title}</h1>
<p className="hero__subtitle">{siteConfig.tagline}</p>
<div className={styles.buttons}>
<Link
className={clsx(
'button button--outline button--secondary button--lg',
styles.getStarted,
)}
to={useBaseUrl('docs/')}
>
Get Started
</Link>
</div>
</div>
</header>
<main>
{features && features.length > 0 && (
<section className={styles.features}>
<div className="container">
<div className="row">
{features.map((props, idx) => (
<Feature key={idx} {...props} />
))}
</div>
</div>
</section>
)}
</main>
</Layout>
);
}

export default Home;
36 changes: 36 additions & 0 deletions apps/docs-site/src/pages/styles.module.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
/* stylelint-disable docusaurus/copyright-header */
/**
* CSS files with the .module.css suffix will be treated as CSS modules
* and scoped locally.
*/

.heroBanner {
padding: 4rem 0;
text-align: center;
position: relative;
overflow: hidden;
}

@media screen and (max-width: 966px) {
.heroBanner {
padding: 2rem;
}
}

.buttons {
display: flex;
align-items: center;
justify-content: center;
}

.features {
display: flex;
align-items: center;
padding: 2rem 0;
width: 100%;
}

.featureImage {
height: 200px;
width: 200px;
}
Binary file added apps/docs-site/static/img/favicon.ico
Binary file not shown.
Binary file added apps/docs-site/static/img/nx-dotnet-logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit a268c70

Please sign in to comment.