如何編譯部署 UIKit 離線文檔?

如何編譯部署 UIKit 離線文檔?

Whis is UIKit?
Note:部署在 Windows 系統會出現路徑錯誤狀況,這裏採用在 Debian 系統上進行編譯和部署。node

1. 安裝一些前置工具

CurlGitNodeYarnlinux

# 更新倉庫
apt-get update

# 安裝 curl
apt-get install curl

# 安裝 git
apt-get install git

# 安裝 node
curl -sL https://deb.nodesource.com/setup_10.x | bash -
apt-get install -y nodejs

# 安裝 yarn
curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | apt-key add -
echo "deb https://dl.yarnpkg.com/debian/ stable main" | tee /etc/apt/sources.list.d/yarn.list
apt-get update && apt-get install yarn

2. 克隆倉庫代碼

mkdir /home/localhost
cd /home/localhost
git clone https://github.com/uikit/uikit-site.git

3. 編譯

cd uikit-site
yarn install
yarn setup

4. 部署

使用 golang 語言進行部署git

源文件 main.gogithub

package main

import (
    "fmt"
    "net/http"
)

func main() {
    fmt.Println("Zeros")
    http.Handle("/", http.FileServer(http.Dir("/home/localhost/uikit-site/")))
    http.ListenAndServe(":10086", nil)
}

使用 瀏覽器訪問 http://127.0.0.1:10086 便可.golang

Node:在 linux 部署時注意賦予文件足夠權限。windows

這裏我是把編譯完的文件複製到 windows 進行部署的,須要複製 uikit-site/node_modules/uikit/dist 文件夾至 uikit-site/assets/uikit 目錄。使用 linux 不須要該操做瀏覽器

相關文章
相關標籤/搜索