summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Elian ☕️ <hello@elian.codes> 2021-10-10 16:52:54 +0200
committerGravatar GitHub <noreply@github.com> 2021-10-10 09:52:54 -0500
commit38a7a5b5e9ee4cb66da43c775aa5271f1ac8a134 (patch)
tree790522b5536c0247a7ad948b6eb35592935894c6
parent48cdc25bfb4ac20e834d9db5228d778147ba1a06 (diff)
downloadastro-38a7a5b5e9ee4cb66da43c775aa5271f1ac8a134.tar.gz
astro-38a7a5b5e9ee4cb66da43c775aa5271f1ac8a134.tar.zst
astro-38a7a5b5e9ee4cb66da43c775aa5271f1ac8a134.zip
add backlink to blogposts (#1504)
-rw-r--r--www/src/components/BackArrow.astro16
-rw-r--r--www/src/components/BlogPost.astro2
2 files changed, 18 insertions, 0 deletions
diff --git a/www/src/components/BackArrow.astro b/www/src/components/BackArrow.astro
new file mode 100644
index 000000000..2d9d3332f
--- /dev/null
+++ b/www/src/components/BackArrow.astro
@@ -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> \ No newline at end of file
diff --git a/www/src/components/BlogPost.astro b/www/src/components/BlogPost.astro
index c2cd18587..394eff7ce 100644
--- a/www/src/components/BlogPost.astro
+++ b/www/src/components/BlogPost.astro
@@ -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 />