Skip to content

Commit 7839f95

Browse files
author
爱吃抹茶不吃茶
committed
feat: 修改侧边栏结构,优化镜像构建脚本
- 新增docker快速打包脚本 - 主题内容优化
1 parent c564f9f commit 7839f95

File tree

9 files changed

+245
-269
lines changed

9 files changed

+245
-269
lines changed

Dockerfile

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
1+
#
2+
# - 功能: 构建JavaScriptCollection镜像
3+
# - 用法: docker build -f Dockerfile --build-arg APP_VERSION=0.0.1 -t JavaScriptCollection-0.0.1 .
4+
#
15
## 注意:vite构建需要支持node14以上,安装node16较为稳妥
26
FROM registry.cn-hangzhou.aliyuncs.com/142vip/node:16.12.0-alpine AS build_base
3-
LABEL version="Beta1.0" description="JavaScriptCollection文档合集、博客"
4-
LABEL author="【Github&公众号】:Rong姐姐好可爱" email="fairy@2925.com"
7+
58
RUN mkdir -p /apps
69
## 确定工作空间 /apps
710
WORKDIR /apps
@@ -10,14 +13,10 @@ COPY . .
1013
## 安装依赖
1114
RUN npm i pnpm@6 -g && pnpm i -D && pnpm build
1215

13-
# 设置部署镜像
1416
FROM registry.cn-hangzhou.aliyuncs.com/142vip/nginx:1.23.0-alpine
15-
17+
ARG APP_VERSION
18+
LABEL version=$APP_VERSION description="JavaScriptCollection文档合集、博客"
19+
LABEL author="【Github&公众号】:Rong姐姐好可爱" email="fairy@2925.com"
1620
# 将dist文件中的内容复制到 /usr/share/nginx/html/ 这个目录下面 注意:--from参数
1721
COPY --from=build_base /apps/docs/.vuepress/dist/ /usr/share/nginx/html/
18-
## 配置文件
1922
COPY nginx.conf /etc/nginx/
20-
21-
## 采用默认80端口
22-
#EXPOSE 7100
23-
#CMD ["nginx", "-g", "daemon off;"]

Faster.Dockerfile

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
#
2+
# - 功能: 快速构建JavaScriptCollection镜像
3+
# - 用法: docker build -f Faster.Dockerfile --build-arg APP_VERSION=0.0.1 -t JavaScriptCollection-0.0.1 .
4+
#
5+
6+
FROM registry.cn-hangzhou.aliyuncs.com/142vip/nginx:1.23.0-alpine
7+
ARG APP_VERSION
8+
LABEL version=$APP_VERSION description="JavaScriptCollection文档合集、博客"
9+
LABEL author="【Github&公众号】:Rong姐姐好可爱" email="fairy_vip@2925.com"
10+
11+
# 将dist文件中的内容复制到 /usr/share/nginx/html/
12+
COPY ./docs/.vuepress/dist/ /usr/share/nginx/html/
13+
COPY nginx.conf /etc/nginx/
14+

docs/.vuepress/config/theme.config.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ export default hopeTheme({
5252
// 设置页脚
5353
displayFooter:true,
5454
footer:FOOTER_HTML_INFO,
55+
copyright:false,
5556

5657
// 主题色选择器
5758
themeColor: {
@@ -62,7 +63,7 @@ export default hopeTheme({
6263
},
6364

6465
plugins: {
65-
copyright:true,
66+
copyright:false,
6667
// 开启博客功能
6768
blog:true,
6869
// 代码块

docs/README.md

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,8 @@
11
---
22
home: true
3-
heroHeight: 200
43
heroAlt: 屈身守份 以待天时
54
heroText: JavaScriptCollection
65
tagline: 理论+实战模式下的硬核全栈学习合集,内容持续更新...
7-
8-
96
actions:
107
- text: 快速开始 →
118
link: /quick-start/
@@ -34,7 +31,7 @@ features:
3431

3532
---
3633

37-
<BiliBili bvid="BV1U4411A7MM" />
34+
<BiliBili bvid="BV1rd4y1V7tB" />
3835

3936

4037
### 本地浏览【推荐】

package.json

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,17 +3,18 @@
33
"version": "0.0.1",
44
"description": "一本有趣的JavaScript合集",
55
"scripts": {
6-
"clean": "find . -name \"node_modules\" -type d -exec rm -rf '{}' +",
6+
"clean": "find . -name \"node_modules\" -type d -exec rm -rf '{}' + && rm -rf docs/.vuepress/dist",
77
"dev": "vuepress dev docs",
88
"build": "vuepress build docs",
9-
"build-image": "bash scripts/build_image.sh $npm_package_version",
9+
"image": "bash scripts/build_image.sh $npm_package_version",
10+
"faster-image": "bash scripts/build_image.sh $npm_package_version faster",
1011
"github": "bash scripts/deploy.bash github"
1112
},
1213
"devDependencies": {
13-
"vue": "^3.2.45",
14+
"@vuepress/client": "2.0.0-beta.60",
15+
"vue": "^3.2.47",
1416
"vuepress": "2.0.0-beta.60",
1517
"vuepress-plugin-search-pro": "^2.0.0-beta.172",
16-
"vuepress-theme-hope": "^2.0.0-beta.171",
17-
"@vuepress/client": "2.0.0-beta.60"
18+
"vuepress-theme-hope": "^2.0.0-beta.172"
1819
}
1920
}

0 commit comments

Comments
 (0)