-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
f98073a
commit 00a7d8e
Showing
21 changed files
with
138 additions
and
94 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
--- | ||
const { title } = Astro.props; | ||
import '../styles/global.css'; | ||
--- | ||
|
||
<html lang="en"> | ||
<head> | ||
<link rel="icon" type="image/svg+xml" href="/favicon.ico" /> | ||
<meta name="viewport" content="width=device-width" /> | ||
<meta name="generator" content={Astro.generator} /> | ||
<meta charset="utf-8" /> | ||
<title>{title}</title> | ||
</head> | ||
|
||
<body> | ||
<main> | ||
<slot /> | ||
</main> | ||
</body> | ||
</html> | ||
|
||
<style> | ||
body { | ||
display: flex; | ||
justify-content: center; | ||
margin: 20px 50px 0 50px; | ||
background-color: #e9e9f7; | ||
} | ||
main { | ||
max-width: 1000px; | ||
} | ||
</style> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
--- | ||
import { getCollection } from "astro:content"; | ||
import PostListItem from "./PostListItem.astro"; | ||
async function getAllPosts() { | ||
let posts = await getCollection("posts"); | ||
posts.sort((a, b) => { | ||
if (a.data.publishDate < b.data.publishDate) { | ||
return 1; | ||
} else if (a.data.publishDate > b.data.publishDate) { | ||
return -1; | ||
} else { | ||
const aSortOrder = a.data.sortOrder === undefined ? 1 : a.data.sortOrder; | ||
const bSortOrder = b.data.sortOrder === undefined ? 1 : b.data.sortOrder; | ||
return bSortOrder - aSortOrder; | ||
} | ||
}); | ||
return posts; | ||
} | ||
const allPosts = await getAllPosts(); | ||
--- | ||
|
||
<div id="post-list"> | ||
{allPosts.map((post) => <PostListItem post={post} />)} | ||
</div> | ||
|
||
<style> | ||
div { | ||
display: grid; | ||
grid-template-columns: max-content 1fr; | ||
row-gap: 10px; | ||
column-gap: 30px; | ||
} | ||
</style> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
--- | ||
const { post } = Astro.props; | ||
function formatDate(date) { | ||
return new Date(date).toLocaleDateString("en-GB", { | ||
year: "numeric", | ||
month: "short", | ||
day: "numeric", | ||
}); | ||
} | ||
--- | ||
|
||
{formatDate(post.data.publishDate)} | ||
<a href={`posts/${post.slug}`}>{post.data.title}</a> | ||
|
||
<style> | ||
li { | ||
style: none; | ||
} | ||
</style> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,5 @@ | ||
--- | ||
title: "First Night of the Proms" | ||
description: "" | ||
publishDate: "2024-07-19" | ||
tags: ["bbc-proms"] | ||
--- | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,73 +1,40 @@ | ||
--- | ||
import { getCollection } from "astro:content"; | ||
const title = "A penny for..."; | ||
import Page from "../components/Page.astro"; | ||
import PostList from "../components/PostList.astro"; | ||
async function getAllPosts() { | ||
let posts = await getCollection("posts"); | ||
posts.sort((a, b) => { | ||
if (a.data.publishDate < b.data.publishDate) { | ||
return 1; | ||
} else if (a.data.publishDate > b.data.publishDate) { | ||
return -1; | ||
} else { | ||
const aSortOrder = a.data.sortOrder === undefined ? 1 : a.data.sortOrder; | ||
const bSortOrder = b.data.sortOrder === undefined ? 1 : b.data.sortOrder; | ||
return aSortOrder - bSortOrder; | ||
} | ||
}); | ||
return posts; | ||
} | ||
const overallTitle = "A penny for..."; | ||
const allPosts = await getAllPosts(); | ||
--- | ||
|
||
<html lang="en"> | ||
<head> | ||
<meta charset="utf-8" /> | ||
<link rel="icon" type="image/svg+xml" href="/favicon.ico" /> | ||
<meta name="viewport" content="width=device-width" /> | ||
<meta name="generator" content={Astro.generator} /> | ||
<title>{title}</title> | ||
</head> | ||
<body> | ||
<h1>{title}</h1> | ||
<Page title={overallTitle}> | ||
<h1>{overallTitle}</h1> | ||
|
||
<p> | ||
At long last I’ve decided to start collecting classical music | ||
concerts that I’ve attended. I’ll try to talk a little bit | ||
about what I enjoyed (or did not enjoy) about each of them with some | ||
justification, although these are of course all subjective, and are not | ||
intended as a review of how <i>good</i> the performance was. Unfortunately | ||
I don’t have full records of concerts before 2024, although I’m | ||
trying to add those I still remember. | ||
</p> | ||
<p> | ||
At long last I’ve decided to start collecting classical music concerts | ||
that I’ve attended. I’ll try to talk a little bit about what I | ||
enjoyed (or did not enjoy) about each of them with some justification, | ||
although these are of course all subjective, and are not intended as a | ||
review of how <i>good</i> the performance was. Unfortunately I don’t have | ||
full records of concerts before 2024, although I’m trying to add those | ||
I still remember. | ||
</p> | ||
|
||
<p> | ||
I’m a software engineer at my day job. I love writing Haskell, but | ||
realistically most of my job is <s>Python</s> | ||
<s>Julia</s> GitHub Actions. If I have lots of spare time I might write a bit | ||
about programming or other stuff, but no promises. You can find me on GitHub | ||
at <a href="https://github.com/penelopeysm" target="_blank" | ||
>@penelopeysm</a | ||
>. | ||
</p> | ||
<p> | ||
I’m a software engineer at my day job. I love writing Haskell, but | ||
realistically most of my job is <s>Python</s> | ||
<s>Julia</s> GitHub Actions. If I have lots of spare time I might write a bit | ||
about programming or other stuff, but no promises. You can find me on GitHub | ||
at <a href="https://github.com/penelopeysm" target="_blank">@penelopeysm</a | ||
>. | ||
</p> | ||
|
||
<p> | ||
This blog is done using Astro. The layout is extremely bare-bones at the | ||
moment because I'm redoing it from scratch instead of using a template. | ||
Hopefully you like the late-1990s aesthetic. | ||
</p> | ||
<p> | ||
This blog is done using Astro. The layout is extremely bare-bones at the | ||
moment because I'm redoing it from scratch instead of using a template. That | ||
will, hopefully, force me to actually learn how Astro works, and also let me | ||
customise it more to my liking. | ||
</p> | ||
|
||
<h2>Posts</h2> | ||
<ul> | ||
{ | ||
allPosts.map((post) => ( | ||
<li> | ||
{post.data.publishDate}: | ||
<a href={`posts/${post.slug}`}>{post.data.title}</a> | ||
</li> | ||
)) | ||
} | ||
</ul> | ||
</body> | ||
</html> | ||
<h2>Posts</h2> | ||
<PostList /> | ||
</Page> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
@import url('https://fonts.googleapis.com/css2?family=Fira+Sans:ital,wght@0,400;0,600;1,400;1,600&display=swap'); | ||
|
||
html { | ||
font-family: "Fira Sans", sans-serif; | ||
box-sizing: border-box; | ||
font-size: 14px; | ||
line-height: 1.5; | ||
} |