Skip to content

Commit bf4d9b4

Browse files
committed
fix: 一些小问题
- 编辑器折行 - 登录图标 - 段间距 - info warn err 块 - 代码高亮
1 parent 56bfd54 commit bf4d9b4

17 files changed

Lines changed: 165 additions & 50 deletions

File tree

.github/workflows/docker-build.yml

Lines changed: 19 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -13,16 +13,30 @@ jobs:
1313
- name: Checkout code
1414
uses: actions/checkout@v4
1515

16+
- name: Set up Node.js
17+
uses: actions/setup-node@v4
18+
with:
19+
node-version: 23
20+
21+
- name: Install pnpm
22+
run: npm install -g pnpm
23+
24+
- name: Install dependencies
25+
run: pnpm install --frozen-lockfile
26+
27+
- name: Build Nuxt application
28+
run: pnpm run build
29+
1630
- name: Set up QEMU
17-
uses: docker/setup-qemu-action@v3
31+
uses: docker/setup-qemu-action@v3 # 添加 QEMU 支持跨架构构建
1832
with:
19-
platforms: arm64,armhf
33+
platforms: arm64,armhf # 支持 ARM64 和 32 位 ARM
2034

2135
- name: Set up Docker Buildx
2236
uses: docker/setup-buildx-action@v3
2337
with:
2438
install: true
25-
platforms: linux/amd64,linux/arm64,linux/arm/v7
39+
platforms: linux/amd64,linux/arm64,linux/arm/v7 # 指定要构建的平台
2640

2741
- name: Log in to Docker Hub
2842
uses: docker/login-action@v3
@@ -45,9 +59,7 @@ jobs:
4559
with:
4660
context: .
4761
file: ./Dockerfile
48-
platforms: linux/amd64,linux/arm64,linux/arm/v7
62+
platforms: linux/amd64,linux/arm64,linux/arm/v7 # 构建多架构镜像
4963
push: true
5064
tags: ${{ steps.meta.outputs.tags }}
51-
labels: ${{ steps.meta.outputs.labels }}
52-
cache-from: type=gha
53-
cache-to: type=gha,mode=max
65+
labels: ${{ steps.meta.outputs.labels }}

Dockerfile

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,11 @@
1+
FROM node:23-alpine
12

2-
FROM node:22-alpine AS builder
33
WORKDIR /app
4-
COPY package*.json ./
5-
RUN npm install
6-
COPY . .
7-
RUN npm run build
84

9-
FROM node:22-alpine
10-
WORKDIR /app
11-
COPY --from=builder /app/.output/ ./.output/
5+
COPY .output/ ./.output/
6+
127
EXPOSE 3000
8+
139
USER node
10+
1411
CMD ["node", ".output/server/index.mjs"]

components/TopTabs.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@
3939
<v-divider vertical />
4040

4141
<div>
42-
<v-btn v-if="!loggedIn" class="ml-2 mr-2" append-icon="mdi-loggin"
42+
<v-btn v-if="!loggedIn" class="ml-2 mr-2" append-icon="mdi-login"
4343
@click="navigateTo(`/login?redirect=${$route.path}`)">登录</v-btn>
4444
<v-menu v-else open-on-hover>
4545
<template #activator="{ props }">

components/mdc/Callout.vue

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
<template>
2+
<div class="mt-4 mb-4">
3+
<v-alert :type="props.type"
4+
:border="props.border"
5+
:variant="props.variant ?? 'tonal'"
6+
:title="props.title"
7+
:border-color="props.borderColor"
8+
:icon="props.icon"
9+
:color="props.color"
10+
>
11+
<MDCSlot />
12+
</v-alert>
13+
</div>
14+
</template>
15+
16+
<script setup lang="ts">
17+
const props = defineProps<{
18+
title: string | undefined,
19+
variant: "elevated" | "flat" | "tonal" | "outlined" | "text" | "plain" | undefined,
20+
type: "error" | "info" | "warning" | "success" | undefined,
21+
border: "start" | "end" | "top" | "bottom" | undefined,
22+
borderColor: string | undefined,
23+
color: string | undefined,
24+
icon: string | undefined
25+
}>()
26+
</script>

components/mdc/Error.vue

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
<template>
2+
<div class="mt-4 mb-4">
3+
<v-alert type="error" border="start" variant="tonal">
4+
<MDCSlot />
5+
</v-alert>
6+
</div>
7+
</template>

components/mdc/Info.vue

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
<template>
2+
<div class="mt-4 mb-4">
3+
<v-alert type="info" border="start" variant="tonal">
4+
<MDCSlot />
5+
</v-alert>
6+
</div>
7+
</template>

components/mdc/Warning.vue

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
<template>
2+
<div class="mt-4 mb-4">
3+
<v-alert type="warning" border="start" variant="tonal">
4+
<MDCSlot />
5+
</v-alert>
6+
</div>
7+
</template>

nuxt.config.ts

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,13 @@ export default defineNuxtConfig({
44
devtools: { enabled: false },
55

66
modules: [
7-
"@nuxt/eslint",
8-
"@nuxt/scripts",
9-
"@nuxt/test-utils",
10-
"vuetify-nuxt-module",
11-
"nuxt-auth-utils",
12-
"nuxt-monaco-editor",
13-
"@nuxtjs/mdc",
14-
"nuxt-mathjax",
7+
"@nuxt/eslint",
8+
"@nuxt/scripts",
9+
"@nuxt/test-utils",
10+
"vuetify-nuxt-module",
11+
"nuxt-auth-utils",
12+
"nuxt-monaco-editor",
13+
"@nuxtjs/mdc",
1514
],
1615

1716
runtimeConfig: {
@@ -42,13 +41,18 @@ export default defineNuxtConfig({
4241
rehypePlugins: {
4342
"rehype-mathjax": {},
4443
},
44+
highlight: {
45+
theme: "github-light",
46+
langs: ["ts", "cpp", "markdown", "py", "rust", "c#", "js", "json", "c"],
47+
wrapperStyle: true
48+
},
4549
},
4650
vuetify: {
4751
vuetifyOptions: {
4852
locale: {
4953
locale: "zhHans",
5054
},
51-
localeMessages: ['zhHans'],
55+
localeMessages: ["zhHans"],
5256
},
5357
},
54-
});
58+
});

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,8 @@
2323
"nodemailer": "^7.0.4",
2424
"nuxt": "^3.17.6",
2525
"nuxt-auth-utils": "0.5.20",
26-
"nuxt-mathjax": "1.1.1",
2726
"nuxt-monaco-editor": "1.3.2",
27+
"rehype-highlight": "^7.0.2",
2828
"rehype-mathjax": "^7.1.0",
2929
"remark-math": "^6.0.0",
3030
"typescript": "^5.8.3",

pages/docs/[major]/[doc].vue

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -259,13 +259,25 @@ h6 {
259259
260260
.article p {
261261
line-height: 1.8;
262+
margin-top: 1em;
262263
}
263264
264265
266+
.article svg {
267+
margin-top: 1em;
268+
}
269+
270+
.article hr {
271+
margin-top: 1em;
272+
}
273+
274+
.article code {
275+
margin-top: 1em;
276+
}
277+
265278
.article li {
266279
line-height: 1.8;
267280
margin-left: 1em;
268281
margin-top: 0.5em;
269-
margin-bottom: 0.5em;
270282
}
271283
</style>

0 commit comments

Comments
 (0)