Skip to content

Commit

Permalink
chore: update publish script
Browse files Browse the repository at this point in the history
  • Loading branch information
kohaiy committed Feb 4, 2024
1 parent b454733 commit 0d7ff42
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
5 changes: 3 additions & 2 deletions docs/src/App.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<script setup lang="ts">
import { version as latestVersion } from '../package.json'
import { version as latestVersion } from '../../packages/vue/package.json'
import locale from './comp/locale'
import useI18n from './comp/mixins/i18n-mixins'
import useThemeSwitch from './comp/mixins/theme-switch-mixins'
Expand Down Expand Up @@ -45,9 +45,10 @@ const showLogo = computed(() => {
// current doc version
const currentDocVersion = computed(() => {
const { pathname } = window.location
const [version] = pathname.match(/(\d+\.{2}\d+)/) ?? []
const versionItem = switchVersionOptions.value.find(
x => x.value === pathname,
x => x.value === version,
)
return versionItem ? versionItem.label : latestVersion
Expand Down
5 changes: 4 additions & 1 deletion docs/vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,12 @@ export default defineConfig(({ mode }) => {
// eslint-disable-next-line node/prefer-global/process
const env = loadEnv(mode, process.cwd())
let base = env.VITE_BASE_URL
if (mode === 'gh-pages-ver')
if (mode === 'gh-pages-ver') {
// eslint-disable-next-line node/prefer-global/process
base = `${loadEnv('gh-pages', process.cwd()).VITE_BASE_URL}/${version}`
// eslint-disable-next-line node/prefer-global/process
env.VITE_BASE_URL = loadEnv('gh-pages', process.cwd()).VITE_BASE_URL
}

return {
base,
Expand Down

0 comments on commit 0d7ff42

Please sign in to comment.