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 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 />
|
||||||
|
|
Loading…
Reference in a new issue