Skip to content

Commit e73919e

Browse files
committed
Add icon in "Back to index"
1 parent 08b0137 commit e73919e

1 file changed

Lines changed: 12 additions & 3 deletions

File tree

src/layouts/BlogPost.astro

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import FormattedDate from "../components/FormattedDate.astro";
44
import { Image, getImage } from "astro:assets";
55
import BaseLayout from "./BaseLayout.astro";
66
import { POST_WIDTH } from "../consts";
7+
import { Icon } from "astro-icon/components";
78
89
type Props = CollectionEntry<"blog">["data"];
910
@@ -20,7 +21,10 @@ const ogImage = await getImage({ src: heroImage, format: "jpg", height: 200 });
2021
>
2122
<main>
2223
<div class="row">
23-
<a class="index-button" href="/blog">« Back to index</a>
24+
<a class="index-button" href="/blog">
25+
<Icon name="fa6-solid:circle-left" />
26+
<span>Back to index</span>
27+
</a>
2428
<article>
2529
<div class="hero-image">
2630
<Image src={heroImage} alt={title} width={POST_WIDTH} height={510} />
@@ -44,7 +48,10 @@ const ogImage = await getImage({ src: heroImage, format: "jpg", height: 200 });
4448
<slot />
4549
</div>
4650
</article>
47-
<a class="index-button" href="/blog">« Back to index</a>
51+
<a class="index-button" href="/blog">
52+
<Icon name="fa6-solid:circle-left" />
53+
<span>Back to index</span>
54+
</a>
4855
</div>
4956
</main>
5057
</BaseLayout>
@@ -103,8 +110,10 @@ const ogImage = await getImage({ src: heroImage, format: "jpg", height: 200 });
103110
}
104111
.index-button {
105112
max-width: calc(100% - 2em);
106-
/* padding: 1em; */
107113
margin-bottom: 4rem;
114+
display: flex;
115+
align-items: center;
116+
gap: 0.4em;
108117
}
109118
@media screen and (max-width: 800px) {
110119
main {

0 commit comments

Comments
 (0)