|
@@ -1,17 +1,17 @@
|
|
|
-# sybotan-vue-doc
|
|
|
+# persagy-vue-doc
|
|
|
|
|
|
-sybotan-vue-doc 项目提供在 vuepress 文档上引入 git 源代码功能。目前只支持基于 gogs 的 git 仓库。
|
|
|
+persagy-vue-doc 项目提供在 vuepress 文档上引入 git 源代码功能。目前只支持基于 gogs 的 git 仓库。
|
|
|
|
|
|
## 安装
|
|
|
|
|
|
-修改项目文件 “package.json”。在 “dependencies” 项目下增加 "sybotan-vue-doc"依赖。
|
|
|
+修改项目文件 “package.json”。在 “dependencies” 项目下增加 "@persagy-vue-doc"依赖。
|
|
|
|
|
|
``` javascript
|
|
|
"dependencies": {
|
|
|
|
|
|
......
|
|
|
|
|
|
- "sybotan-vue-doc": "^1.1.21",
|
|
|
+ "@persagy-vue-doc": "^1.1.21",
|
|
|
|
|
|
......
|
|
|
|
|
@@ -31,16 +31,11 @@ npm install
|
|
|
|
|
|
``` javascript
|
|
|
import Vue from "vue"
|
|
|
-import SDoc from "sybotan-vue-doc"
|
|
|
-Vue.use(SDoc);
|
|
|
+import PDoc from "persagy-vue-doc"
|
|
|
+Vue.use(PDoc);
|
|
|
```
|
|
|
|
|
|
-## PCodeGit 组件
|
|
|
-PCodeGit 组件用于在文档中引入 git 代码。例如,以下代码引用 git 仓库 ”libs/sybotan-ts“ 的代码 ”/base/src/core/SObject.ts“。
|
|
|
|
|
|
-``` html
|
|
|
-<PCodeGit repos="libs/sybotan-ts" src="/base/src/core/SObject.ts" lang="javascript"></PCodeGit>
|
|
|
-```
|
|
|
|
|
|
### 属性
|
|
|
|
|
@@ -69,7 +64,7 @@ module.exports = {
|
|
|
devServer: {
|
|
|
proxy: {
|
|
|
'/gogs/': {
|
|
|
- target: 'http://git.sybotan.com',
|
|
|
+ target: 'http://39.106.8.246:3003',
|
|
|
ws: true,
|
|
|
changeOrigin: true,
|
|
|
pathRewrite: {
|
|
@@ -91,29 +86,3 @@ module.exports = {
|
|
|
* pathRewrite: 代理到目标地址后,url 的变更。该例为将 ”/gogs/“ 前缀变更为 ”/“。
|
|
|
* bypass: 在发出代理请求时执行的动作。示例中是在发出 git 源理请求时,在请求头中加入认证信息。
|
|
|
* 认证信息后的串为 git 请求的用户名与用户密码。格式为: ”<用户名>:<用户密码>“ 。例如,”gogs:123456“。经过 Base64 加密码后即为上述字符串。
|
|
|
-
|
|
|
-#### nginx 服务器配置
|
|
|
-nginx 的配置文件在 ”/etc/nginx/conf.d/“ 文件夹下。以下示例为文档放在 http://docs.sybotan.com ,gogs 仓库部署在 http://git.sybotan.com 的示例配置。
|
|
|
-
|
|
|
-```
|
|
|
-server {
|
|
|
- listen 80;
|
|
|
- server_name docs.sybotan.com;
|
|
|
-
|
|
|
- location / {
|
|
|
- root /web/docs;
|
|
|
- index index.html index.htm;
|
|
|
- }
|
|
|
- location /gogs {
|
|
|
- proxy_pass http://git.sybotan.com;
|
|
|
- proxy_set_header Authorization "Basic Z29nczoxMjM0NTY=";
|
|
|
- rewrite ^/gogs/(.*)$ /$1 break;
|
|
|
- }
|
|
|
-}
|
|
|
-```
|
|
|
-说明:
|
|
|
-* ”location /gogs“ :该段配置 nginx 的代理。关于 nginx 代理更详细信息请自行在网络上查找相关说明;
|
|
|
-* proxy_pass: 设置 "/gogs/" 前缀被转向的目标地址;
|
|
|
-* proxy_set_header:在发出代理请求时执行时在请求头中加入认证信息。
|
|
|
-* rewrite: 代理到目标地址后,url 的变更。该例为将 ”/gogs/“ 前缀变更为 ”/“。
|
|
|
-
|