Skip to content

Commit 26d233a

Browse files
committed
Design post index page
1 parent 530d771 commit 26d233a

File tree

14 files changed

+197
-101
lines changed

14 files changed

+197
-101
lines changed

src/components/Aside.astro

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,12 @@
1010
aside {
1111
@media (min-width: $single-width) {
1212
float: inline-end;
13+
padding-inline-start: $space-md;
1314
}
1415

1516
@media (min-width: $full-width) {
1617
position: relative;
18+
padding-inline-start: none;
1719
}
1820
}
1921

src/components/Bandcamp.astro

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ const { album, tracks = 5 } = Astro.props;
1111
style=`--num-tracks: ${tracks};`
1212
src={`https://bandcamp.com/EmbeddedPlayer/album=${album}/size=large/bgcol=ffffff/linkcol=000000/transparent=true/`}
1313
seamless
14+
sandbox="allow-scripts allow-same-origin"
1415
></iframe>
1516

1617
<style lang="scss">
@@ -30,8 +31,7 @@ const { album, tracks = 5 } = Astro.props;
3031
margin-block-start: $space-xs;
3132

3233
@media (min-width: $single-width) {
33-
margin-block-start: 0;
34-
max-width: none;
34+
max-width: 40vw;
3535
}
3636

3737
@media (min-width: $full-width) {

src/components/Footer.astro

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<footer>
2-
<p>Made with <a href="https://astro.build/">Astro</a> and <a href="https://docs.github.com/en/pages">GitHub Pages</a></p>
2+
<p>This site was made with <a href="https://astro.build/">Astro</a> and <a href="https://docs.github.com/en/pages">GitHub Pages</a></p>
33
<p>View the source code on <a href="https://github.com/willburden/willburden.github.io">GitHub</a></p>
44
</footer>
55

src/components/TagList.astro

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
---
2+
interface Props {
3+
tags: string[],
4+
}
5+
6+
const { tags } = Astro.props;
7+
---
8+
9+
{tags.length > 0 &&
10+
<div>
11+
{tags.map(tag => (
12+
<span><a href={`/tag/${tag}`}>{tag}</a></span>
13+
))}
14+
</div>
15+
}
16+
17+
<style lang="scss">
18+
@use '../styles/_tokens' as *;
19+
20+
div {
21+
margin-top: -$underline-thickness;
22+
23+
span {
24+
@include margin-inline-between($space-xs);
25+
}
26+
}
27+
</style>
Lines changed: 50 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
---
22
import type { InferEntrySchema } from 'astro:content'
33
import { Image } from 'astro:assets';
4-
import formatDate from '../../util/formatDate';
5-
import PostTags from './PostTags.astro';
4+
import * as formatDate from '../../util/formatDate';
5+
import TagList from '../TagList.astro';
66
import Aside from '../Aside.astro';
77
import Bandcamp from '../Bandcamp.astro';
88
@@ -12,7 +12,7 @@ interface Props {
1212
1313
const { data } = Astro.props;
1414
15-
const pubDate = formatDate(data.pubDate);
15+
const pubDate = formatDate.verbose(data.pubDate);
1616
---
1717

1818
<header>
@@ -22,6 +22,7 @@ const pubDate = formatDate(data.pubDate);
2222
<h2>{data.subtitle}</h2>
2323
}
2424
<p>{pubDate}</p>
25+
<TagList tags={data.tags} />
2526
</div>
2627
{data.hero?.image !== undefined &&
2728
<Image
@@ -31,47 +32,73 @@ const pubDate = formatDate(data.pubDate);
3132
{data.bandcamp?.album !== undefined &&
3233
<Aside><Bandcamp {...data.bandcamp} /></Aside>
3334
}
34-
<PostTags tags={data.tags} />
3535
</header>
3636

3737
<style lang="scss">
3838
@use '../../styles/_tokens' as *;
3939

4040
header {
4141
position: relative;
42-
42+
margin-block-end: $space-md;
43+
line-height: $line-height-md;
44+
4345
> * {
44-
@include space-between($space-xs);
45-
46-
&:last-child {
47-
margin-block-end: $space-md;
48-
}
46+
margin-block: 0;
4947
}
50-
48+
5149
h1 {
5250
font-size: $size-xl;
5351
}
5452

5553
.frontmatter {
56-
margin-block-end: 0;
54+
margin-block-end: $space-sm;
5755

5856
> * {
5957
margin-block: 0;
6058
}
6159

62-
&:last-child {
63-
margin-block-end: $space-md;
60+
h2 {
61+
font-size: $size-md;
6462
}
65-
}
66-
67-
p {
68-
@include font-technical;
69-
}
7063

71-
img {
72-
margin-block-end: 0;
73-
padding: 0;
74-
border-radius: 0;
64+
p {
65+
@include font-technical;
66+
line-height: $line-height-md;
67+
}
7568
}
7669
}
70+
71+
// header {
72+
// position: relative;
73+
// margin-block-end: $space-md;
74+
// line-height: $line-height-md;
75+
76+
// > * {
77+
// @include margin-between($space-xs);
78+
// }
79+
80+
// h1 {
81+
// font-size: $size-xl;
82+
// }
83+
84+
// .frontmatter {
85+
// > * {
86+
// margin-block: 0;
87+
// }
88+
// }
89+
90+
// h2 {
91+
// font-size: $size-md;
92+
// }
93+
94+
// p {
95+
// @include font-technical;
96+
// }
97+
98+
// img {
99+
// margin-block-end: 0;
100+
// padding: 0;
101+
// border-radius: 0;
102+
// }
103+
// }
77104
</style>

src/components/post/PostTags.astro

Lines changed: 0 additions & 50 deletions
This file was deleted.

src/content/posts/example-album.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
---
2-
title: "Example album"
3-
subtitle: Album review
2+
title: "Twain: Noon"
3+
subtitle: Album Review
44
pubDate: 2025-10-28
55
bandcamp:
66
album: 826228865
77
tracks: 13
88
tags:
99
- music
1010
- review
11-
- artist name
11+
- Twain
1212
---
1313

1414
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut non lorem diam. Quisque vulputate nibh sodales eros pretium tincidunt. Aenean porttitor efficitur convallis. Nulla sagittis finibus convallis. Phasellus in fermentum quam, eu egestas tortor. Maecenas ac mollis leo. Integer maximus eu nisl vel sagittis.

src/content/posts/third-post.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
---
2+
title: A third post with a very long title that tests the malleability of the layout
3+
pubDate: 2025-12-16
4+
---

src/content/posts/walking.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ hero:
66
alt: 'A photo of someone walking through woods, taken from a distance behind. There are bright green and yellow leaves.'
77
---
88

9+
910
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut non lorem diam. Quisque vulputate nibh sodales eros pretium tincidunt. Aenean porttitor efficitur convallis. Nulla sagittis finibus convallis. Phasellus in fermentum quam, eu egestas tortor. Maecenas ac mollis leo. Integer maximus eu nisl vel sagittis.
1011

1112
# Aliquam ante urna

src/layouts/BaseLayout.astro

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,14 @@ import '../styles/global.scss';
3636
<style lang="scss">
3737
@use '../styles/_tokens' as *;
3838

39+
:root {
40+
scrollbar-gutter: stable both-edges;
41+
}
42+
43+
body, .columns {
44+
min-height: 100vh;
45+
}
46+
3947
.columns {
4048
display: flex;
4149
flex-direction: row;
@@ -56,6 +64,13 @@ import '../styles/global.scss';
5664
@media (min-width: $full-width) {
5765
padding-inline-end: $space-lg;
5866
}
67+
68+
display: flex;
69+
flex-direction: column;
70+
71+
main {
72+
flex: 1;
73+
}
5974
}
6075

6176
.aside {

0 commit comments

Comments
 (0)