Skip to content

Repo improvements: CI on PRs, code consolidation, Shiki highlighting#12

Merged
amaechler merged 5 commits into
mainfrom
repo-improvements
Jun 12, 2026
Merged

Repo improvements: CI on PRs, code consolidation, Shiki highlighting#12
amaechler merged 5 commits into
mainfrom
repo-improvements

Conversation

@amaechler

Copy link
Copy Markdown
Owner

Summary

A cleanup pass over the codebase, workflows, and dependencies.

CI / workflow

  • Build pull requests in CI (deploy job skipped for PRs) so changes get feedback before merge
  • Add a format job running prettier --check, which previously never ran in CI
  • Only cancel superseded PR builds; never cancel an in-progress production deploy, per GitHub's Pages guidance

Code consolidation

  • New src/lib/posts.ts with getSortedPosts() / formatPostDate(), replacing three divergent sort implementations and two duplicated date formatters
  • Prev/next posts passed as props from getStaticPaths instead of re-fetching the collection
  • Dates formatted in UTC, removing the toLocalDate preprocess hack from the content schema
  • siteMetadata converted to TypeScript and made the single source of the site URL (imported by astro.config.mjs)

SEO / accuracy fixes

  • Real meta description for the homepage (was a sentence fragment)
  • Add rel=canonical, use og:type: article on blog posts
  • https://schema.org itemtypes, LinkedIn capitalization, inline styles moved into global.css

Syntax highlighting

  • Switch from Prism to Astro's default Shiki highlighter with the one-light theme; ~110 lines of hand-maintained Prism token CSS replaced by a single pre.astro-code rule
  • Verified visually: code blocks render with a soft grey background and subtle border

Dependencies

  • astro 6.4.5, prettier 3.8.4, lefthook 2.1.9

- Run the build on pull requests so changes get feedback before merge
  (deploy job is skipped for PRs)
- Add a format job that runs prettier --check, which previously never
  ran in CI
- Only cancel superseded PR builds; never cancel a production
  deployment mid-run, per GitHub's Pages guidance
- Add src/lib/posts.ts with getSortedPosts() and formatPostDate(),
  replacing three divergent sort implementations and two duplicated
  date formatters; prev/next posts are now passed as props from
  getStaticPaths instead of re-fetching the collection
- Format dates in UTC and drop the toLocalDate preprocess hack from
  the content schema (plain z.coerce.date now suffices)
- Rename siteMetadata.js to .ts, give the site a real meta description
  (it was a sentence fragment), and remove dead fallbacks for
  Astro.site / context.site
- Add rel=canonical, use og:type article on blog posts, fix LinkedIn
  capitalization
- Move inline styles into global.css, use https schema.org URLs,
  correct the empty-state path hint
Use Astro's default Shiki highlighter with the github-light theme,
replacing ~110 lines of hand-maintained Prism token CSS with a single
pre.astro-code rule. Also source the site URL from siteMetadata so it
is defined in one place.
@amaechler amaechler force-pushed the repo-improvements branch from 1e83702 to bba300d Compare June 12, 2026 22:50
@amaechler amaechler merged commit 0c07a7e into main Jun 12, 2026
3 checks passed
@amaechler amaechler deleted the repo-improvements branch June 12, 2026 22:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant