feat(v2): landing page for classic template (#1517)

* Add missing fields in docusaurus.config.js

* Landing page for classic template + highlight section

* cleanup

* Use CSS modules for landing page of classic template

* Baby responsive design for landing page in classic template

* Update tagline for classic template

* Add style guide for classic template

* Roadmap section on landing page of classic template

* feat: Light / dark mode for classic theme

* Use themed color for features section in classic template

* Clean up header section

* Add GitHub start button

* Remove temporary responsive styling for navbar

* Revert "feat: Light / dark mode for classic theme"

This reverts commit b0d515dcf1.

* Rename stylesheets and variables

* Use variable name `classnames` for the package

* Remove animation for the dino 🦖

* Kill data.js

- Kill features section for now too
This commit is contained in:
Wei Gao 2019-05-29 16:17:00 +08:00 committed by Yangshun Tay
parent 404983c32b
commit 517dbc500d
8 changed files with 8241 additions and 44 deletions

View file

@ -0,0 +1,160 @@
---
id: style-guide
title: Style Guide
sidebar_label: Style Guide
---
# Markdown Style Guide
To serve as an example page when styling markdown based Docusaurus sites.
## Headers
# Create the best documentation
## Create the best documentation
### Create the best documentation
#### Create the best documentation
##### Create the best documentation
###### Create the best documentation
---
## Emphasis
Emphasis, aka italics, with _asterisks_ or _underscores_.
Strong emphasis, aka bold, with **asterisks** or **underscores**.
Combined emphasis with **asterisks and _underscores_**.
Strikethrough uses two tildes. ~~Scratch this.~~
---
## Lists
1. First ordered list item
2. Another item ⋅⋅\* Unordered sub-list.
3. Actual numbers don't matter, just that it's a number ⋅⋅1. Ordered sub-list
4. And another item.
⋅⋅⋅You can have properly indented paragraphs within list items. Notice the blank line above, and the leading spaces (at least one, but we'll use three here to also align the raw Markdown).
⋅⋅⋅To have a line break without a paragraph, you will need to use two trailing spaces.⋅⋅ ⋅⋅⋅Note that this line is separate, but within the same paragraph.⋅⋅ ⋅⋅⋅(This is contrary to the typical GFM line break behaviour, where trailing spaces are not required.)
- Unordered list can use asterisks
* Or minuses
- Or pluses
---
## Links
[I'm an inline-style link](https://www.google.com)
[I'm an inline-style link with title](https://www.google.com "Google's Homepage")
[I'm a reference-style link][arbitrary case-insensitive reference text]
[I'm a relative reference to a repository file](../blob/master/LICENSE)
[You can use numbers for reference-style link definitions][1]
Or leave it empty and use the [link text itself].
URLs and URLs in angle brackets will automatically get turned into links. http://www.example.com or <http://www.example.com> and sometimes example.com (but not on Github, for example).
Some text to show that the reference links can follow later.
[arbitrary case-insensitive reference text]: https://www.mozilla.org
[1]: http://slashdot.org
[link text itself]: http://www.reddit.com
---
## Images
Here's our logo (hover to see the title text):
Inline-style: ![alt text](https://github.com/adam-p/markdown-here/raw/master/src/common/images/icon48.png 'Logo Title Text 1')
Reference-style: ![alt text][logo]
[logo]: https://github.com/adam-p/markdown-here/raw/master/src/common/images/icon48.png 'Logo Title Text 2'
---
## Code
```javascript
var s = 'JavaScript syntax highlighting';
alert(s);
```
```python
s = "Python syntax highlighting"
print s
```
```
No language indicated, so no syntax highlighting.
But let's throw in a <b>tag</b>.
```
---
## Tables
Colons can be used to align columns.
| Tables | Are | Cool |
| ------------- | :-----------: | -----: |
| col 3 is | right-aligned | \$1600 |
| col 2 is | centered | \$12 |
| zebra stripes | are neat | \$1 |
There must be at least 3 dashes separating each header cell. The outer pipes (|) are optional, and you don't need to make the raw Markdown line up prettily. You can also use inline Markdown.
| Markdown | Less | Pretty |
| -------- | --------- | ---------- |
| _Still_ | `renders` | **nicely** |
| 1 | 2 | 3 |
---
## Blockquotes
> Blockquotes are very handy in email to emulate reply text. This line is part of the same quote.
Quote break.
> This is a very long line that will still be quoted properly when it wraps. Oh boy let's keep writing to make sure this is long enough to actually wrap for everyone. Oh, you can _put_ **Markdown** into a blockquote.
---
## Inline HTML
<dl>
<dt>Definition list</dt>
<dd>Is something people use sometimes.</dd>
<dt>Markdown in HTML</dt>
<dd>Does *not* work **very** well. Use HTML <em>tags</em>.</dd>
</dl>
---
## Line Breaks
Here's a line for us to start with.
This line is separated from the one above by two newlines, so it will be a _separate paragraph_.
This line is also a separate paragraph, but... This line is only separated by a single newline, so it's a separate line in the _same paragraph_.

View file

@ -7,7 +7,7 @@
module.exports = {
title: 'My site',
tagline: 'A website for testing',
tagline: 'The tagline of my site',
url: 'https://your-docusaurus-test-site.com',
baseUrl: '/',
favicon: 'img/favicon.ico',

View file

@ -12,6 +12,7 @@
"dependencies": {
"@docusaurus/core": "^2.0.0-alpha.16",
"@docusaurus/preset-classic": "^2.0.0-alpha.16",
"classnames": "^2.2.6",
"react": "^16.8.4",
"react-dom": "^16.8.4"
}

View file

@ -1,30 +0,0 @@
/* TODO: remove this css because it's only temporary until we revamp index.js */
.App {
text-align: center;
margin-bottom: 2rem;
}
.App-logo {
animation: App-logo-spin infinite 20s linear;
height: 40vmin;
pointer-events: none;
}
.App-header {
min-height: 50vh;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
font-size: calc(10px + 2vmin);
color: black;
}
@keyframes App-logo-spin {
from {
transform: rotate(0deg);
}
to {
transform: rotate(360deg);
}
}

View file

@ -6,26 +6,91 @@
*/
import React from 'react';
import classnames from 'classnames';
import Layout from '@theme/Layout';
import useDocusaurusContext from '@docusaurus/useDocusaurusContext';
import withBaseUrl from '@docusaurus/withBaseUrl';
import './index.css';
import styles from './styles.module.css';
const highlights = [
{
title: 'Focus on your docs',
imageUrl: 'http://docusaurus-2.netlify.com/img/undraw_typewriter.svg',
description:
"Docusaurus lets you focus on your docs, and we'll do the chores. Now go ahead and dump all your docs into the docs directory.",
},
{
title: 'Supports versioned docs',
imageUrl: 'http://docusaurus-2.netlify.com/img/undraw_version_control.svg',
description:
'Support users on all versions of your project. Document versioning helps you keep documentation in sync with project releases.',
},
{
title: 'Supports i18n',
imageUrl: 'http://docusaurus-2.netlify.com/img/undraw_around_the_world.svg',
description:
'Localization comes pre-configured. Use Crowdin to translate your docs into over 70 languages.',
},
];
/* Note that this is only temporary. TODO: better welcome screen */
function Home() {
const context = useDocusaurusContext();
const {siteConfig = {}} = context;
return (
<Layout title="Hello">
<div className="App">
<header className="App-header">
<Layout
/** this title will overwrite the one in config */
title={`Hello from ${siteConfig.title}`}
description="Description will go into a meta tag in <head />">
<header className={classnames('hero hero--dark', styles.header)}>
<div className="container">
<h1 className="hero__title">{siteConfig.title}</h1>
<p className="hero__subtitle">{siteConfig.tagline}</p>
<div className={styles.buttons}>
<button
type="button"
className={classnames(
'button button--outline button--primary button--lg',
styles.getStarted,
)}>
Get Started
</button>
<iframe
src="https://ghbtns.com/github-btn.html?user=facebook&amp;repo=docusaurus&amp;type=star&amp;count=true&amp;size=large"
frameBorder={0}
scrolling={0}
width={160}
height={30}
title="GitHub Stars"
/>
</div>
<img
src={withBaseUrl('img/logo.svg')}
className="App-logo"
className={styles.logo}
alt="logo"
/>
<p>
Edit <code>pages/index.js</code> and save to reload.
</p>
</header>
</div>
</div>
</header>
<main>
{highlights && highlights.length && (
<section className={styles.highlights}>
<div className="container">
<div className="row">
{highlights.map(({imageUrl, title, description}, idx) => (
<div
key={`landing-page-highlight-${idx}`}
className={classnames(styles.col4, styles.highlight)}>
<img src={imageUrl} alt={title} />
<h3>{title}</h3>
<p>{description}</p>
</div>
))}
</div>
</div>
</section>
)}
</main>
</Layout>
);
}

View file

@ -0,0 +1,103 @@
:root {
--first-screen-main-section-height: calc((100vh - 60px - 60px) * .6);
--first-screen-secondary-section-height: calc((100vh - 60px - 60px) * .4);
}
.header {
color: white;
padding: 1rem 0;
text-align: center;
position: relative;
overflow: hidden;
}
.buttons {
display: flex;
align-items: center;
justify-content: center;
}
.buttons iframe {
margin-left: 1rem;
}
.logo {
position: absolute;
bottom: -80px;
left: 20px;
}
@media screen and (min-height: 900px) {
.buttons {
margin-top: 2rem;
}
}
@media screen and (max-width: 400px) {
.header {
/* display mainly the header section */
height: calc(100vh - 120px);
}
}
@media screen and (max-width: 799px) {
.header {
/* display just one feature */
height: calc(100vh - 310px);
}
}
@media screen and (min-width: 800px) {
.header {
padding: 4rem 0;
height: var(--first-screen-main-section-height);
}
}
/**
* Highlights
* - secondary section on the first screen
* - leaving a space equal to footer to indicate more content
*/
.highlights {
background: var(--ifm-color-black-alpha-10);
display: flex;
align-items: center;
width: 100%;
}
.highlight {
text-align: center;
}
.highlight img {
height: 200px;
width: 200px;
}
.highlight p {
text-align: left;
}
/* TODO: move all of .col4 to infima .col--4 */
.col4 {
padding-left: calc(var(--ifm-spacing-horizontal) / 2);
padding-right: calc(var(--ifm-spacing-horizontal) / 2);
min-width: calc(800px / 3 - var(--ifm-spacing-horizontal));
}
@media screen and (max-width: 519px /* smaller than 2 * min width */) {
.col4 {
width: 100%;
}
}
@media screen and (min-width: 520px) and (max-width: 799px) {
.highlights {
padding-bottom: 2rem;
}
.col4:first-child {
width: 100%;
}
.col4:not(:first-child) {
width: calc(50% - var(--ifm-spacing-horizontal) / 2);
}
}
@media screen and (min-width: 800px) {
.col4 {
width: calc(100% / 3 - var(--ifm-spacing-horizontal));
}
.highlights {
height: var(--first-screen-secondary-section-height);
}
}

View file

@ -1,8 +1,7 @@
{
"docs": {
"Docusaurus": ["doc1"],
"First Category": ["doc2"],
"Second Category": ["doc3"]
"Docusaurus": ["doc1", "doc2", "doc3"],
"Utilities": ["style-guide"]
},
"docs-other": {
"First Category": ["doc4", "doc5"]

File diff suppressed because it is too large Load diff