add backlink to blogposts (#1504)
This commit is contained in:
parent
48cdc25bfb
commit
38a7a5b5e9
2 changed files with 18 additions and 0 deletions
16
www/src/components/BackArrow.astro
Normal file
16
www/src/components/BackArrow.astro
Normal file
|
@ -0,0 +1,16 @@
|
|||
---
|
||||
interface Props {
|
||||
url: string
|
||||
title: string
|
||||
}
|
||||
const { url, title } = Astro.props
|
||||
---
|
||||
<a href={url}>
|
||||
← {title}
|
||||
</a>
|
||||
<style>
|
||||
a {
|
||||
display: block;
|
||||
margin-top: 2rem;
|
||||
}
|
||||
</style>
|
|
@ -2,6 +2,7 @@
|
|||
import Author from './Author.astro';
|
||||
import GithubStarButton from './GithubStarButton.astro';
|
||||
import GoogleAnalytics from './GoogleAnalytics.astro';
|
||||
import BackArrow from './BackArrow.astro';
|
||||
|
||||
export interface Props {
|
||||
title: string;
|
||||
|
@ -24,6 +25,7 @@ const { title, author, publishDate, heroImage } = Astro.props;
|
|||
</header>
|
||||
<main class="content">
|
||||
<slot />
|
||||
<BackArrow url={'/blog/'} title={'Back to all blogposts'}/>
|
||||
</main>
|
||||
</article>
|
||||
<GoogleAnalytics />
|
||||
|
|
Loading…
Reference in a new issue