2022-08-09 15:37:32 -04:00
|
|
|
<script setup lang="ts">
|
|
|
|
import type { BlogParsedContent, StoryParsedContent } from "@/shared/types";
|
|
|
|
import dayjs from "dayjs";
|
|
|
|
import utc from "dayjs/plugin/utc.js";
|
|
|
|
import tz from "dayjs/plugin/timezone.js";
|
|
|
|
|
|
|
|
dayjs.extend(utc);
|
|
|
|
dayjs.extend(tz);
|
|
|
|
|
|
|
|
type GeneralParsedContent = BlogParsedContent | StoryParsedContent;
|
|
|
|
|
|
|
|
const route = useRoute();
|
|
|
|
|
|
|
|
// we're not using ContentDoc because i need control
|
|
|
|
const doc = await queryContent<GeneralParsedContent>(route.path).findOne();
|
2022-08-10 16:50:50 -04:00
|
|
|
useTitle(doc.title);
|
2022-08-09 15:37:32 -04:00
|
|
|
</script>
|
2022-08-07 11:37:29 -04:00
|
|
|
|
2022-07-21 16:50:03 -04:00
|
|
|
<template>
|
2022-08-09 15:37:32 -04:00
|
|
|
<div class="container prose dark:prose-invert w-full">
|
|
|
|
<h1>{{ doc.title }}</h1>
|
|
|
|
<ContentRenderer tag="article" :value="doc" class="pt-0 w-full">
|
|
|
|
<ContentRendererMarkdown :value="doc" />
|
|
|
|
|
|
|
|
<template #empty>
|
|
|
|
<p>No description found.</p>
|
|
|
|
</template>
|
|
|
|
<template #not-found>
|
2022-07-22 15:40:31 -04:00
|
|
|
<h1>404 - Not Found</h1>
|
2022-08-09 15:37:32 -04:00
|
|
|
</template>
|
|
|
|
</ContentRenderer>
|
|
|
|
</div>
|
2022-07-21 16:50:03 -04:00
|
|
|
</template>
|
2022-07-22 15:36:37 -04:00
|
|
|
|
2022-08-09 15:37:32 -04:00
|
|
|
<style scoped>
|
|
|
|
.container {
|
2022-07-22 16:08:55 -04:00
|
|
|
width: 80%;
|
2022-08-09 15:37:32 -04:00
|
|
|
max-width: 72ch;
|
2022-07-22 15:40:31 -04:00
|
|
|
padding-top: 2rem;
|
2022-07-22 15:36:37 -04:00
|
|
|
}
|
2022-08-08 17:49:35 -04:00
|
|
|
|
|
|
|
* {
|
|
|
|
transition: color 0.2s ease;
|
|
|
|
}
|
2022-07-22 15:36:37 -04:00
|
|
|
</style>
|