Skip to content

Commit d2fe244

Browse files
committed
feat: Setup docs site
1 parent 13e45d6 commit d2fe244

File tree

4 files changed

+109
-0
lines changed

4 files changed

+109
-0
lines changed

docs/.nojekyll

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
# This was created by docify init and its purpose is to allow Jekyll to build underscore files.

docs/README.md

Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
# Docsify Template
2+
> Live demo of a light docs site built on _docsify-js_ and running on Github Pages
3+
4+
Convert your docs folder into a pretty docs website using _docsify_ and some minimal setup. This project can be used as a template or reference for your own.
5+
6+
See the [Docsify](https://docsify.js.org/) website.
7+
8+
9+
## How it works
10+
11+
Note that this works without editing your existing docs and without building any HTML page.
12+
13+
If you were using a static site generator like Jekyll, you might have to add front matter to your docs, in addition to setting Jekyll config for theme and menu layout.
14+
15+
Also, with a static site generator you would build HTML files to serve, while with docsify there is a single page application running off of a _index.html_ - on each request, a markdown file is fetched by the client and rendered as HTML with a theme and menu.
16+
17+
## Setup
18+
19+
### Overview steps
20+
21+
1. Add a few files to your existing docs folder. You can use this project's files to get you going.
22+
- **index page** - Homepage of the your docs site. This will setup the app using the _docsify_ library, set a theme and apply other configurations.
23+
- **sidebar** - Describes your menu layout. As _docsify_ is not aware of directory structure so it may not function as you hope without this file.
24+
- **cover page** - Optional landing page with background image and minimal text.
25+
2. Turn your Github repo into a Github pages site which builds from the docs directory.
26+
27+
## Setup a site
28+
29+
Since the idea is to add to an existing project, is it not that useful to create your own project from this repo. But you should copy the sample files from this project in your own project's docs directory.
30+
31+
TBC - How copy files
32+
33+
34+
### Style
35+
36+
Edit _index.html_.
37+
38+
#### Color
39+
40+
Set a theme color. Defaults to green if not set. This affects how some content looks, such as quoted blocks, underlined text and buttons.
41+
42+
```js
43+
window.$docsify = {
44+
themeColor: '#3F51B5'
45+
};
46+
```
47+
48+
More on Docsify [theme color](https://docsify.js.org/#/configuration?id=themecolor).
49+
50+
#### Themes
51+
52+
Choose a style you like.
53+
54+
Options:
55+
56+
- `vue.css`
57+
- `buble.css`
58+
- `dark.css`
59+
- `pure.css`
60+
61+
`<link rel="stylesheet" href="//unpkg.com/docsify/lib/themes/<THEME>.css">`
62+
63+
Remove `lib/` from the theme URL to get the uncompressed CSS file.
64+
65+
More on Docsify [themes](https://docsify.js.org/#/themes?id=themes) guide.
66+
67+
68+
### Docsify CLI
69+
70+
View the Docsify [Quickstart](https://docsify.js.org/#/quickstart) guide for instructions on setting up the CLI tool and running a site.
71+
72+
The CLI tool is optional and is useful for the following:
73+
- Setup an initial _README.md_ (duplicated from project root), _index.html_ and _.nojekyll_ in your a target directory such as _docs_. You can do this by hand or using a template if you don't want the CLI to do it for you.
74+
- Serve the docs site locally, with hot reload.

docs/_coverpage.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# Docsify Template <small>dev</small>
2+
> Live demo of a light docs site built on _docsify-js_ and running on Github Pages
3+
4+
[GitHub](https://github.com/michaelcurrin/docsify-template/)
5+
[Getting Started](#docsify-template)

docs/index.html

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
<!DOCTYPE html>
2+
<html lang="en">
3+
4+
<head>
5+
<meta charset="UTF-8">
6+
<title>Docsify Template</title>
7+
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
8+
<meta name="description" content="Description">
9+
<meta name="viewport"
10+
content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
11+
<link rel="stylesheet" href="//unpkg.com/docsify/lib/themes/vue.css">
12+
</head>
13+
</head>
14+
15+
<body>
16+
<div id="app"></div>
17+
<script>
18+
window.$docsify = {
19+
name: 'Docsify Template',
20+
repo: 'https://github.com/michaelcurrin/docsify-template',
21+
auto2top: true, // Helps a lot when switching between sections by menu.
22+
coverpage: true,
23+
loadSidebar: true,
24+
}
25+
</script>
26+
<script src="//unpkg.com/docsify/lib/docsify.min.js"></script>
27+
</body>
28+
29+
</html>

0 commit comments

Comments
 (0)