fix mysteriously broken props id in project-view

This commit is contained in:
lightling 2024-05-03 00:57:33 -04:00
parent ded87049f5
commit 531fb2fc4b

View file

@ -10,10 +10,6 @@ import { useRouteStore } from 'src/routes'
import EmbedableContent from 'src/components/shared/embedable-content.vue'
import { getFormattedPeriod } from 'src/utilities/dom'
const props = defineProps<{
id: string,
}>()
const emits = defineEmits<{
(e: 'loaded'): void
}>()
@ -28,8 +24,8 @@ const routeSubConfig = routeStore._routes[currentRoute.path]
onMounted(async () => {
const config = await fetchAndParseYaml<ProjectList>(routeConfig.config)
info.value = await fetchAndParseYaml<ProjectListingInfo>(config.projects[props.id].config)
const md = await fetchAndParseMarkdown(config.projects[props.id].content)
info.value = await fetchAndParseYaml<ProjectListingInfo>(config.projects[currentRoute.query.id as string].config)
const md = await fetchAndParseMarkdown(config.projects[currentRoute.query.id as string].content)
content.value = md.replace('$PERIOD', getFormattedPeriod(info.value.period!))
document.title = routeSubConfig.title.replace('$PROJECT', info.value.title)