diff options
-rw-r--r-- | www/src/components/BackArrow.astro | 16 | ||||
-rw-r--r-- | www/src/components/BlogPost.astro | 2 |
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}> + ← {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 /> |