Skip to content

Latest πŸ—žοΈ

Wednesday, March 11

Git Commits

days commits 13 ohnsh/days
  • 10:17 pm β€” John Sherrell <dev@ohn.sh>

    Badge commit summaries with daily count.

  • 9:49 pm β€” John Sherrell <dev@ohn.sh>

    Bump Astro and Starlight.

  • 9:43 pm β€” John Sherrell <dev@ohn.sh>

    Wrap <YouTube> in <figure>; scoped CSS should make my custom Vite plugin obsolete.

  • 9:23 pm β€” John Sherrell <dev@ohn.sh>

    YouTube loader now detects when videos are shorts. <YTDay> now allows sorting by first character of video titles (for video titles with an emoji indicating subject/category).

  • 6:40 pm β€” John Sherrell <dev@ohn.sh>

    Added YouTube Data API loader; now videos are available in a day-oriented content collection, just like GitHub commits.

  • 1:29 pm β€” John Sherrell <dev@ohn.sh>

    Bring in loaders/github improvements from scratch. Commits now organized by local day instead of UTC.

  • 1:27 pm β€” John Sherrell <dev@ohn.sh>

    Refactor <GithubDay> and improve formatting. Now <Commit> and <RepoDay> are separate components.

  • 11:30 am β€” John Sherrell <dev@ohn.sh>

    Upgrade to Astro v6.

  • 2:59 am β€” John Sherrell <dev@ohn.sh>

    Added link-button out to repositories in <GithubDay>.

  • 1:56 am β€” John Sherrell <dev@ohn.sh>

    <GithubDay> commit formatting is less terrible. Still need to account for UTC timestamps and bring in a ~7-digit SHA prefix a la GitHub.

  • 1:28 am β€” John Sherrell <dev@ohn.sh>

    Add github sync script to package.json. March 11.

  • 1:03 am β€” John Sherrell <dev@ohn.sh>

    Clean up console.logs

  • 12:24 am β€” John Sherrell <dev@ohn.sh>

    Tagging implementation, loosely based on HiDeoo/starlight-blog. No pagination yet, but it will be necessary. Need to work on consistent conversion of tags to slugs. The <Tags> component has made me realize that the other everyday components like <YouTube> and <GithubDay> need to be rendered outside of the MDX where they can be passed computed props directly. This avoids a lot of duplication.

scratch commits 6 ohnsh/scratch
  • 9:50 pm β€” John Sherrell <dev@ohn.sh>

    YouTube loader now detects when videos are shorts. <YTDay> now allows sorting by first character of video titles (for video titles with an emoji indicating subject/category). Wrap <YouTube> in <figure>; allows for scoped CSS to override <lite-youtube> styles.

  • 6:22 pm β€” John Sherrell <dev@ohn.sh>

    Extracted a new content loader from YouTube Data API experiment. Loads videos keyed by day, as with the GitHub loader. Dates in the video title take precedence.

  • 1:12 pm β€” John Sherrell <dev@ohn.sh>

    Bring over GithubDays updates from days and refactor. Now <Commit> and <RepoDay> are separate components.

  • 12:29 pm β€” John Sherrell <dev@ohn.sh>

    Update color scheme cyan -> blue.

  • 12:24 pm β€” John Sherrell <dev@ohn.sh>

    more updates after nuking bun.lock.

  • 11:41 am β€” John Sherrell <dev@ohn.sh>

    Upgrade Astro to v6.

YouTube

Tuesday, March 10

Git Commits

days commits 7 ohnsh/days
  • 10:52 pm β€” John Sherrell <dev@ohn.sh>

    Clean up old pagination hack.

  • 9:50 pm β€” John Sherrell <dev@ohn.sh>

    Tweak <YouTube> styles. Copilot pulled out a pretty sweet custom Vite plugin that wraps the component's own CSS in a @layer so it can be overridden with no fuss.

  • 1:17 pm β€” John Sherrell <dev@ohn.sh>

    Add README.

  • 11:57 am β€” John Sherrell <dev@ohn.sh>

    Added 3/9 video, minor edits.

  • 2:55 am β€” John Sherrell <dev@ohn.sh>

    Day updates.

  • 2:28 am β€” John Sherrell <dev@ohn.sh>

    Refactor route middleware. Pagination now handled there so no need to override the Pagination component. Remove TOC from latest stream.

  • 12:51 am β€” John Sherrell <dev@ohn.sh>

    Index is now a paginated non-Starlight route with a hero on page 1. Getting rid of content/docs/index.mdx makes sense because it was an outlier in the content collection and because the index really needs to display a stream of recent posts. Astro's built-in pagination is a much better solution for such a stream. Date utils are finally in good shape. Moving away from Starlight-centric approach. Parsing dates directly from slugs rather than relying on route context set by Starlight middleware.

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

Saturday, March 7

Starlight CSS tweaks: A hero for a blog index page

Yesterday, I created (a rough version of) an Astro component that renders a stream of recent posts for a blog index page. I’m already using it on days.ohn.sh. For now, I’m using Astro’s Starlight documentation framework, which means the default styling isn’t optimized for a blog.

In Starlight, styles can be customized site-wide with the global customCss config option. In this case, I only wanted to modify the hero on the main index page. Luckily, you can import CSS into an MDX page, just like you would in an Astro component. Doing so allows for page-specific CSS tweaks.

View full post…

Git Commits

days commits 11 ohnsh/days
  • 9:17 pm β€” John Sherrell <dev@ohn.sh>

    Favicon discussion.

  • 6:36 pm β€” John Sherrell <dev@ohn.sh>

    Applying splash.css site-wide.

  • 6:32 pm β€” John Sherrell <dev@ohn.sh>

    Content update (OG images).

  • 6:21 pm β€” John Sherrell <dev@ohn.sh>

    Fix rendering of plain markdown code blocks by removing mdx config from astro.config.mjs. By default the mdx config extends the markdown config, making it redundant anyway.

  • 5:24 pm β€” John Sherrell <dev@ohn.sh>

    Added video, section about external links.

  • 4:08 pm β€” John Sherrell <dev@ohn.sh>

    Add rehype plugin to open external links in new tab.

  • 3:17 pm β€” John Sherrell <dev@ohn.sh>

    Content update: themes.

  • 12:00 pm β€” John Sherrell <dev@ohn.sh>

    Added content explaining recent Starlight customizations.

  • 11:20 am β€” John Sherrell <dev@ohn.sh>

    Added splash-like hero to the index, tweaked CSS for that specific page. Considering hiding TOC site-wide.

  • 1:58 am β€” John Sherrell <dev@ohn.sh>

    Style tweaks.

  • 1:20 am β€” John Sherrell <dev@ohn.sh>

    Added recent days feed to index page. Used HiDeoo/starlight-blog as a starting point but kept very little code.