-
-
Notifications
You must be signed in to change notification settings - Fork 8.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(v2): bootstrap bootstrap (heh) theme, preset, template (#2557)
* feat(v2): Add bootstrap theme structure * chore(v2): run prettier * chore(v2): remove unused dependencies * feat(v2): add bootstrap preset * feat(v2): add bootstrap template * remove unnecessary stuff * -- Co-authored-by: Yangshun Tay <[email protected]>
- Loading branch information
Showing
19 changed files
with
729 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
# Dependencies | ||
/node_modules | ||
|
||
# Production | ||
/build | ||
|
||
# Generated files | ||
.docusaurus | ||
.cache-loader | ||
|
||
# Misc | ||
.DS_Store | ||
.env.local | ||
.env.development.local | ||
.env.test.local | ||
.env.production.local | ||
|
||
npm-debug.log* | ||
yarn-debug.log* | ||
yarn-error.log* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
# Website | ||
|
||
This website is built using [Docusaurus 2](https://v2.docusaurus.io/), a modern static website generator. | ||
|
||
### Installation | ||
|
||
``` | ||
$ yarn | ||
``` | ||
|
||
### Local Development | ||
|
||
``` | ||
$ yarn start | ||
``` | ||
|
||
This command starts a local development server and open up a browser window. Most changes are reflected live without having to restart the server. | ||
|
||
### Build | ||
|
||
``` | ||
$ yarn build | ||
``` | ||
|
||
This command generates static content into the `build` directory and can be served using any static contents hosting service. | ||
|
||
### Deployment | ||
|
||
``` | ||
$ GIT_USER=<Your GitHub username> USE_SSH=true yarn deploy | ||
``` | ||
|
||
If you are using GitHub pages for hosting, this command is a convenient way to build the website and push to the `gh-pages` branch. |
58 changes: 58 additions & 0 deletions
58
packages/docusaurus-init/templates/bootstrap/docusaurus.config.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
module.exports = { | ||
title: 'My Site', | ||
tagline: 'The tagline of my site', | ||
url: 'https://your-docusaurus-test-site.com', | ||
baseUrl: '/', | ||
favicon: 'img/favicon.ico', | ||
organizationName: 'facebook', // Usually your GitHub org/user name. | ||
projectName: 'docusaurus', // Usually your repo name. | ||
themeConfig: { | ||
navbar: { | ||
title: 'My Site', | ||
logo: { | ||
alt: 'My Site Logo', | ||
src: 'img/logo.svg', | ||
}, | ||
links: [ | ||
{ | ||
href: 'https://github.com/facebook/docusaurus', | ||
label: 'GitHub', | ||
position: 'right', | ||
}, | ||
], | ||
}, | ||
footer: { | ||
style: 'dark', | ||
links: [ | ||
{ | ||
title: 'Community', | ||
items: [ | ||
{ | ||
label: 'Stack Overflow', | ||
href: 'https://stackoverflow.com/questions/tagged/docusaurus', | ||
}, | ||
{ | ||
label: 'Discord', | ||
href: 'https://discordapp.com/invite/docusaurus', | ||
}, | ||
], | ||
}, | ||
{ | ||
title: 'Social', | ||
items: [ | ||
{ | ||
label: 'GitHub', | ||
href: 'https://github.com/facebook/docusaurus', | ||
}, | ||
{ | ||
label: 'Twitter', | ||
href: 'https://twitter.com/docusaurus', | ||
}, | ||
], | ||
}, | ||
], | ||
copyright: `Copyright © ${new Date().getFullYear()} My Project, Inc. Built with Docusaurus.`, | ||
}, | ||
}, | ||
presets: [['@docusaurus/preset-bootstrap', {}]], | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
{ | ||
"name": "docusaurus-2-bootstrap-template", | ||
"version": "2.0.0-alpha.50", | ||
"private": true, | ||
"scripts": { | ||
"start": "docusaurus start", | ||
"build": "docusaurus build", | ||
"swizzle": "docusaurus swizzle", | ||
"deploy": "docusaurus deploy" | ||
}, | ||
"dependencies": { | ||
"@docusaurus/core": "^2.0.0-alpha.50", | ||
"@docusaurus/preset-bootstrap": "^2.0.0-alpha.50", | ||
"classnames": "^2.2.6", | ||
"react": "^16.8.4", | ||
"react-dom": "^16.8.4" | ||
}, | ||
"browserslist": { | ||
"production": [ | ||
">0.2%", | ||
"not dead", | ||
"not op_mini all" | ||
], | ||
"development": [ | ||
"last 1 chrome version", | ||
"last 1 firefox version", | ||
"last 1 safari version" | ||
] | ||
} | ||
} |
97 changes: 97 additions & 0 deletions
97
packages/docusaurus-init/templates/bootstrap/src/pages/index.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,97 @@ | ||
import React from 'react'; | ||
import classnames from 'classnames'; | ||
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'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={classnames('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={classnames('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={classnames( | ||
'button button--outline button--secondary button--lg', | ||
styles.getStarted, | ||
)} | ||
to={useBaseUrl('docs/doc1')}> | ||
Get Started | ||
</Link> | ||
</div> | ||
</div> | ||
</header> | ||
<main> | ||
{features && features.length && ( | ||
<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
36
packages/docusaurus-init/templates/bootstrap/src/pages/styles.module.css
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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
BIN
+766 Bytes
packages/docusaurus-init/templates/bootstrap/static/img/favicon.ico
Binary file not shown.
1 change: 1 addition & 0 deletions
1
packages/docusaurus-init/templates/bootstrap/static/img/logo.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Oops, something went wrong.