/
Home.vue
46 lines (44 loc) · 1.49 KB
/
Home.vue
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
<script setup lang="ts">
import Date from './Date.vue'
import { data as posts } from './posts.data.js'
import { useData } from 'vitepress'
const { frontmatter } = useData()
</script>
<template>
<div class="divide-y divide-gray-200">
<div class="pt-6 pb-8 space-y-2 md:space-y-5">
<h1
class="text-3xl leading-9 font-extrabold text-gray-900 tracking-tight sm:text-4xl sm:leading-10 md:text-6xl md:leading-14"
>
{{ frontmatter.title }}
</h1>
<p class="text-lg leading-7 text-gray-500">{{ frontmatter.subtext }}</p>
</div>
<ul class="divide-y divide-gray-200">
<li class="py-12" v-for="{ title, href, date, excerpt } of posts">
<article
class="space-y-2 xl:grid xl:grid-cols-4 xl:space-y-0 xl:items-baseline"
>
<Date :date="date" />
<div class="space-y-5 xl:col-span-3">
<div class="space-y-6">
<h2 class="text-2xl leading-8 font-bold tracking-tight">
<a class="text-gray-900" :href="href">{{ title }}</a>
</h2>
<div
v-if="excerpt"
class="prose max-w-none text-gray-500"
v-html="excerpt"
></div>
</div>
<div class="text-base leading-6 font-medium">
<a class="link" aria-label="read more" :href="href"
>Read more →</a
>
</div>
</div>
</article>
</li>
</ul>
</div>
</template>