feat: page title

This commit is contained in:
2026-04-24 23:43:57 +02:00
parent 8bec21c12d
commit 9bae3a813d
11 changed files with 50 additions and 24 deletions
+6 -3
View File
@@ -2,20 +2,22 @@
import { ref, onBeforeMount } from 'vue'
import { listArticles } from '@lib/articles'
import type { ArticleMetadata } from '@interfaces'
import { simpleDateFormat } from '@/lib/dates'
import { simpleDateFormat } from '@lib/dates'
import { TITLE } from '@lib/meta'
import PageFooter from '@components/PageFooter.vue'
const articles = ref<ArticleMetadata[]>([])
onBeforeMount(async () => {
const newArticles = await listArticles()
console.log(newArticles)
articles.value.splice(0, articles.value.length, ...newArticles)
window.document.title = TITLE + ' — Home'
})
</script>
<template>
<main>
<h1 class="title">Articles</h1>
<h1 class="title">{{ TITLE }}</h1>
<template v-for="(metadata, index) in articles" v-bind:key="index">
<div v-if="!metadata.draft && metadata.path" class="article">
<RouterLink :to="metadata.path">
@@ -27,5 +29,6 @@ onBeforeMount(async () => {
</RouterLink>
</div>
</template>
<PageFooter />
</main>
</template>