Skip to content

refactor: 升级vuepress相关版本,优化项目结构 #137

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jul 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
4 changes: 2 additions & 2 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
node_modules
docs/manuscripts
docs
.github
.idea
.dockerignore
.gitignore
.gitignore
7 changes: 4 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,11 @@ node_modules/
.npm
*.tgz
.cache
.temp
.next
.nuxt
dist
.cache/
docs/.vuepress/.cache/
docs/.vuepress/.temp/
docs/.vuepress/dist/
.vuepress/.cache/
.vuepress/.temp/
.vuepress/dist/
9 changes: 1 addition & 8 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
# APP_VERSION: 版本
# CONTAINER_BUILD: 采用容器构建
#
# 注意:vite构建需要支持node14以上,安装node16较为稳妥

FROM registry.cn-hangzhou.aliyuncs.com/142vip/node:18.18.0-alpine AS build_base

Expand All @@ -18,8 +17,6 @@ ENV PATH="$PNPM_HOME:$PATH"
WORKDIR /apps
COPY . .

RUN echo $CONTAINER_BUILD;

## 基于容器自动构建
RUN --mount=type=cache,id=pnpm,target=/pnpm/store if [ "$CONTAINER_BUILD" = "true" ]; then \
sh ./scripts/ci && pnpm build; \
Expand All @@ -38,14 +35,10 @@ ARG GIT_HASH
ARG GIT_MESSAGE
ARG HOME_PAGE

# 作者信息
# 作者信息 & 项目信息 & Git信息
LABEL "maintainer"="$AUTHOR <$EMAIL>"

# 项目信息
LABEL "repo.name"=$APP_NAME "repo.version"=$APP_VERSION \
"repo.homePage"="$HOME_PAGE" "repo.description"="$DESCRIPTION"

# Git信息
LABEL "git.hash"="$GIT_HASH" "git.message"="$GIT_MESSAGE"

# 将dist文件中的内容复制到 /usr/share/nginx/html/ 这个目录下面 注意:--from参数
Expand Down
26 changes: 0 additions & 26 deletions Jenkinsfile

This file was deleted.

2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2020 142vip.cn 储凡
Copyright (c) 2020 - present 142vip.cn 储凡

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
6 changes: 3 additions & 3 deletions code/express/apps/apis-demo/Readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

`express`模块提供了很多API方法,要了解、使用这些API去解决一些实际问题,首先需要安装:

```bash
```shell
## 安装express
npm install express --save
```
Expand Down Expand Up @@ -101,7 +101,7 @@ Express中内置的中间件功能。提供静态文件托管管理,基于`ser

@[code js](@code/express/apps/static-source-demo/app.js)

基于Express框架,关于静态文件托管,单独开了一篇做介绍,传送门:[静态资源托管](./静态文件.md)
基于Express框架,关于静态文件托管,单独开了一篇做介绍

### 路由

Expand All @@ -119,7 +119,7 @@ express.Router()创建路由器对象时也支持一些额外的参数,查看
- `mergeParams`:保留req.params父路由器的值,布尔类型。如果父级和子级的参数名称有冲突,则子级的值优先。默认false
- `strict`:是否开始严格模式路由,布尔类型。默认false,即:`/test`与`/test/`效果一样

路由器的用途还有很多,不仅支持多种请求类型的接口定义,还能分层管理,后面将单独开一篇详细讲讲,传送门:[路由的使用](./路由的使用.md)
[//]: # (路由器的用途还有很多,不仅支持多种请求类型的接口定义,还能分层管理,后面将单独开一篇详细讲讲,传送门:[路由的使用]&#40;./路由的使用.md&#41;)

## application对象

Expand Down
2 changes: 1 addition & 1 deletion code/express/apps/template-demo/Readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ express --no-view template-demo

可以清晰地看见新创建了`template-demo`项目:

![](../images/express-create.png)
![](./images/express-create.png)

## 目录结构

Expand Down
5 changes: 5 additions & 0 deletions docs/.vuepress/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@

# vuepress 目录规范

- styles 目录固定
- public 目录固定
30 changes: 0 additions & 30 deletions docs/.vuepress/client.ts

This file was deleted.

69 changes: 0 additions & 69 deletions docs/.vuepress/config.ts

This file was deleted.

2 changes: 0 additions & 2 deletions docs/.vuepress/config/index.ts

This file was deleted.

45 changes: 0 additions & 45 deletions docs/.vuepress/config/sidebar.ts

This file was deleted.

6 changes: 6 additions & 0 deletions docs/.vuepress/theme/READEME.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# 自定义布局


## 参考

- <https://vuejs.press/zh/reference/frontmatter.html#layout>
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ export const COPYRIGHT = `
export const AUTHOR_INFO = {
name: authorInfo.name,
email: authorInfo.email,
url: authorInfo.homePages
url: authorInfo.homePage
}


Expand Down Expand Up @@ -91,4 +91,4 @@ export const NotFoundMsgList = [
"我陪你走到最后,能不能别想太多,会不会手牵着手,晚一点再到尽头,你说不该再相见只为了瞬间,谢谢你让我听见因为我在等待永远。",
"天灰灰会不会,让我忘了你是谁,累不累睡不睡,单影无人相依偎,夜越黑梦违背,有谁肯安慰,我的世界将被摧毁也许颓废也是另一种美。",
"我知道你我都没有错,只是忘了怎么退后,信誓旦旦给的承诺,全被时间扑了空。我知道我们都没有错,只是放手会比较好过,最美的爱情回忆里待续。",
]
]
22 changes: 22 additions & 0 deletions docs/.vuepress/theme/headers.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
import {HeadConfig} from "@vuepress/shared";

export const headers:HeadConfig[]=[
[
'link', { rel: 'icon', href: 'fight_favicon.ico' }
],
// vercel统计 相关配置
[
'script', { type: 'text/javascript', src: '/_vercel/insights/script.js' }
],
// 百度统计
[
'script', {}, `
var _hmt = _hmt || [];
(function() {
var hm = document.createElement("script");
hm.src = "https://hm.baidu.com/hm.js?613c9d7af9e1c9a7f9eef6a55aa2399d";
var s = document.getElementsByTagName("script")[0];
s.parentNode.insertBefore(hm, s);
})();`
]
]
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import {ThemeLocaleData} from "vuepress-theme-hope";
import {NotFoundMsgList} from "./constant.config";
import {NotFoundMsgList} from "./constant";

/**
* 支持中文
Expand Down Expand Up @@ -39,8 +39,10 @@ const localCN: ThemeLocaleData = {
all: "全部",
intro: "个人介绍",
star: "收藏",
empty:"空"
},


paginationLocales: {
prev: "上一页",
next: "下一页",
Expand Down Expand Up @@ -74,6 +76,6 @@ const localCN: ThemeLocaleData = {
/**
* 自定义语言,支持文案
*/
export const langConfig = {
export const i18n = {
"/": localCN
}
Loading