1
0
Fork 0
mirror of https://github.com/mat-1/matdoesdev.git synced 2025-08-02 14:46:04 +00:00

add back button to blog post

This commit is contained in:
mat 2021-11-17 19:13:16 +00:00
parent 5880d86849
commit 5612de97e0

View file

@ -1,5 +1,5 @@
<script lang="ts" context="module">
import type { APIBlogPost } from './[slug].json';
import type { APIBlogPost } from './[slug].json'
import type { Load } from '@sveltejs/kit'
export const load: Load = async ({ page, fetch }) => {
@ -24,14 +24,22 @@
export let html: string
</script>
<article>
<h1>{title}</h1>
{@html html}
</article>
<div class="article-container">
<a href="/blog" class="back-anchor">← Back</a>
<article>
<h1>{title}</h1>
{@html html}
</article>
</div>
<style>
article {
.article-container {
max-width: 50em;
margin: 0 auto;
}
</style>
.back-anchor {
color: inherit;
text-decoration: none;
}
</style>