add backlink to blogposts (#1504)

This commit is contained in:
Elian ☕️ 2021-10-10 16:52:54 +02:00 committed by GitHub
parent 48cdc25bfb
commit 38a7a5b5e9
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 18 additions and 0 deletions

View file

@ -0,0 +1,16 @@
---
interface Props {
url: string
title: string
}
const { url, title } = Astro.props
---
<a href={url}>
&leftarrow; {title}
</a>
<style>
a {
display: block;
margin-top: 2rem;
}
</style>

View file

@ -2,6 +2,7 @@
import Author from './Author.astro'; import Author from './Author.astro';
import GithubStarButton from './GithubStarButton.astro'; import GithubStarButton from './GithubStarButton.astro';
import GoogleAnalytics from './GoogleAnalytics.astro'; import GoogleAnalytics from './GoogleAnalytics.astro';
import BackArrow from './BackArrow.astro';
export interface Props { export interface Props {
title: string; title: string;
@ -24,6 +25,7 @@ const { title, author, publishDate, heroImage } = Astro.props;
</header> </header>
<main class="content"> <main class="content">
<slot /> <slot />
<BackArrow url={'/blog/'} title={'Back to all blogposts'}/>
</main> </main>
</article> </article>
<GoogleAnalytics /> <GoogleAnalytics />