Skip to content

Monday, March 9

Git Commits

days commits 11 ohnsh/days
  • 8:46 pm — John Sherrell <dev@ohn.sh>

    New paginated latest posts feed. It will soon be the default (index) route. Had to get a little hacky to get pagination working within Starlight's template system. This endpoint is outside of Starlight's regular scope but renders a <StarlightPage> layout component, so it looks identical.

  • 7:44 pm — John Sherrell <dev@ohn.sh>

    Extract `getCollection` procedure into a util function `getPosts`.

  • 4:23 pm — John Sherrell <dev@ohn.sh>

    Add color to dark them accent color, clean up CSS, make code blocks consistent.

  • 3:28 pm — John Sherrell <dev@ohn.sh>

    Refactor to allow index page (and others) to force og:image in frontmatter.

  • 12:53 pm — John Sherrell <dev@ohn.sh>

    Fixed og:image bug on index page. routeData.ts improvements. Use content collection filtering API with `getCollection`. The index entry has id `index` when returned by `getCollection` but it's the empty string when accessed through `Astro.locals.starlightRoute`.

  • 3:12 am — John Sherrell <dev@ohn.sh>

    Minor fix to favicon code snippet.

  • 2:58 am — John Sherrell <dev@ohn.sh>

    New apple-touch-icon.

  • 2:28 am — John Sherrell <dev@ohn.sh>

    Remove early return in middleware that was preventing og:image tags on index page.

  • 1:45 am — John Sherrell <dev@ohn.sh>

    Add 9th, tweak GithubDay styles.

  • 1:32 am — John Sherrell <dev@ohn.sh>

    Added today's run.

  • 12:50 am — John Sherrell <dev@ohn.sh>

    Brought in Github day-loader from scratch project. Had to change dynamic imports in content loader to `import.meta.glob` to make Vite happy. The `eager` option is crucial; without it the imports are still basically dynamic and Vite crashes. Unfortunately, components rendered in mdx can't automatically detect *which day* they're being rendered for on the index page, where the route information doesn't help. I've tried a bunch of things, including @astropub/context, but nothing seems to work. For now, it will be necessary to pass a `date` prop in each mdx file. Which makes perfect sense, but it's going to add up to a lot of date props.

scratch commits 1 ohnsh/scratch
  • 1:31 am — John Sherrell <dev@ohn.sh>

    Brought over fixes from days. Dynamic JSON imports in the github content loader were breaking Vite builds.

YouTube