From ca8e6824eaa711105f4092365792720c9dde026b Mon Sep 17 00:00:00 2001 From: Joe Carstairs Date: Thu, 18 Jun 2026 19:21:59 +0100 Subject: remove Astro website --- website/src/components/BaseHead.astro | 54 --------------- website/src/components/BlogFeed.astro | 103 ----------------------------- website/src/components/FormattedDate.astro | 23 ------- website/src/components/LinksFeed.astro | 78 ---------------------- website/src/components/Me.astro | 47 ------------- website/src/components/MicrologFeed.astro | 100 ---------------------------- website/src/components/Navbar.astro | 19 ------ website/src/components/OtpDialog.astro | 31 --------- 8 files changed, 455 deletions(-) delete mode 100644 website/src/components/BaseHead.astro delete mode 100644 website/src/components/BlogFeed.astro delete mode 100644 website/src/components/FormattedDate.astro delete mode 100644 website/src/components/LinksFeed.astro delete mode 100644 website/src/components/Me.astro delete mode 100644 website/src/components/MicrologFeed.astro delete mode 100644 website/src/components/Navbar.astro delete mode 100644 website/src/components/OtpDialog.astro (limited to 'website/src/components') diff --git a/website/src/components/BaseHead.astro b/website/src/components/BaseHead.astro deleted file mode 100644 index 360c4bb..0000000 --- a/website/src/components/BaseHead.astro +++ /dev/null @@ -1,54 +0,0 @@ ---- -interface Props { - title: string; - description?: string; - image?: string; -} - -const canonicalURL = new URL(Astro.url.pathname, Astro.site); - -const { title, description, image = '/images/headshot.jpg' } = Astro.props; ---- - - - - - - - - - - - - - - - - - - - - - - -{title} - - - - - - - - - - - - - - - - - - - - diff --git a/website/src/components/BlogFeed.astro b/website/src/components/BlogFeed.astro deleted file mode 100644 index 552fff4..0000000 --- a/website/src/components/BlogFeed.astro +++ /dev/null @@ -1,103 +0,0 @@ ---- -import type { CollectionEntry } from 'astro:content'; -import { getCollection } from 'astro:content'; -import FormattedDate from './FormattedDate.astro'; - -export interface Props { - headingLevel?: 1 | 2 | 3 | 4 | 5 | 6, - hideAuthor?: boolean, - hideSubheadings?: boolean, - maxEntries?: number, -}; - -const { headingLevel = 2, hideSubheadings = false, hideAuthor = false, maxEntries } = Astro.props; - -const allPosts = (await getCollection('blog')).filter((post) => !post.data.hidden); - -const posts = maxEntries === undefined - ? allPosts - : allPosts.sort(sortByPubDateDescending).slice(0, maxEntries); - -const distinctYears: number[] = posts - .map(post => pubDate(post).getFullYear()) - .reduce((acc, curr) => acc.includes(curr) ? acc : [...acc, curr], []) - .sort((a, b) => b - a); - -function matchesYear(year: number) { - return (post: CollectionEntry<'blog'>) => pubDate(post).getFullYear() === year; -} - -function sortByPubDateDescending(post1: CollectionEntry<'blog'>, post2: CollectionEntry<'blog'>) { - const date1 = pubDate(post1).getTime(); - const date2 = pubDate(post2).getTime(); - return date2 - date1; -} - -function pubDate(post: CollectionEntry<'blog'>): Date { - if (post.data.pubDate) { - return post.data.pubDate; - } - const date = new Date(post.id); - if (isNaN(date.valueOf())) { - throw new Error(`Post ${post.id} does not have a valid publication date.`); - } - return date; -} - -const HeadingElem = `h${headingLevel} class="p-name"`; -const SubHeadingElem = `h${headingLevel + 1}`; -const SubSubHeadingElem = `h${headingLevel + 2}`; -const AuthorElem = `p${hideAuthor ? " hidden" : ""}`; - -const canonicalBlogUrl = new URL('blog', Astro.site) ---- - -
- - My blog - - - - - - - { hideSubheadings - ?
    - { posts.sort(sortByPubDateDescending).map(post => ( -
  • - - {post.data.title} - -

    - -

  • - )) } -
- : distinctYears.map(year => ( - {year} -
    - { posts.filter(matchesYear(year)).sort(sortByPubDateDescending).map(post => ( -
  • - - {post.data.title} - -

    - -

  • - )) } -
- )) } - - { (maxEntries !== undefined && maxEntries < allPosts.length) - ? - : <> - } -
diff --git a/website/src/components/FormattedDate.astro b/website/src/components/FormattedDate.astro deleted file mode 100644 index ce700f1..0000000 --- a/website/src/components/FormattedDate.astro +++ /dev/null @@ -1,23 +0,0 @@ ---- -interface Props { - className?: string; - date: Date | string; - hidden?: boolean; -} - -let { className, date, hidden } = Astro.props; -if (typeof(date) === 'string') { - date = new Date(date); -} -const dateStr = - date.toLocaleDateString('en-GB', { - year: 'numeric', - month: 'long', - day: 'numeric', - }); ---- - -{ hidden - ? - : -} diff --git a/website/src/components/LinksFeed.astro b/website/src/components/LinksFeed.astro deleted file mode 100644 index 1d837f0..0000000 --- a/website/src/components/LinksFeed.astro +++ /dev/null @@ -1,78 +0,0 @@ ---- -import FormattedDate from '../components/FormattedDate.astro'; -import allLinks from '../data/links.ts'; - -type Link = (typeof allLinks)[number]; - -export interface Props { - headingLevel?: 1 | 2 | 3 | 4 | 5 | 6, - hideAuthor?: boolean, - maxEntries?: number, -}; - -const { headingLevel = 2, hideAuthor = false, maxEntries } = Astro.props; - -const headingElem = `h${headingLevel}`; -const subHeadingElem = `h${headingLevel + 1}` - -const links: Link[] = maxEntries === undefined - ? allLinks - : allLinks.sort(sortByDateAddedDescending).slice(0, maxEntries); - -const distinctYears: string[] = links - .map(link => link.isoDateAdded.slice(0,4)) - .reduce((acc, curr) => acc.includes(curr) ? acc : [...acc, curr], []) - .sort((a, b) => Number.parseInt(b) - Number.parseInt(a)); - -function matchesYear(year: string) { - return (link: (typeof links)[number]) => link.isoDateAdded.slice(0,4) === year; -} - -function sortByDateAddedDescending(link1: (typeof links)[number], link2: (typeof links)[number]) { - const date1 = new Date(link1.isoDateAdded).getTime(); - const date2 = new Date(link2.isoDateAdded).getTime(); - return date2 - date1; -} - -const canonicalLinksUrl = new URL('links', Astro.site) ---- - -
- - My links - - `} /> - - - - { distinctYears.map(year => ( - - ${year} - - `} /> -
    - { links.filter(matchesYear(year)).sort(sortByDateAddedDescending).map(link => ( -
  • - - -

    -

  • - )) } -
