- Replace VuePress 1.9.10 with VitePress 1.6.4 - Convert config from CommonJS to ESM TypeScript (config.mts) - Convert shared Theengs nav config to ESM (commonConfig.mts) - Rewrite BoardEnvironmentTable in Vue 3 Composition API - Rewrite FlashEnvironmentSelector in Vue 3 Composition API - Enable built-in local search and dark mode - Add medium-zoom for image zoom - Use VitePress CSS variables for dark mode compatibility - Update CI script paths from .vuepress to .vitepress - Update .gitignore for VitePress build artifacts - Rename README.md files to index.md (VitePress convention) - Fix markdown compatibility (angle-bracket escaping, image paths) - Drop PWA plugin (not needed) Co-authored-by: Florian <1technophile@users.noreply.github.com> Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
35 lines
895 B
TypeScript
35 lines
895 B
TypeScript
// docs/.vitepress/theme/index.ts
|
|
import DefaultTheme from 'vitepress/theme'
|
|
import mediumZoom from 'medium-zoom'
|
|
import { onMounted, watch, nextTick } from 'vue'
|
|
import { useRoute } from 'vitepress'
|
|
import './custom.css'
|
|
import BoardEnvironmentTable from '../components/BoardEnvironmentTable.vue'
|
|
import FlashEnvironmentSelector from '../components/FlashEnvironmentSelector.vue'
|
|
|
|
export default {
|
|
extends: DefaultTheme,
|
|
enhanceApp({ app }) {
|
|
app.component('BoardEnvironmentTable', BoardEnvironmentTable)
|
|
app.component('FlashEnvironmentSelector', FlashEnvironmentSelector)
|
|
},
|
|
setup() {
|
|
const route = useRoute()
|
|
|
|
const initZoom = () => {
|
|
mediumZoom('.vp-doc img:not(.no-zoom)', {
|
|
background: 'var(--vp-c-bg)'
|
|
})
|
|
}
|
|
|
|
onMounted(() => {
|
|
initZoom()
|
|
})
|
|
|
|
watch(
|
|
() => route.path,
|
|
() => nextTick(() => initZoom())
|
|
)
|
|
}
|
|
}
|