Skip to content

Commit 8b7c7e8

Browse files
authored
Merge pull request L33Z22L11#1 from KazariEX/main
refactor: use app.config
2 parents 119ab0c + 4d9eb1a commit 8b7c7e8

File tree

15 files changed

+125
-227
lines changed

15 files changed

+125
-227
lines changed

.vscode/settings.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
{
2-
"typescript.tsdk": "node_modules\\typescript\\lib"
3-
}
2+
"typescript.tsdk": "node_modules\\typescript\\lib"
3+
}

app.config.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
export default defineAppConfig({
2+
author: {
3+
name: '纸鹿本鹿',
4+
},
5+
description: '纸鹿至麓不知路,支炉制露不止漉。',
6+
})

app.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,4 +23,4 @@
2323
}
2424
}
2525
}
26-
</style>
26+
</style>

components/ZSidebar.vue

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,14 +22,15 @@ const nav = [
2222
],
2323
},
2424
]
25+
const appConfig = useAppConfig()
2526
const sidebarStore = useSidebarStore()
2627
</script>
2728

2829
<template>
2930
<aside id="z-sidebar" :class="{ show: sidebarStore.isOpen }">
3031
<header class="aside-header">
3132
<ZLIcon />
32-
<span>纸鹿本鹿</span>
33+
<span>{{ appConfig.author.name }}</span>
3334
<Icon name="ph:x" class="close-sidebar" @click="sidebarStore.toggle()" />
3435
</header>
3536
<nav class="aside-nav">
@@ -49,7 +50,7 @@ const sidebarStore = useSidebarStore()
4950
</template>
5051
</nav>
5152
<footer class="aside-footer">
52-
<p>© {{ curYear }} 纸鹿本鹿</p>
53+
<p>© {{ curYear }} {{ appConfig.author.name }}</p>
5354
<p>aka Zhilu, L33Z22L11</p>
5455
</footer>
5556
</aside>

eslint.config.mjs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,7 @@ export default antfu({
44
stylistic: {
55
indent: 4,
66
},
7+
rules: {
8+
'jsonc/indent': ['error', 2],
9+
},
710
})

nuxt.config.ts

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -44,11 +44,8 @@ export default defineNuxtConfig({
4444
runtimeCompiler: true,
4545
},
4646
modules: [
47-
'nuxt-icon',
48-
'nuxt-simple-robots',
49-
'nuxt-site-config',
47+
'@nuxt/icon',
5048
'@nuxtjs/seo',
51-
'@nuxtjs/sitemap',
5249
'@pinia/nuxt',
5350
],
5451
site: {

package.json

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,16 +13,13 @@
1313
"date-fns": "^3.6.0"
1414
},
1515
"devDependencies": {
16-
"@antfu/eslint-config": "^2.23.0",
17-
"@nuxtjs/seo": "2.0.0-rc.10",
18-
"@nuxtjs/sitemap": "^5.3.5",
16+
"@antfu/eslint-config": "^2.23.1",
17+
"@nuxt/icon": "^1.2.1",
18+
"@nuxtjs/seo": "2.0.0-rc.16",
1919
"@pinia/nuxt": "^0.5.1",
2020
"@zinkawaii/stylelint-config": "^0.1.4",
2121
"fast-xml-parser": "^4.4.0",
2222
"nuxt": "^3.12.4",
23-
"nuxt-icon": "1.0.0-beta.6",
24-
"nuxt-simple-robots": "4.0.0-rc.17",
25-
"nuxt-site-config": "^2.2.15",
2623
"sass": "^1.77.8",
2724
"stylelint": "^16.7.0",
2825
"typescript": "^5.5.3"

pages/home.vue

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ definePageMeta({
44
alias: ['/'],
55
title: '主页',
66
})
7+
const appConfig = useAppConfig()
78
</script>
89

910
<template>
@@ -12,10 +13,10 @@ definePageMeta({
1213
<ZField label="<span style='font-size: 3rem;'>👋</span>">
1314
<div>
1415
<h1 style="font-size: 3rem;">
15-
你好,<br>我是<mark>纸鹿本鹿</mark>
16+
你好,<br>我是<mark>{{ appConfig.author.name }}</mark>
1617
</h1>
1718
<p class="desc">
18-
纸鹿至麓不知路,支炉制露不止漉。
19+
{{ appConfig.description }}
1920
</p>
2021
<div>
2122
<ZButton icon="ph:files-duotone" to="https://blog.zhilu.cyou/">

0 commit comments

Comments
 (0)