From 86450b3dd8bec3b76e2b2a03b8cdc8a708c5f3bc Mon Sep 17 00:00:00 2001 From: Joe Carstairs <65492573+joeacarstairs@users.noreply.github.com> Date: Sun, 5 May 2024 21:00:40 +0100 Subject: Infrastructure as code (#3) * Moves website to website/ * Adds terraform gitignores * Terraform with AWS provider * Initialises Terraform * Locals and variables for provider * Fetches SSL certificate from ACM * S3 static website bucket * CloudFront distribution * Route53 records * Deployment workflow uses secret S3 bucket suffix * Adds README --------- Co-authored-by: Joe Carstairs <65492573+Sycamost@users.noreply.github.com> --- src/components/BaseHead.astro | 44 ---------------------- src/components/BlogFeed.astro | 76 -------------------------------------- src/components/FormattedDate.astro | 21 ----------- src/components/Me.astro | 43 --------------------- 4 files changed, 184 deletions(-) delete mode 100644 src/components/BaseHead.astro delete mode 100644 src/components/BlogFeed.astro delete mode 100644 src/components/FormattedDate.astro delete mode 100644 src/components/Me.astro (limited to 'src/components') diff --git a/src/components/BaseHead.astro b/src/components/BaseHead.astro deleted file mode 100644 index e8e44ab..0000000 --- a/src/components/BaseHead.astro +++ /dev/null @@ -1,44 +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/src/components/BlogFeed.astro b/src/components/BlogFeed.astro deleted file mode 100644 index b6f9d55..0000000 --- a/src/components/BlogFeed.astro +++ /dev/null @@ -1,76 +0,0 @@ ---- -import type { CollectionEntry } from 'astro:content'; -import { getCollection } from 'astro:content'; - -export interface Props { - headingLevel?: 1 | 2 | 3 | 4 | 5 | 6, - hideAuthor?: boolean, -}; - -const { headingLevel = 2, hideAuthor = false } = Astro.props; - -const posts = (await getCollection('blog')); - -const distinctYears: number[] = posts - .map(post => post.data.pubDate.year) - .reduce((acc, curr) => acc.includes(curr) ? acc : [...acc, curr], []) - .sort((a, b) => b - a); - -function matchesYear(year: number) { - return (post: CollectionEntry<'blog'>) => post.data.pubDate.year === year; -} - -function sortByPubDateDescending(post1: CollectionEntry<'blog'>, post2: CollectionEntry<'blog'>) { - const year1 = post1.data.pubDate.year; - const year2 = post2.data.pubDate.year; - const month1 = post1.data.pubDate.month; - const month2 = post2.data.pubDate.month; - const day1 = post1.data.pubDate.day; - const day2 = post2.data.pubDate.day; - - if (year1 !== year2) { - return year2 - year1; - } else if (month1 !== month2) { - return month2 - month1; - } else { - return day2 - day1; - } -} - -const headingElem = `h${headingLevel}`; - -const canonicalBlogUrl = new URL('blog', Astro.site) ---- - -
- - My blog - - `} /> - - - -
    - { distinctYears.map(year => ( -
  • - {year} -
      - { posts.filter(matchesYear(year)).sort(sortByPubDateDescending).map(post => ( -
    • - {post.data.title} -
    • - )) } -
    -
  • - )) } -
-
\ No newline at end of file diff --git a/src/components/FormattedDate.astro b/src/components/FormattedDate.astro deleted file mode 100644 index bb7a2c0..0000000 --- a/src/components/FormattedDate.astro +++ /dev/null @@ -1,21 +0,0 @@ ---- -interface Props { - className?: string; - date: Date | string; -} - -let { className, date } = Astro.props; -if (typeof(date) === 'string') { - date = new Date(date); -} ---- - - diff --git a/src/components/Me.astro b/src/components/Me.astro deleted file mode 100644 index c9af587..0000000 --- a/src/components/Me.astro +++ /dev/null @@ -1,43 +0,0 @@ ---- ---- - -
- - -
-

- - Joe Carstairs - -

- -

- Hi! 👋 My name is Joe - Carstairs. I’m a - software developer at - Scott Logic, a - graduate of Philosophy and Mathematics at the University of Edinburgh, - a committed Christian and a pretty rubbish poet. -

- -

- I’m also the secretary of the - Scots Language Society. - Help me maintain our website! -

- -

- Email me at - joeacarstairs@gmail.com - with your thoughts on metaethics, Scots verse and eschatology. -

- -

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

-
-
\ No newline at end of file -- cgit v1.2.3