-
Notifications
You must be signed in to change notification settings - Fork 0
/
[...slug].vue
76 lines (66 loc) · 1.91 KB
/
[...slug].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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
<script setup lang="ts">
import type { Breadcrumb } from "@/types";
const { path } = useRoute();
const { data } = await useAsyncData(`content-${path}`, () => queryContent().where({ _path: path }).findOne());
const viewCount = await getViewCount(path);
const pageTitle = data.value?.title + " | Посты | Александр Голдовский";
const breadcrumbs: Breadcrumb[] = [
{
title: "Посты",
url: "/blog/",
},
{
title: data.value?.title as string,
url: null,
},
];
useSeoMeta({
title: pageTitle,
description: data.value?.description,
ogTitle: pageTitle,
ogDescription: data.value?.description,
ogUrl: "https://hazadus.ru" + path,
ogImage: "https://hazadus.ru/images/blog/" + data.value?.cover,
twitterTitle: pageTitle,
twitterDescription: data.value?.description,
twitterCard: "summary",
twitterImage: "https://hazadus.ru/images/blog/" + data.value?.cover,
});
</script>
<template>
<template v-if="data">
<Title>
{{ pageTitle }}
</Title>
<Breadcrumbs :breadcrumbs="breadcrumbs" />
<ContentRenderer
:value="data"
class="prose my-10 mx-auto max-w-4xl"
/>
<div class="pt-6 mx-auto max-w-4xl border-t">
<Icon name="ic:outline-keyboard-alt" />
<NuxtLink
to="/about/#contact"
class="hover:underline"
>Александр Голдовский</NuxtLink
>
· <Icon name="mdi:calendar-outline" /> {{ formatDate(data.date) }} ·
<Icon name="ic:round-remove-red-eye" /> {{ viewCount }}
</div>
<div class="my-8 pb-4 mx-auto max-w-4xl border-b">
<Tag
v-for="tag in data.tags"
:key="`tag-${tag}`"
:title="tag"
/>
</div>
<ContactForm class="my-8" />
<div class="my-8 mx-auto max-w-4xl border-t">
<PostList
list-type="simple"
:limit="5"
:exclude-path="path"
/>
</div>
</template>
</template>