cleanup, docs, etc.
This commit is contained in:
parent
ab671c2782
commit
743e917733
8 changed files with 174 additions and 23 deletions
|
@ -5,7 +5,7 @@
|
|||
"type": "module",
|
||||
"scripts": {
|
||||
"start": "vite",
|
||||
"build": "vue-tsc && vite-ssg build",
|
||||
"build": "vue-tsc && vite-ssg build && node post-build.js",
|
||||
"preview": "vite preview"
|
||||
},
|
||||
"devDependencies": {
|
||||
|
|
10
projects/frontend/post-build.js
Normal file
10
projects/frontend/post-build.js
Normal file
|
@ -0,0 +1,10 @@
|
|||
import { existsSync } from 'fs';
|
||||
import { readFile } from 'fs/promises';
|
||||
import { setCurrent } from '../sites/src/set-current.js'
|
||||
|
||||
(async () => {
|
||||
if (existsSync('../sites/sites/current.txt')) {
|
||||
const site = await readFile('../sites/sites/current.txt', { encoding: 'utf-8' });
|
||||
setCurrent(site);
|
||||
}
|
||||
})();
|
|
@ -22,6 +22,10 @@ type DisplayedEntries = { [key: string]: {
|
|||
hiddenByTags?: boolean
|
||||
}}
|
||||
|
||||
const emits = defineEmits<{
|
||||
(e: 'loaded'): void
|
||||
}>()
|
||||
|
||||
const ready = ref(false)
|
||||
const currentRoute = getCurrentRoute()
|
||||
const routeStore = useRouteStore()
|
||||
|
@ -88,6 +92,7 @@ onMounted(async () => {
|
|||
document.title = routeConfig.fullTitle
|
||||
ready.value = true
|
||||
hasWarnings.value = !!(await Promise.all(Object.values(list.entries))).find(other => !!other.warnings)
|
||||
emits('loaded')
|
||||
})
|
||||
</script>
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue