Skip to content

Commit e4b351e

Browse files
committed
提交代码
1 parent 9161444 commit e4b351e

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

44 files changed

+11347
-15291
lines changed

.github/workflows/node.js.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
# 将静态内容部署到 GitHub Pages 的简易工作流程
21
name: Deploy csbigcaptain.github.io
32

43
on:
@@ -38,13 +37,15 @@ jobs:
3837
- name: Install dependencies
3938
run: npm ci
4039
- name: Generate Static Site
40+
env:
41+
# 微软分析 ID,在 GitHub Secrets 中
42+
MS_ANALYTICS_ID: ${{ secrets.MS_ANALYTICS_ID }}
4143
run: npm run generate
4244
- name: Setup Pages
4345
uses: actions/configure-pages@v4
4446
- name: Upload artifact
4547
uses: actions/upload-pages-artifact@v3
4648
with:
47-
# Upload dist folder
4849
path: '.output/public'
4950
- name: Deploy to GitHub Pages
5051
id: deployment

README.md

Lines changed: 19 additions & 58 deletions
Original file line numberDiff line numberDiff line change
@@ -1,75 +1,36 @@
1-
# Nuxt 3 Minimal Starter
1+
# CSBigCaptain Blog v1
22

3-
Look at the [Nuxt 3 documentation](https://nuxt.com/docs/getting-started/introduction) to learn more.
3+
## 预览 & 修改项目
44

5-
## Setup
5+
### Node
66

7-
Make sure to install the dependencies:
7+
推荐使用 [Node Version Manager](https://github.com/nvm-sh/nvm) 来安装 Node ,以便于随时切换系统中 Node 的版本。
88

9-
```bash
10-
# npm
11-
npm install
9+
本项目使用 Node 20 版本构建,也建议使用此版本来构建项目。
1210

13-
# pnpm
14-
pnpm install
15-
16-
# yarn
17-
yarn install
18-
19-
# bun
20-
bun install
21-
```
22-
23-
## Development Server
24-
25-
Start the development server on `http://localhost:3000`:
26-
27-
```bash
28-
# npm
29-
npm run dev
11+
### 包管理器
3012

31-
# pnpm
32-
pnpm run dev
13+
本项目使用 [pnpm](https://pnpm.io/) 作为包管理器,也建议使用 pnpm 作为包管理器。
3314

34-
# yarn
35-
yarn dev
15+
下载 pnpm:
3616

37-
# bun
38-
bun run dev
17+
```shell
18+
npm install -g pnpm
3919
```
4020

41-
## Production
21+
### 安装依赖
4222

43-
Build the application for production:
23+
> [!WARNING]
24+
> 由于本项目使用了依赖 better-sqlite3 模块,该模块是一个 Node.js 的原生模块,安装时会编译底层的 C++ 代码 (native bindings) 。因此需要拥有 C/C++ 编译环境。
4425
45-
```bash
46-
# npm
47-
npm run build
26+
安装依赖:
4827

49-
# pnpm
50-
pnpm run build
51-
52-
# yarn
53-
yarn build
54-
55-
# bun
56-
bun run build
28+
```shell
29+
pnpm install
5730
```
5831

59-
Locally preview production build:
60-
61-
```bash
62-
# npm
63-
npm run preview
32+
另外,如果你使用的是 pnpm , pnpm 出于安全考虑默认会组织某些包的构建脚本自动执行,你需要在 pnpm 中允许 better-sqlite3 执行构建脚本。
6433

65-
# pnpm
66-
pnpm run preview
67-
68-
# yarn
69-
yarn preview
70-
71-
# bun
72-
bun run preview
34+
```shell
35+
pnpm approve-builds
7336
```
74-
75-
Check out the [deployment documentation](https://nuxt.com/docs/getting-started/deployment) for more information.

app.vue

Lines changed: 20 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,26 @@
11
<template>
2-
<div class="webMain">
3-
<NuxtPage />
4-
</div>
2+
<NuxtPage />
53
</template>
64

75
<script setup lang="ts">
8-
import "mdui/mdui.css";
9-
import "mdui";
10-
import { getPagesTheme } from "/composables/theme";
6+
// 注入 Microsoft Clarity 代码
7+
const config = useRuntimeConfig();
8+
const analyticsId = config.public.msAnalyticsId;
119
12-
getPagesTheme()
13-
</script>
10+
useHead({
11+
script: [
12+
{
13+
innerHTML: `
14+
(function(c,l,a,r,i,t,y){
15+
c[a]=c[a]||function(){(c[a].q=c[a].q||[]).push(arguments)};
16+
t=l.createElement(r);t.async=1;t.src="https://www.clarity.ms/tag/"+i;
17+
y=l.getElementsByTagName(r)[0];y.parentNode.insertBefore(t,y);
18+
})(window, document, "clarity", "script", "${analyticsId}");
19+
`,
20+
type: "text/javascript",
21+
},
22+
],
23+
});
1424
15-
<style scoped lang="less">
16-
.webMain {
17-
scroll-behavior: smooth;
18-
min-width: 330px;
19-
overflow: hidden;
20-
position: relative;
21-
}
22-
</style>
25+
getPagesTheme();
26+
</script>

assets/css/global.less

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,15 @@
1-
@import url('https://fonts.googleapis.com/css2?family=Inter:ital,opsz,wght@0,14..32,100..900;1,14..32,100..900&display=swap');
1+
// @import url('https://fonts.googleapis.com/css2?family=Inter:ital,opsz,wght@0,14..32,100..900;1,14..32,100..900&display=swap');
2+
3+
* {
4+
box-sizing: border-box;
5+
}
6+
7+
li, li {
8+
list-style: none;
9+
}
210

311
:root {
4-
--inline-padding: 30px;
12+
--inline-padding: 15px;
513
}
614

715
body {

assets/css/welcome-page.css

Lines changed: 0 additions & 28 deletions
This file was deleted.

components/DefaultNav.vue

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
<template>
2+
<mdui-top-app-bar style="position: fixed">
3+
<mdui-button-icon @click="$emit('open-drawer')">
4+
<mdui-icon-menu></mdui-icon-menu>
5+
</mdui-button-icon>
6+
<mdui-top-app-bar-title style="flex-grow: 1">
7+
<!-- 插槽 topic-text : 顶部导航显示的标题 -->
8+
<slot name="topic-text" />
9+
</mdui-top-app-bar-title>
10+
<div class="rt-btn-hub">
11+
<NavSearchButton />
12+
<NavBatteryHelper />
13+
<NavDarkChangeButton />
14+
<NavChangeWebColor />
15+
<NavShareButton />
16+
<!-- <NavMoreButton /> -->
17+
</div>
18+
</mdui-top-app-bar>
19+
</template>
20+
21+
<script lang="ts" setup>
22+
import "mdui/components/button-icon.js";
23+
import "@mdui/icons/search.js";
24+
import "@mdui/icons/menu.js";
25+
import "@mdui/icons/more-vert.js";
26+
import "@mdui/icons/mode-night.js";
27+
import "@mdui/icons/wb-sunny.js";
28+
import "@mdui/icons/palette.js";
29+
import "@mdui/icons/share.js";
30+
</script>
31+
32+
<style scoped>
33+
mdui-top-app-bar {
34+
top: 0;
35+
left: 0;
36+
right: 0;
37+
z-index: 100;
38+
background-color: rgb(var(--mdui-color-surface-variant));
39+
}
40+
</style>

components/IndexNav.vue

Lines changed: 0 additions & 36 deletions
This file was deleted.

components/content/ProseH2.vue

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
<template>
2+
<div class="prose-h2-container">
3+
<h2 class="prose-h2"><slot /></h2>
4+
</div>
5+
</template>
6+
7+
<script lang="ts" setup>
8+
// 可以添加组件逻辑,如锚点链接、动画效果等
9+
</script>
10+
11+
<style scoped>
12+
.prose-h2-container {
13+
margin: 2rem 0 1.2rem;
14+
position: relative;
15+
}
16+
17+
.prose-h2 {
18+
font-size: 1.5rem;
19+
font-weight: 600;
20+
color: rgb(var(--mdui-color-on-surface));
21+
position: relative;
22+
padding-left: 1.2rem;
23+
border-left: 4px solid rgb(var(--mdui-color-primary));
24+
line-height: 1.4;
25+
}
26+
27+
.prose-h2:hover {
28+
color: rgb(var(--mdui-color-primary));
29+
transition: color 0.5s ease;
30+
cursor: pointer;
31+
}
32+
</style>

components/content/ProseH3.vue

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
<template>
2+
<h3 class="prose-h3"><slot /></h3>
3+
</template>
4+
5+
<script lang="ts" setup>
6+
// 可以添加一些组件逻辑,比如点击事件、动画效果等
7+
</script>
8+
9+
<style scoped>
10+
.prose-h3 {
11+
margin: 1.5rem 0 1rem;
12+
font-size: 1.3rem;
13+
font-weight: 600;
14+
color: rgb(var(--mdui-color-on-surface));
15+
position: relative;
16+
padding-left: 1.22rem;
17+
border-left: 3px solid rgb(var(--mdui-color-secondary));
18+
}
19+
20+
.prose-h3:hover {
21+
color: rgb(var(--mdui-color-primary));
22+
transition: color 0.5s ease;
23+
cursor: pointer;
24+
}
25+
</style>

components/content/ProseH4.vue

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
<template>
2+
<div class="prose-h4-container">
3+
<h4 class="prose-h4"><slot /></h4>
4+
</div>
5+
</template>
6+
7+
<script lang="ts" setup>
8+
// 可以添加组件逻辑,如需要
9+
</script>
10+
11+
<style scoped>
12+
.prose-h4-container {
13+
margin: 1.2rem 0 0.8rem;
14+
position: relative;
15+
}
16+
17+
.prose-h4 {
18+
font-size: 1.1rem;
19+
font-weight: 600;
20+
color: rgb(var(--mdui-color-on-surface));
21+
position: relative;
22+
padding-left: 0.8rem;
23+
border-left: 2px solid rgb(var(--mdui-color-tertiary));
24+
line-height: 1.3;
25+
}
26+
27+
.prose-h4:hover {
28+
color: rgb(var(--mdui-color-primary));
29+
transition: color 0.5s ease;
30+
cursor: pointer;
31+
}
32+
</style>

0 commit comments

Comments
 (0)