Lighthouse website uses Vue Press. A minimalistic Vue powered static site generator. VuePress follows the principle of "convention is better than configuration".
# nuwave/lighthouse repository root
docs/
├── .vuepress/
│ ├── config.js # global site config
│ └── versions.json # auto-generated versions file
│
├── master/
│ ├── guides/
│ │ └── auth.md # http://mysite.com/master/guides/auth.html
│ ├── the-basics/
│ │ └── fields.md # http://mysite.com/master/the-basics/fields.html
│ │
│ └── sidebar.js # versioned sidebar for this version
│
├── 2.6/
│ └── ... # same structure from "docs/master/"
│
├── pages/
│ └── ... # Not versioned, it remains the same for all docs versions
│
├── package.json # vuepress dependencies
└── INDEX.md # the beauty home page
Make sure you have:
- Node 8+
- Yarn
Then, start Vue Press on development mode (with hot reloading).
cd docs/
yarn install
yarn docs:dev
Keep a eye on console when editing pages. If code can not be compiled for some reason, stop it and start it again Vue Press. Otherwise hot reloading system will hang up.
- Place the new file into correspondent version folder.
- Include the reference for the new file into correspondent
sidebar.js
, according version number.
# the new file
docs/3.1/guides/cruds.md
# edit the correspondent sidebar
docs/3.1/sidebar.js
- Remember to include the
.md
extension. - Always use relative paths according to folder structure.
The [@paginate](directives.md#paginate) directive is great!
See the [Tutorial](../getting-started/tutorial.md) for more info.
Each subfolder in docs/
will represent a documentation version, except docs/pages/
that will remain the same for all docs versions.
Path | Web route |
---|---|
docs/master/guides/installation.md |
http://mysite.com/master/guides/installation.html |
docs/2.6/guides/installation.md |
http://mysite.com/2.6/guides/installation.html |
docs/pages/users.md |
http://mysite.com/pages/users.html |
You can update multiples docs versions at the same time. Because each docs/
subfolder represents specifics routes when published.
- Edit any file.
- Commit and push changes.
- It will be published to the correspondent version.
Example: When you change any file from docs/2.6/
, it will publish changes only for 2.6
docs version.
-
First, finsh your work on
docs/master
. A version always should be based from master. -
Enter a new version number
yarn docs:version 3.1
-
Commit and push.
-
It will be published as the last documentation version.
When tagging a new version, the document versioning mechanism will:
- Copy full
docs/master/
folder contents into a newdocs/<version>/
folder. - Place a new version number in
docs/.vuepress/versions.json