Repo improvements: CI on PRs, code consolidation, Shiki highlighting#12
Merged
Conversation
- 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.
1e83702 to
bba300d
Compare
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
A cleanup pass over the codebase, workflows, and dependencies.
CI / workflow
prettier --check, which previously never ran in CICode consolidation
src/lib/posts.tswithgetSortedPosts()/formatPostDate(), replacing three divergent sort implementations and two duplicated date formattersgetStaticPathsinstead of re-fetching the collectiontoLocalDatepreprocess hack from the content schemasiteMetadataconverted to TypeScript and made the single source of the site URL (imported byastro.config.mjs)SEO / accuracy fixes
rel=canonical, useog:type: articleon blog postshttps://schema.orgitemtypes, LinkedIn capitalization, inline styles moved intoglobal.cssSyntax highlighting
one-lighttheme; ~110 lines of hand-maintained Prism token CSS replaced by a singlepre.astro-coderuleDependencies