xuos-web/README.md

85 lines
1.5 KiB
Markdown
Executable File
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# XiUOS
> X IIoT Ubuquitous Operating System
## Development
XiUOS 网站开发
假定工作于Ubuntu环境.
XiUOS网站基于[VuePress](https://vuepress.vuejs.org), 故应先通过 *yarn* 安装 *vuepress* .
### 安装 yarn
首先
```bash
curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | sudo apt-key add -
echo "deb https://dl.yarnpkg.com/debian/ stable main" | sudo tee /etc/apt/sources.list.d/yarn.list
```
然后
```bash
sudo apt update && sudo apt install yarn
```
具体参见[这里](https://classic.yarnpkg.com/en/docs/install/#debian-stable)
### 安装vuepress
安装vuepress需要依赖v10.x以上的node.js在命令行输入以下命令以查看node.js版本
```
nodejs -v
```
如果版本过低导致安装失败输入以下命令安装新版的node.js其中版本号14可以根据node.js官网的最新版本更改
```
curl -sL https://deb.nodesource.com/setup_14.x | sudo -E bash -
sudo apt-get install -y nodejs
```
可以为所有项目安装全局的唯一 vuepress
```bash
yarn global add vuepress
```
也可以在vuepress 项目根目录下安装每个项目各自的vuepress
```bash
yarn add -D vuepress
```
### 下载网站源码
```bash
git clone https://git.trustie.net/xuos/xuos-web.git
```
如果没有全局vuepress, 需要安装
```bash
cd xuos-web
yarn add -D vuepress
```
测试
```bash
yarn dev
```
会在终端启动 web server, 浏览器中访问 http://localhost:8080, 可观察网站效果
运行
```bash
yarn build
```
可在 docs/.vuepress/dist 中生成编译后的html页面