diff --git a/.vitepress/config.mts b/.vitepress/config.mts index 2a02659..2872d3e 100644 --- a/.vitepress/config.mts +++ b/.vitepress/config.mts @@ -25,7 +25,17 @@ export default defineConfig({ ], cleanUrls: true, ignoreDeadLinks: true, + head: [ + ['link', { rel: 'icon', href: '/favicon.svg', type: 'image/svg+xml' }], + ['link', { rel: 'icon', href: '/favicon.png', type: 'image/png', sizes: '512x512' }], + ['link', { rel: 'apple-touch-icon', href: '/apple-touch-icon.png', sizes: '180x180' }], + ['link', { rel: 'manifest', href: '/site.webmanifest' }], + ['meta', { name: 'theme-color', content: '#0f3460' }], + ['meta', { name: 'apple-mobile-web-app-title', content: '道德经' }], + ['meta', { name: 'application-name', content: 'DAO DE JING' }], + ], themeConfig: { + logo: { src: '/favicon.png', width: 24, height: 24 }, nav: [ { text: '首页', link: '/' }, { text: '五行', link: '/金、木、水、火、土 - 五行/' }, diff --git a/assets/site/apple-touch-icon.png b/assets/site/apple-touch-icon.png new file mode 100644 index 0000000..3657ac8 --- /dev/null +++ b/assets/site/apple-touch-icon.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:3478f100a23cd2757eca0aa050a5adb959ae28317a0d61ade19c58900df58142 +size 1712493 diff --git a/assets/site/favicon.png b/assets/site/favicon.png new file mode 100644 index 0000000..3657ac8 --- /dev/null +++ b/assets/site/favicon.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:3478f100a23cd2757eca0aa050a5adb959ae28317a0d61ade19c58900df58142 +size 1712493 diff --git a/assets/site/favicon.svg b/assets/site/favicon.svg new file mode 100644 index 0000000..9ab23b2 --- /dev/null +++ b/assets/site/favicon.svg @@ -0,0 +1,11 @@ + + + + + + + + + + S + diff --git a/assets/site/site.webmanifest b/assets/site/site.webmanifest new file mode 100644 index 0000000..cb74526 --- /dev/null +++ b/assets/site/site.webmanifest @@ -0,0 +1,22 @@ +{ + "name": "DAO DE JING", + "short_name": "道德经", + "description": "传统文化典籍资料库", + "start_url": "/", + "display": "standalone", + "background_color": "#1a1a2e", + "theme_color": "#0f3460", + "icons": [ + { + "src": "/apple-touch-icon.png", + "sizes": "512x512", + "type": "image/png", + "purpose": "any maskable" + }, + { + "src": "/favicon.png", + "sizes": "512x512", + "type": "image/png" + } + ] +} diff --git a/scripts/prepare-public.mjs b/scripts/prepare-public.mjs index c6f623c..0b52802 100644 --- a/scripts/prepare-public.mjs +++ b/scripts/prepare-public.mjs @@ -31,4 +31,11 @@ resetPublicDir() copyDir(path.join(root, 'assets'), path.join(publicDir, 'assets')) copyDir(path.join(root, 'images'), path.join(publicDir, 'images')) -console.log('[prepare-public] assets 与 images 已同步到 .vitepress/public') +const siteDir = path.join(root, 'assets', 'site') +if (fs.existsSync(siteDir)) { + for (const file of fs.readdirSync(siteDir)) { + fs.copyFileSync(path.join(siteDir, file), path.join(publicDir, file)) + } +} + +console.log('[prepare-public] assets、images 与站点图标已同步到 .vitepress/public') diff --git a/server/public/login.html b/server/public/login.html index 83862ca..4a49127 100644 --- a/server/public/login.html +++ b/server/public/login.html @@ -3,6 +3,12 @@ + + + + + + 登录 · DAO DE JING