Skip to content

Commit 127e514

Browse files
committed
fixed styling and layout for work page
1 parent 74af3ae commit 127e514

File tree

5 files changed

+39
-28
lines changed

5 files changed

+39
-28
lines changed

src/components/BaseHead.astro

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,9 @@ const socialUrl = Astro.site.href + 'assets/social.png'
3636
<meta property="twitter:description" content={description} />
3737
<meta property="twitter:image" content={socialUrl} />
3838

39+
<!-- Style links -->
40+
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" />
41+
3942
<!-- This is intentionally inlined to avoid FOUC -->
4043
<script>
4144
const root = document.documentElement;
@@ -45,4 +48,7 @@ const socialUrl = Astro.site.href + 'assets/social.png'
4548
} else {
4649
root.classList.remove('theme-dark');
4750
}
48-
</script>
51+
</script>
52+
53+
<!-- Bootstrap -->
54+
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.bundle.min.js"></script>

src/pages/index.astro

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ const permalink = Astro.site.href;
2626

2727
<style>
2828
.home-container {
29-
font-family: 'IBM Plex Mono', monospace;
29+
font-family: var(--font-family-mono);
3030
align-items: center;
3131
display: flex;
3232
flex: 1;

src/pages/reflections/index.astro

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,8 @@ let allPosts = await Astro.glob('../../data/reflections/*.{md,mdx}')
99
allPosts = allPosts.sort((a, b) => new Date(b.frontmatter.publishDate).valueOf() - new Date(a.frontmatter.publishDate).valueOf());
1010
---
1111

12-
<BaseLayout title={title} description={description} permalink={permalink} current="blog">
12+
<BaseLayout title={title} description={description} permalink={permalink} current="reflections">
1313
<div class="container">
14-
<h1>{title}</h1>
1514
{allPosts.map((post, index) => {
1615
const href = `/reflections/${post.file.split('/').pop().split('.').shift()}`;
1716
return (

src/pages/work/index.astro

Lines changed: 24 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -9,32 +9,38 @@ let allPosts = await Astro.glob('../../data/work/*.{md,mdx}');
99
allPosts = allPosts.sort((a, b) => new Date(b.frontmatter.publishDate).valueOf() - new Date(a.frontmatter.publishDate).valueOf());
1010
---
1111

12-
<BaseLayout title={title} description={description} permalink={permalink} current="blog">
12+
<BaseLayout title={title} description={description} permalink={permalink} current="work">
13+
<div class="row row-cols-1 row-cols-md-3 g-4">
14+
15+
16+
</div>
17+
1318
<div>
14-
<h1>{title}</h1>
15-
<div class="flex-container">
19+
<div class="row row-cols-1 row-cols-md-2 g-4">
1620
{allPosts.map((post, index) => {
1721
const href = (post.frontmatter.direct_link && post.frontmatter.direct_link !== '') ? post.frontmatter.direct_link : `/work/${post.file.split('/').pop().split('.').shift()}`;
1822
const target = (post.frontmatter.direct_link && post.frontmatter.direct_link !== '') ? '_blank' : '_self';
1923
const tags = post.frontmatter.tags.split(', ');
2024
const thumbnail = `/assets/work/${post.frontmatter.thumbnail}`;
25+
2126
return (
22-
<article>
23-
<div class="post-item">
24-
<h2><a href={href} target={target}>{post.frontmatter.title}</a></h2>
25-
<p>{post.frontmatter.description}</p>
26-
<br />
27-
<a href={href} target={target}>
28-
<div class="thumbnail"></div>
29-
</a>
30-
<ul class="tags">
31-
{ tags.map(t => ( <li class="tag">{t}</li> ) )}
32-
</ul>
33-
{/* <div class="post-item-footer">
34-
<span class="post-item-date">— {post.frontmatter.publishDate}</span>
35-
</div> */}
27+
<div class="col">
28+
<div class="card">
29+
<div class="overflow-hidden thumbnail border-none">
30+
<img src={thumbnail} class="card-img-top object-fit-cover" alt={post.frontmatter.description}>
31+
</div>
32+
<div class="card-body">
33+
<h5 class="card-title">{post.frontmatter.title}</h5>
34+
<p class="card-text">{post.frontmatter.description}</p>
35+
<a href={href} target={target} class="btn btn-primary stretched-link">Read more</a>
36+
</div>
37+
<div class="card-footer">
38+
<small class="text-body-secondary">
39+
{ tags.map(t => ( <span class="badge rounded-pill text-bg-light">{t}</span> ) )}
40+
</small>
41+
</div>
3642
</div>
37-
</article>
43+
</div>
3844
)
3945
})}
4046
</div>
@@ -45,7 +51,6 @@ allPosts = allPosts.sort((a, b) => new Date(b.frontmatter.publishDate).valueOf()
4551

4652
h2,
4753
.post-item-footer {
48-
font-family: var(--font-family-mono);
4954
font-weight: 700;
5055
}
5156

src/styles/global.scss

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,13 @@
66
--text-secondary: #6b6f72;
77
--primary-color: #548e9b;
88

9-
10-
--font-family-serif: "Lato", sans-serif;
11-
--font-family-sans: Georgia, 'Times New Roman', Times, serif;
12-
--font-family-code: 'SF Mono', menlo, inconsolata, monospace;
9+
/* fonts */
10+
// --font-family-serif: "Lato", sans-serif;
11+
// --font-family-sans: Georgia, 'Times New Roman', Times, serif;
12+
// --font-family-code: 'SF Mono', menlo, inconsolata, monospace;
1313
--font-family-mono: 'IBM Plex Mono', monospace;
1414

15+
1516
--layout-medium-breakpoint: 1020px;
1617
--layout-large-breakpoint: 1280px;
1718
}
@@ -24,7 +25,7 @@
2425

2526
body {
2627
margin: 0;
27-
font-family: var(--font-family-serif);
28+
font-family: var(--font-family-mono);
2829
font-size: 16px;
2930
line-height: 1.6;
3031
background-color: var(--background-body);

0 commit comments

Comments
 (0)