- )) } - - { (maxEntries !== undefined && maxEntries < allLinks.length) - ? - : <> - } -
diff --git a/website/src/components/Me.astro b/website/src/components/Me.astro deleted file mode 100644 index 71d2f10..0000000 --- a/website/src/components/Me.astro +++ /dev/null @@ -1,47 +0,0 @@ ---- ---- - -
-
- -
- -
-

- Joe Carstairs -

- - -
- -
-

- Hi! šŸ‘‹ My name is Joe - Carstairs. I’m a - software developer at - Scott Logic, - a Divinity student at the University of Edinburgh, - a lapsed fiddle player and a very occasional poet. -

- -

- HMU with your thoughts on Elizabethan poetry, connecting to the - Internet, and the Apocalypse of Saint John. -

- -

- - Or get me on - Facebook, - Mastodon, - LinkedIn, - BlueSky, - or GitHub. - -

-
-
diff --git a/website/src/components/MicrologFeed.astro b/website/src/components/MicrologFeed.astro deleted file mode 100644 index b4941b1..0000000 --- a/website/src/components/MicrologFeed.astro +++ /dev/null @@ -1,100 +0,0 @@ ---- -import type { CollectionEntry } from 'astro:content'; -import { getCollection } from 'astro:content'; -import FormattedDate from './FormattedDate.astro'; -import { renderGemtextToHtml } from '../renderGemtextToHtml'; - -export interface Props { - headingLevel?: 1 | 2 | 3 | 4 | 5 | 6, - hideAuthor?: boolean, - hideSubheadings?: boolean, - maxEntries?: number, -}; - -const { headingLevel = 2, hideSubheadings = false, hideAuthor = false, maxEntries } = Astro.props; - -const allPosts = await getCollection('microlog'); - -const posts = maxEntries === undefined - ? allPosts - : allPosts.sort(sortByIdDescending).slice(0, maxEntries); - -const distinctYears: number[] = posts - .map(post => pubDate(post).getFullYear()) - .reduce((acc, curr) => acc.includes(curr) ? acc : [...acc, curr], []) - .sort((a, b) => b - a); - -function matchesYear(year: number) { - return (post: CollectionEntry<'microlog'>) => pubDate(post).getFullYear() === year; -} - -function sortByIdDescending(post1: CollectionEntry<'microlog'>, post2: CollectionEntry<'microlog'>) { - return post2.id.localeCompare(post1.id); -} - -function pubDate(post: CollectionEntry<'microlog'>): Date { - console.warn(post.id); - const date = new Date(post.id.replace(/\.[0-9]+$/g, '')); - if (isNaN(date.valueOf())) { - throw new Error(`Post ${post.id} does not have a valid publication date.`); - } - return date; -} - -const HeadingElem = `h${headingLevel} class="p-name"`; -const SubHeadingElem = `h${headingLevel + 1}`; -const SubSubHeadingElem = `h${headingLevel + 2}`; -const AuthorElem = `p${hideAuthor ? " hidden" : ""}`; - -const canonicalMicrologUrl = new URL('microlog', Astro.site) ---- - -
- - My microlog - - - - - - - { hideSubheadings - ?
    - { posts.sort(sortByIdDescending).map(post => ( -
  • - - {post.id} - -
    -
  • - )) } -
- : distinctYears.map(year => ( - {year} -
    - { posts.filter(matchesYear(year)).sort(sortByIdDescending).map(post => ( -
  • - - {post.id} - -
    -
  • - )) } -
- )) } - - { (maxEntries !== undefined && maxEntries < allPosts.length) - ? - : <> - } -
diff --git a/website/src/components/Navbar.astro b/website/src/components/Navbar.astro deleted file mode 100644 index 0fe5b32..0000000 --- a/website/src/components/Navbar.astro +++ /dev/null @@ -1,19 +0,0 @@ ---- ---- - - diff --git a/website/src/components/OtpDialog.astro b/website/src/components/OtpDialog.astro deleted file mode 100644 index 1fd5fe9..0000000 --- a/website/src/components/OtpDialog.astro +++ /dev/null @@ -1,31 +0,0 @@ ---- ---- - - - - - - -
-

- I've sent a six-digit code to your email address. - Let me know what it is, so I can confirm this really is your email address. The - code will be valid for five minutes. -

- -
- - - - - - -
- - - -
-
-
-- cgit v1.2.3