From 709fd4f290b56d10b6ac4c40c1a584ad1e88b839 Mon Sep 17 00:00:00 2001 From: zengjia Date: Sun, 9 Jul 2023 20:18:12 +0800 Subject: [PATCH] chore: update --- .vitepress/config/index.ts | 8 +++----- .vitepress/config/ja.ts | 1 - .vitepress/config/kr.ts | 11 ++++++++--- .vitepress/config/zh.ts | 11 ++++++++--- package.json | 8 ++++---- 5 files changed, 23 insertions(+), 16 deletions(-) diff --git a/.vitepress/config/index.ts b/.vitepress/config/index.ts index 8103a840c..3077fa17d 100644 --- a/.vitepress/config/index.ts +++ b/.vitepress/config/index.ts @@ -23,7 +23,6 @@ import { jaConfig } from './ja' import { krConfig } from './kr' export const links: any[] = [] -export const base = process.env.BASE || '/docs/' export const isProd = process.env.NODE_ENV === 'production' export const commitRef = process.env.COMMIT_REF?.slice(0, 8) || 'dev' export const productionHead: HeadConfig[] = [ @@ -51,7 +50,6 @@ export const productionHead: HeadConfig[] = [ ] export default defineConfig({ - base: base, lastUpdated: true, srcDir: 'src', srcExclude: [], @@ -189,7 +187,7 @@ export default defineConfig({ 'link', { rel: 'icon', - href: `${base}/imgs/favicon-32x32.png`, + href: `https://yuanshen.site/docs/imgs/favicon-32x32.png`, type: 'image/png', }, ], @@ -204,7 +202,7 @@ export default defineConfig({ 'link', { rel: 'alternate', - href: `${base}/feed.rss`, + href: `https://yuanshen.site/docs/feed.rss`, type: 'application/rss', }, ], @@ -212,7 +210,7 @@ export default defineConfig({ 'link', { rel: 'alternate', - href: `${base}/imgs/favicon.ico`, + href: `https://yuanshen.site/docs/imgs/favicon.ico`, type: 'image/x-icon', }, ], diff --git a/.vitepress/config/ja.ts b/.vitepress/config/ja.ts index 3e4fcd33c..4fd4be93c 100644 --- a/.vitepress/config/ja.ts +++ b/.vitepress/config/ja.ts @@ -4,7 +4,6 @@ import path from 'path' import type { DefaultTheme, LocaleSpecificConfig } from 'vitepress' import type { CustomConfig } from './types' -const base = process.env.BASE || '/docs/' export const META_URL = 'https://yuanshen.site/docs/ja/' export const META_TITLE = '原神地図' export const META_KEYWORDS = diff --git a/.vitepress/config/kr.ts b/.vitepress/config/kr.ts index e4991760c..fc34b53c0 100644 --- a/.vitepress/config/kr.ts +++ b/.vitepress/config/kr.ts @@ -4,7 +4,6 @@ import path from 'path' import type { DefaultTheme, LocaleSpecificConfig } from 'vitepress' import type { CustomConfig } from './types' -const base = process.env.BASE || '/docs/' export const META_URL = 'https://yuanshen.site/docs/kr/' export const META_TITLE = 'Genshin Interactive Map' export const META_KEYWORDS = @@ -346,12 +345,18 @@ export const krConfig: LocaleSpecificConfig< ['meta', { property: 'twitter:description', content: META_DESCRIPTION }], ['meta', { property: 'og:site_name', content: META_TITLE }], ['meta', { property: 'og:locale', content: 'en-US' }], - ['meta', { property: 'og:image', content: `${base}/imgs/cover.jpg` }], + [ + 'meta', + { + property: 'og:image', + content: `https://yuanshen.site/docs/imgs/cover.jpg`, + }, + ], [ 'meta', { name: 'twitter:image', - content: `${base}/imgs/cover.jpg`, + content: `https://yuanshen.site/docs/imgs/cover.jpg`, }, ], ], diff --git a/.vitepress/config/zh.ts b/.vitepress/config/zh.ts index e1a5edf79..daa8acd6c 100644 --- a/.vitepress/config/zh.ts +++ b/.vitepress/config/zh.ts @@ -3,7 +3,6 @@ import path from 'path' import type { DefaultTheme, LocaleSpecificConfig } from 'vitepress' import type { CustomConfig } from './types' -const base = process.env.BASE || '/docs' export const META_URL = 'https://yuanshen.site/docs/' export const META_TITLE = '原神地图' export const META_DESCRIPTION = '空荧酒馆制作的原神全资源攻略地图。' @@ -24,12 +23,18 @@ export const zhConfig: LocaleSpecificConfig< ['meta', { property: 'og:site_name', content: META_TITLE }], ['meta', { property: 'twitter:description', content: META_DESCRIPTION }], ['meta', { property: 'og:locale', content: 'zh-CN' }], - ['meta', { property: 'og:image', content: `${base}/imgs/cover.jpg` }], + [ + 'meta', + { + property: 'og:image', + content: `https://yuanshen.site/docs/imgs/cover.jpg`, + }, + ], [ 'meta', { name: 'twitter:image', - content: `${base}/imgs/cover.jpg`, + content: `https://yuanshen.site/docs/imgs/cover.jpg`, }, ], ], diff --git a/package.json b/package.json index 7f86390e2..8f1c9a5c4 100644 --- a/package.json +++ b/package.json @@ -3,11 +3,11 @@ "license": "MIT", "type": "module", "scripts": { - "build": "vitepress build", - "build-mpa": "vitepress build --mpa", + "build": "vitepress build --base /docs/", + "build-mpa": "vitepress build --mpa --base /docs/", "changelog": "conventional-changelog -p angular -i CHANGELOG.md -s", "commit": "git-cz", - "dev": "vitepress", + "dev": "vitepress --base /docs/", "postinstall": "husky install", "lint": "prettier --write . && eslint --fix --ext .js,.ts,.vue", "lint:check": "pnpm lint:prettier && pnpm lint:eslint && pnpm lint:zh", @@ -15,7 +15,7 @@ "lint:md": "markdownlint **/*.md && lint:zh", "lint:prettier": "prettier --check .", "lint:zh": "zhlint 'docs/**/*.md'", - "serve": "vitepress serve" + "serve": "vitepress serve --base /docs/" }, "lint-staged": { "*.{js,ts,vue}": [