0
0
mirror of https://github.com/Pumpkin-MC/Pumpkin-Website.git synced 2025-07-05 19:54:38 +00:00
Files
PadowYT2 dc47eff6c0 Replace npm with Bun (#9)
* Replace npm with Bun

* Remove the `docs:` prefix

* Spelling mistake and remove docs:

* Fix an error

navigator is not available in CLI, not sure why npm just ignored this
2025-02-28 12:38:00 +01:00

32 lines
995 B
TypeScript

// https://vitepress.dev/guide/custom-theme
import { h } from 'vue'
import { inBrowser, type Theme } from 'vitepress'
import DefaultTheme from 'vitepress/theme'
import './style.css'
import FmtNum from '../components/FmtNum.vue'
import FmtDateTime from '../components/FmtDateTime.vue'
export default {
extends: DefaultTheme,
Layout: () => {
return h(DefaultTheme.Layout, null, {
// https://vitepress.dev/guide/extending-default-theme#layout-slots
})
},
enhanceApp({ app, router, siteData }) {
if (!inBrowser) return;
app.config.globalProperties.$numberFormatter = new Intl.NumberFormat(navigator.languages);
app.config.globalProperties.$dateTimeFormatter = new Intl.DateTimeFormat(navigator.languages, {
year: "numeric",
month: "long",
day: "numeric",
hour: "numeric",
minute: "numeric",
timeZoneName: "short"
});
app.component('FmtNum', FmtNum);
app.component('FmtDateTime', FmtDateTime);
}
} satisfies Theme