feat(pub): add /pub index listing all notes
This commit is contained in:
28
src/pages/pub/index.vue
Normal file
28
src/pages/pub/index.vue
Normal file
@@ -0,0 +1,28 @@
|
|||||||
|
<script setup lang="ts">
|
||||||
|
import { fetchNotes } from "@/api/fetch-notes"
|
||||||
|
|
||||||
|
const notes = await fetchNotes()
|
||||||
|
|
||||||
|
useHead({
|
||||||
|
title: "Articles",
|
||||||
|
})
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<template>
|
||||||
|
<section class="pub-list">
|
||||||
|
<h1>Articles</h1>
|
||||||
|
<ul>
|
||||||
|
<li v-for="note in notes" :key="note.path">
|
||||||
|
<a :href="note.path">{{ note.title }}</a>
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
</section>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<style scoped lang="scss">
|
||||||
|
.pub-list {
|
||||||
|
max-width: 800px;
|
||||||
|
margin: auto;
|
||||||
|
padding: 1rem;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
Reference in New Issue
Block a user