-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathapp.vue
137 lines (129 loc) · 3.44 KB
/
app.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
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
<template>
<NuxtLoadingIndicator color="primary" />
<SharedNavbar />
<div class="h-4 md:h-24" />
<UContainer>
<NuxtPage class="mx-auto px-2 lg:px-8 max-w-2xl" />
</UContainer>
<div class="h-4 md:h-32" />
<SharedVisitors />
<SharedFooter />
<div class="h-16 md:hidden" />
</template>
<script setup lang="ts">
const config = useRuntimeConfig();
const route = useRoute();
useSeoMeta({
ogImage: `${config.public.baseURL}/og_me.png`,
twitterCard: "summary_large_image",
});
useHead({
title: () => (route.meta.title as string) || "",
titleTemplate: (title) =>
title ? `${title} - ${config.public.ownerName}` : config.public.ownerName,
htmlAttrs: {
lang: "en",
},
bodyAttrs: {
class: "font-sans",
},
link: [
{
rel: "icon",
type: "image/png",
href: "/icon.png",
},
],
});
if (import.meta.server) {
const PATH_RE = /([^/]+)\/?$/;
const { path = "/" } = route.fullPath.match(PATH_RE)?.groups ?? {};
const url = `${config.public.baseURL}${path}`;
useServerHead({
meta: () => [
{ name: "theme-color", content: "#0ea5e9" },
{ name: "msapplication-TileColor", content: "#0ea5e9" },
{ property: "og:url", content: url },
{
property: "og:image",
content: `${config.public.baseURL}/__og-image__/static/og.png`,
key: "og:image",
},
{ property: "og:image:width", content: "1200" },
{ property: "og:image:height", content: "600" },
{
property: "og:title",
content: (route.meta.title as string) || config.public.ownerName,
},
{
name: "description",
content:
(route.meta.description as string) ||
`The personal website of ${config.public.ownerName}`,
},
{
property: "og:description",
content:
(route.meta.description as string) ||
`The personal website of ${config.public.ownerName}`,
},
{ name: "twitter:card", content: "summary_large_image" },
{ name: "twitter:site", content: `@${config.public.twitter}` },
{ name: "twitter:creator", content: `@${config.public.twitter}` },
],
link: [
{ rel: "canonical", href: url },
{ rel: "mask-icon", color: "#fff", href: "/favicon.ico" },
{ rel: "icon", type: "image/ico", href: "/favicon.ico" },
{ rel: "alternate", type: "application/rss+xml", href: "/rss.xml" },
{
rel: "apple-touch-icon",
sizes: "180x180",
href: "/icon-192x192.png",
},
{
rel: "icon",
type: "image/png",
sizes: "32x32",
href: "/favicon-32x32.png",
},
{
rel: "icon",
type: "image/png",
sizes: "16x16",
href: "/favicon-16x16.png",
},
{ rel: "feed", type: "application/rss+xml", href: "/rss.xml" },
],
});
}
</script>
<style>
:host,
html {
line-height: 1.5;
-webkit-text-size-adjust: 100%;
font-feature-settings: normal;
font-variation-settings: normal;
tab-size: 4;
-webkit-tap-highlight-color: transparent;
}
.font-sans {
font-family: "Barlow", "Barlow Fallback: BlinkMacSystemFont",
"Barlow Fallback: Segoe UI", "Barlow Fallback: Roboto",
"Barlow Fallback: Helvetica Neue", "Barlow Fallback: Arial", system-ui,
sans-serif;
}
.page-enter-active,
.page-leave-active {
transition: all 0.2s;
}
.page-leave-to {
opacity: 0;
transform: translateY(-5px);
}
.page-enter-from {
opacity: 0;
transform: translateY(5px);
}
</style>