feat(home): show only last 15 notes with link to /pub
This commit is contained in:
@@ -1,16 +1,17 @@
|
|||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { fetchNotes } from "@/api/fetch-notes"
|
import { fetchNotes } from "@/api/fetch-notes"
|
||||||
|
|
||||||
const notes = await fetchNotes()
|
const notes = (await fetchNotes()).slice(0, 15)
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<div class="blog-notes" v-if="notes.length > 0">
|
<div class="blog-notes" v-if="notes.length > 0">
|
||||||
<h2>Last notes</h2>
|
<h2>Last notes</h2>
|
||||||
<ul>
|
<ul>
|
||||||
<li v-for="note in notes" :key="note.href">
|
<li v-for="note in notes" :key="note.path">
|
||||||
<a :href="note.path">{{ note.title }}</a>
|
<a :href="note.path">{{ note.title }}</a>
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
|
<p><a href="/pub">See all articles →</a></p>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|||||||
Reference in New Issue
Block a user