From 148fe8eeffeb377ce8006c5126625e7d338a4db7 Mon Sep 17 00:00:00 2001 From: Alex Lebens Date: Sun, 15 Mar 2026 16:56:54 -0500 Subject: [PATCH 01/14] feat: add and update pre-commit --- .pre-commit-config.yaml | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 .pre-commit-config.yaml diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml new file mode 100644 index 0000000..f4d61b6 --- /dev/null +++ b/.pre-commit-config.yaml @@ -0,0 +1,17 @@ +repos: + - repo: https://github.com/pre-commit/pre-commit-hooks + rev: v6.0.0 + hooks: + - id: end-of-file-fixer + - id: trailing-whitespace + - id: check-merge-conflict + - id: check-json + - repo: https://github.com/pre-commit/mirrors-prettier + rev: v4.0.0-alpha.11 + hooks: + - id: prettier + types_or: [javascript, typescript, css, scss, html, json, yaml, markdown] + additional_dependencies: + - prettier + - prettier-plugin-astro + - prettier-plugin-tailwindcss From 9319228ef6df0039dc8ee6ab88882f2e5e044d14 Mon Sep 17 00:00:00 2001 From: Alex Lebens Date: Sun, 15 Mar 2026 20:02:27 -0500 Subject: [PATCH 02/14] feat: change paths --- tsconfig.json | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/tsconfig.json b/tsconfig.json index 8df272f..76a0fbb 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -4,20 +4,21 @@ "exclude": ["dist"], "compilerOptions": { "strictNullChecks": true, - "baseUrl": "src", + "baseUrl": ".", "jsx": "react-jsx", + "jsxImportSource": "react", "types": ["astro/client"], "paths": { - "@/*": ["*"], + "@/*": ["src/*"], "@src/*": ["src/*"], - "@lib/*": ["lib/*"], - "@components/*": ["components/*"], - "@content/*": ["content/*"], - "@layouts/*": ["layouts/*"], - "@styles/*": ["styles/*"], - "@pages/*": ["pages/*"], - "@support/*": ["support/*"], - "@images/*": ["images/*"] + "@lib/*": ["src/lib/*"], + "@components/*": ["src/components/*"], + "@content/*": ["src/content/*"], + "@layouts/*": ["src/layouts/*"], + "@styles/*": ["src/styles/*"], + "@pages/*": ["src/pages/*"], + "@support/*": ["src/support/*"], + "@images/*": ["src/images/*"] } } } From a6c889f76a2e55e2efe8a19ffdacdb7327dd0116 Mon Sep 17 00:00:00 2001 From: Alex Lebens Date: Sun, 15 Mar 2026 21:10:08 -0500 Subject: [PATCH 03/14] fix: change execution mode --- src/components/buttons/ThemeToggleButton.astro | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/components/buttons/ThemeToggleButton.astro b/src/components/buttons/ThemeToggleButton.astro index 69b5b6a..f490579 100644 --- a/src/components/buttons/ThemeToggleButton.astro +++ b/src/components/buttons/ThemeToggleButton.astro @@ -43,13 +43,12 @@ + + From 641c7cb33feec65b185d307a7cf1c9879b884a03 Mon Sep 17 00:00:00 2001 From: Alex Lebens Date: Sun, 15 Mar 2026 21:53:59 -0500 Subject: [PATCH 05/14] feat: move scripts to script folder --- astro.config.mjs | 2 +- src/components/cards/BlogCard.astro | 2 +- src/components/cards/CategoryCard.astro | 2 +- src/components/cards/EducationCard.astro | 2 +- src/components/cards/LargeBlogLeftCard.astro | 2 +- src/components/cards/LargeBlogRightCard.astro | 2 +- src/components/cards/LargeCategoryCard.astro | 2 +- src/components/cards/LargeInvisibleCard.astro | 2 +- src/components/cards/LargeLinkCard.astro | 2 +- src/components/sections/CategorySection.astro | 2 +- src/components/sections/HeaderSection.astro | 2 +- src/components/sections/HeroSection.astro | 2 +- src/components/sections/WeatherSection.astro | 2 +- .../snippets/PostMetadataSnippet.astro | 4 +- src/layouts/BaseLayout.astro | 90 ++----------------- src/lib/directus.ts | 2 +- src/pages/blog/[...slug].astro | 2 +- src/scripts/animations.ts | 31 +++++++ src/scripts/photoswipe.ts | 38 ++++++++ src/{support => scripts}/time.ts | 0 src/{support => scripts}/url.ts | 0 src/{support => scripts}/weather.ts | 0 tsconfig.json | 2 +- 23 files changed, 96 insertions(+), 99 deletions(-) create mode 100644 src/scripts/animations.ts create mode 100644 src/scripts/photoswipe.ts rename src/{support => scripts}/time.ts (100%) rename src/{support => scripts}/url.ts (100%) rename src/{support => scripts}/weather.ts (100%) diff --git a/astro.config.mjs b/astro.config.mjs index d29b12d..fad6358 100644 --- a/astro.config.mjs +++ b/astro.config.mjs @@ -8,7 +8,7 @@ import tailwindcss from '@tailwindcss/vite'; import icon from 'astro-icon'; import swup from '@swup/astro'; -import { getSiteURL } from './src/support/url'; +import { getSiteURL } from './src/scripts/url'; export default defineConfig({ site: getSiteURL(), diff --git a/src/components/cards/BlogCard.astro b/src/components/cards/BlogCard.astro index 7514d8a..d0da521 100644 --- a/src/components/cards/BlogCard.astro +++ b/src/components/cards/BlogCard.astro @@ -4,7 +4,7 @@ import { Image } from 'astro:assets'; import type { Post } from '@lib/directusTypes'; import PostMetadataSnippet from '@/components/snippets/PostMetadataSnippet.astro'; -import { getDirectusImageURL } from '@/support/url'; +import { getDirectusImageURL } from '@/scripts/url'; interface Props { post: Post; diff --git a/src/components/cards/CategoryCard.astro b/src/components/cards/CategoryCard.astro index ef1983f..583ef09 100644 --- a/src/components/cards/CategoryCard.astro +++ b/src/components/cards/CategoryCard.astro @@ -1,6 +1,6 @@ --- import Logo from '@components/images/Logo.astro'; -import { getDirectusImageURL } from '@/support/url'; +import { getDirectusImageURL } from '@/scripts/url'; interface Props { slug: string; diff --git a/src/components/cards/EducationCard.astro b/src/components/cards/EducationCard.astro index 79d3dbb..7d7fabc 100644 --- a/src/components/cards/EducationCard.astro +++ b/src/components/cards/EducationCard.astro @@ -2,7 +2,7 @@ import { Icon } from 'astro-icon/components'; import Logo from '@components/images/Logo.astro'; -import { getDirectusImageURL } from '@/support/url'; +import { getDirectusImageURL } from '@/scripts/url'; interface Props { topic: string; diff --git a/src/components/cards/LargeBlogLeftCard.astro b/src/components/cards/LargeBlogLeftCard.astro index 01cc885..8993e9c 100644 --- a/src/components/cards/LargeBlogLeftCard.astro +++ b/src/components/cards/LargeBlogLeftCard.astro @@ -5,7 +5,7 @@ import type { Post } from '@lib/directusTypes'; import ReadMoreButton from '@components/buttons/ReadMoreButton.astro'; import PostMetadataSnippet from '@/components/snippets/PostMetadataSnippet.astro'; -import { getDirectusImageURL } from '@/support/url'; +import { getDirectusImageURL } from '@/scripts/url'; interface Props { post: Post; diff --git a/src/components/cards/LargeBlogRightCard.astro b/src/components/cards/LargeBlogRightCard.astro index 3fead59..18a6bae 100644 --- a/src/components/cards/LargeBlogRightCard.astro +++ b/src/components/cards/LargeBlogRightCard.astro @@ -5,7 +5,7 @@ import type { Post } from '@lib/directusTypes'; import ReadMoreButton from '@components/buttons/ReadMoreButton.astro'; import PostMetadataSnippet from '@/components/snippets/PostMetadataSnippet.astro'; -import { getDirectusImageURL } from '@/support/url'; +import { getDirectusImageURL } from '@/scripts/url'; interface Props { post: Post; diff --git a/src/components/cards/LargeCategoryCard.astro b/src/components/cards/LargeCategoryCard.astro index eda6cf1..4a116df 100644 --- a/src/components/cards/LargeCategoryCard.astro +++ b/src/components/cards/LargeCategoryCard.astro @@ -1,6 +1,6 @@ --- import Logo from '@components/images/Logo.astro'; -import { getDirectusImageURL } from '@/support/url'; +import { getDirectusImageURL } from '@/scripts/url'; interface Props { url: string; diff --git a/src/components/cards/LargeInvisibleCard.astro b/src/components/cards/LargeInvisibleCard.astro index 7ca7c0a..e68fe26 100644 --- a/src/components/cards/LargeInvisibleCard.astro +++ b/src/components/cards/LargeInvisibleCard.astro @@ -2,7 +2,7 @@ import { Icon } from 'astro-icon/components'; import { Image } from 'astro:assets'; -import { getDirectusImageURL } from '@/support/url'; +import { getDirectusImageURL } from '@/scripts/url'; interface Props { title: string; diff --git a/src/components/cards/LargeLinkCard.astro b/src/components/cards/LargeLinkCard.astro index 3b0d461..d2a9e31 100644 --- a/src/components/cards/LargeLinkCard.astro +++ b/src/components/cards/LargeLinkCard.astro @@ -1,7 +1,7 @@ --- import ReadMoreButton from '@components/buttons/ReadMoreButton.astro'; import Logo from '@components/images/Logo.astro'; -import { getDirectusImageURL } from '@/support/url'; +import { getDirectusImageURL } from '@/scripts/url'; interface Props { title: string; diff --git a/src/components/sections/CategorySection.astro b/src/components/sections/CategorySection.astro index 8481c97..544a715 100644 --- a/src/components/sections/CategorySection.astro +++ b/src/components/sections/CategorySection.astro @@ -6,7 +6,7 @@ import type { Post } from '@lib/directusTypes'; import CategoryCard from '@components/cards/CategoryCard.astro'; import LargeCategoryCard from '@components/cards/LargeCategoryCard.astro'; import directus from '@lib/directus'; -import { formatFromNow } from '@support/time'; +import { formatFromNow } from '@/scripts/time'; const global = await directus.request(readSingleton('site_global')); diff --git a/src/components/sections/HeaderSection.astro b/src/components/sections/HeaderSection.astro index c82ac1c..8de8ef1 100644 --- a/src/components/sections/HeaderSection.astro +++ b/src/components/sections/HeaderSection.astro @@ -1,7 +1,7 @@ --- import GoLinkPrimaryButton from '@components/buttons/GoLinkPrimaryButton.astro'; import Logo from '@components/images/Logo.astro'; -import { getDirectusImageURL } from '@/support/url'; +import { getDirectusImageURL } from '@/scripts/url'; interface Props { title: string; diff --git a/src/components/sections/HeroSection.astro b/src/components/sections/HeroSection.astro index 95f092f..dae4859 100644 --- a/src/components/sections/HeroSection.astro +++ b/src/components/sections/HeroSection.astro @@ -7,7 +7,7 @@ import type { HeaderImage } from '@lib/directusTypes'; import GoLinkPrimaryButton from '@components/buttons/GoLinkPrimaryButton.astro'; import GoLinkSecondaryButton from '@components/buttons/GoLinkSecondaryButton.astro'; import directus from '@lib/directus'; -import { getDirectusImageURL } from '@/support/url'; +import { getDirectusImageURL } from '@/scripts/url'; interface Props { title: string; diff --git a/src/components/sections/WeatherSection.astro b/src/components/sections/WeatherSection.astro index fb3bb2c..ac57a02 100644 --- a/src/components/sections/WeatherSection.astro +++ b/src/components/sections/WeatherSection.astro @@ -1,6 +1,6 @@ --- import WeatherCard from '@components/cards/WeatherCard.astro'; -import { getFiveDayForecast } from '@support/weather'; +import { getFiveDayForecast } from '@/scripts/weather'; const { latitude = "44.95", longitude = "-93.09", cityName = "St. Paul, Minnesota", timezone = "America/Chicago" } = Astro.props; diff --git a/src/components/snippets/PostMetadataSnippet.astro b/src/components/snippets/PostMetadataSnippet.astro index 5ea4c81..36246d0 100644 --- a/src/components/snippets/PostMetadataSnippet.astro +++ b/src/components/snippets/PostMetadataSnippet.astro @@ -4,8 +4,8 @@ import getReadingTime from 'reading-time'; import type { Post } from '@lib/directusTypes'; import Logo from '@components/images/Logo.astro'; -import { formatShortDate, formatDate } from '@support/time'; -import { getDirectusImageURL } from '@/support/url'; +import { formatShortDate, formatDate } from '@/scripts/time'; +import { getDirectusImageURL } from '@/scripts/url'; interface Props { post: Post; diff --git a/src/layouts/BaseLayout.astro b/src/layouts/BaseLayout.astro index ef49e6c..dae7e92 100644 --- a/src/layouts/BaseLayout.astro +++ b/src/layouts/BaseLayout.astro @@ -101,16 +101,22 @@ const normalizeTitle = !title ? global.name : `${title} | ${global.name}`; - - - -