VuePress 是静态站点生成框架之一,界面简介优雅,本文记录使用方法。
vuepressnpm install -g vuepress
# 或
yarn global add vuepresscellink-docs 文件夹mkdir cellink-docs npm init -yhello world!VueDemo
├─── docs
│ ├── README.md
│ └── .vuepress
│ ├── public
│ └── config.js
└── package.jsonvue-template-compiler 模块npm install vue-template-compilermodule.exports = {
locales: {
// 键名是该语言所属的子路径
// 作为特例,默认语言可以使用 '/' 作为其路径。
'/': {
lang: 'zh-CN', // 将会被设置为 <html> 的 lang 属性
title: 'Cellink 用户手册',
description: '一款可视化代码流程管理框架',
},
},
title: 'Cellink',
base: '/cellink-docs/',
head: [
['link', { rel: 'icon', href: '/imgs/icon.png' }],
['meta', { name: 'keywords', content: 'cellink,可视化,流程管理,cellink文档,用户文档'}]
],
themeConfig: {
locales: {
'/': {
// 多语言下拉菜单的标题
selectText: 'Languages',
// 该语言在下拉菜单中的标签
label: '🇨🇳 简体中文',
// 编辑链接文字
editLinkText: '帮助我们完善文档',
// 最后更新的描述
lastUpdated: '文档更新于',
// Service Worker 的配置
serviceWorker: {
updatePopup: {
message: '发现新内容可用.',
buttonText: '刷新',
},
},
nav: [
{ text: '开始使用', link: '/start/' },
{ text: '配置指南', link: '/guide/' },
{ text: '进阶用法', link: '/advance/' },
{ text: 'Cellink 实践', link: '/practice/' },
{ text: 'GitHub', link: 'https://github.com/viibridges/cellink' },
],
},
},
sidebar: 'auto',
// 假如你的文档仓库和项目本身不在一个仓库:
docsRepo: 'zywvvd/cellink-docs',
// 假如文档不是放在仓库的根目录下:
docsDir: 'docs',
// 假如文档放在一个特定的分支下:
docsBranch: 'source',
// 默认是 false, 设置为 true 来启用
editLinks: true,
}
};npm run dev
link 我们分别创建文件夹和对应的 markdown 文件│ package.json
│ README.md
│
└─docs
│ README.md
├─.vuepress
│ │ config.js
│ └─public
├─advance
│ README.md
├─guide
│ README.md
├─practice
│ README.md
└─start
README.md│ package.json
│ README.md
│
└─docs
│ README.md
├─.vuepress
│ │ config.js
│ ├─public
│ │ │ .nojekyll
│ │ │
│ │ └─imgs
│ │ adc-graph.png
│ │ bearing-graph.png
│ │ demo-graph.png
│ │ icon.png
│ │ node-types.png
│ │ nozzle-graph.png
│ │ quantum-graph.png
│ └───────── slogan.png
├─advance
│ README.md
├─guide
│ README.md
├─practice
│ README.md
└─start
README.md如果需要在 github 仓库中引用该图像,在前面加入仓库名称

npm run build