This is the source code for the Cosmic JS documentation site and is built with VuePress v1+.
To setup the local environment:
- Node.js v8+
- yarn (Optional, but recommended)
This will create a local web server at http://localhost:8080/docs/
if nothing is running on that port. It has hot module reloading and will detect most changes you make.*
$ yarn run dev
* Note: It is not always reliable when making low level configurations or changing the underlying architecture of VuePress, but this should not impact most users who are focused on content and UI level changes.
This will compile the package you want for deploying to production. It will create a folder in docs/.vuepress/dist
.
$ yarn build
In .vuepress/config.js
, there is a sidebar
option to configure the various top level sections.
To add icons:
- Add icon image asset (if font-icons are desired, more work is required) to the
.vuepress/public
directory which exposes the image for reference - Open the
.vuepress/config.js
file and locate thethemeConfig.sidebar
array - Add the
icon
key and the file path as the value:
module.exports = {
...,
themeConfig: {
...,
sidebar: [
{
title: 'Home',
path: '/',
// Add icon uploaded to `.vuepress/public/icons/home.svg`
icon: '/icons/home.svg'
}
]
}
}