Skip to content

Latest πŸ—žοΈ

Monday, March 16

j.ohn.sh back in business.

My link page at https://j.ohn.sh had been neglected for a few years, so I decided to rebuild it on Astro, the same framework I’m using here at days.ohn.sh. The old repository is still on GitHub.

Back when I made the original, I wouldn’t have been caught dead using a framework. In other, more complicated projects, I built static HTML using Makefiles and esh templates, but this one was a simple index.html with no build tool.

View full post…

Git Commits

ohnsh.github.io commits 2 ohnsh/ohnsh.github.io
  • 6:08 pm β€” John Sherrell <107401967+ohnsh@users.noreply.github.com>

    Revise links in README for new and archived pages

  • 1:42 am β€” John Sherrell <107401967+ohnsh@users.noreply.github.com>

    Switching repos for personal link page; not using Github Pages.

itsa-me commits 12 ohnsh/itsa-me
  • 5:49 pm β€” John Sherrell <107401967+ohnsh@users.noreply.github.com>

    Fix header formatting in README

  • 5:48 pm β€” John Sherrell <107401967+ohnsh@users.noreply.github.com>

    Replace generated README.

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

    Officially tired of my profile pic. For now, I'm using my 2023-era glamour shot. I tried using Astro's <Image> and asset optimization, but the quality was pretty bad. Letting the browser resize from 1280px down to 200px seems wasteful, but the result speaks for itself.

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

    Get back some width by moving `min-width` back to the inner element (ul). Document the magic numbers used for column alignment.

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

    Hue rotated towards chocolate.

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

    Get some hover action back. Not sure yet if I'm goint to do `background-clip: text` to get a gradient over the text like on the original version.

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

    Move custom domain config into wrangler.jsonc

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

    Stroke widths normalized. Good enough to merge and deploy.

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

    Refactor isn't quite right yet, but it'll do for now. Still need to get stroke-widths normalized. (They seem to be relative to the size of the viewbox, which unfortunately varies between icons and is tightly coupled to the internal path definitions.)

  • 2:58 pm β€” John Sherrell <dev@ohn.sh>

    Re-factoring has cleaned things up quite a bit, but there are a few style regressions.

  • 2:25 pm β€” John Sherrell <dev@ohn.sh>

    Overhaul icons, set colors back to the classic scheme. Need to factor out a component or two.

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

    Removing PicoCSS; basically a reboot.

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

    Finished up post.

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

    Added spacing between sub-articles (top-level sections within each day). Started a new post about the new (and old) version of my link page.

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

    Tweak commit count badges. Now inline-block with a min-width.

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

    Gradually getting out of the business of customizing the theme. The higher contrast looks better suddenly and makes more of the --sl-color-gray-* shades useful.

scratch commits 1 ohnsh/scratch
  • 5:51 pm β€” John Sherrell <107401967+ohnsh@users.noreply.github.com>

    Add initial README

YouTube

Sunday, March 15

Git Commits

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

    Tweak post header styles, remove console.log.

  • 11:04 pm β€” John Sherrell <dev@ohn.sh>

    Styles: using border-bottom on post titles instead of <hr />. The border is actually on a new <header> wrapping both the h2 and tags. On single-day pages, the rules are a bit different: Tags need a negative margin to create a superficial grouping with the h1 rendered by <StarlightPage>.

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

    Github loader: New, generalized fetch-all-pages abstraction around api() calls. Just in time for my 99th commit. The Github API uses the HTTP `Link` header to return next-page URLs, while the YouTube API puts them in the body.

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

    Youtube loader: Generalized fetch-all-pages abstraction around YouTube Data API calls.

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

    Edited site description.

  • 8:47 pm β€” John Sherrell <dev@ohn.sh>

    Reaching into tab component styles to remove full-width border. This UI needs a lot of improvement, possibly in the form of a framework component, but for now it's better than using <details> everywhere.

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

    Updated og:image extraction to extract multiple thumbnails if available. (E.g. Facebook lets you pick between them when posting.) Currently filtering out timelapse videos and prioritizing running videos.

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

    Can't pass empty string in <TabItem> label prop.

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

    Changed YouTube daily entries (<YTDay>) to tabbed interface. Using starlight/astro <Tabs> component but considering adding React to this project and testing radix-ui.

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

    Now grouping videos by tag for display. New <VideoList> component for that purpose. Upgrades to emoji detection. A sort order for tags can be passed as a prop.

Saturday, March 14

Git Commits

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

    Added automatic tag extraction (based on emoji) to youtube loader. Using `Intl.Segmenter` API to handle complex multi-codepoint emoji. Also fixed some edge cases when parsing dates from video titles with implicit years. The year is taken from the pub date but adjusted as necessary in case the two dates fall on different sides of a December/January boundary.

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

    Youtube loader: fix regex date-from-title parsing edge cases. (JavaScript will parse 'Run 1' as a valid date: January 1, 2001. JavaScript is always right.)

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

    Dynamic heading levels for rendered markdown and mdx. My spidey sense said that heading levels were going to be a huge pain, and they were. I settled on something that seems pretty robust but unfortunately involves regex string replacement on raw HTML. The <Post> component (similar to the previous <Preview>) computes a heading level offset based on context (list of posts versus single post). Then, a <PostWrapper> component is passed the actual <Content /> in a slot and uses `Astro.slots.render('default')` to obtain the rendered HTML string, which it then manipulates and renders to the page with `<Fragment set:html={adjustedHtml} />`.

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

    Added horizontal rules back in, moved the CSS to global.css.

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

    Paginated /tags/[tag] route. As a bonus, og:image now works on tag pages. Both og:image and pagination links are implemented in route middleware, so any paginated routes get them for free. Realized that using [...page].astro instead of [page].astro allows for more elegant routes: the first page has no page segment (the `page` parameter is undefined) so there's no need for an index page returning `Astro.rewrite('/route/1')`. So now I'm using it on both paginated routes: /tags/[tag] and /latest.

Friday, March 13

Posts are back.

Posts are now a distinct content collection. If you’re seeing this, they are being merged with other content types at build time to generate daily entries. Currently, both days and individual posts can be tagged. Posts are tagged in Markdown frontmatter while days are tagged in a separate YAML metadata collection.

View full post…

Git Commits

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

    Moved day tags to top, right under title. No longer rendering year in title for posts later than this month last year.

  • 10:09 pm β€” John Sherrell <dev@ohn.sh>

    Fixed sidebar month-rendering bug related to JavaScript date parsing (i.e. plain dates are usually interpreted as midnight local time, but sometimes as midnight UTC, creating weird day/month/year boundary issues.)

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

    Changed tagMap values to Set<DayEntry> instead of DayEntry[] to avoid duplicates. (For example, I had both today and a post from today tagged "test" which caused the day to render twice at tags/test.) Also switched on title rendering for days on tags route.

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

    Sidebar now working on tags routes.

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

    Tag route is in decent shape now except the sidebar. Lots of refactoring and cleanup in src/lib. De-duplicating filtering and sidebar processing in components by moving it to lib/day.ts and lib/sidebar.ts. Learned to be very careful abou what I import in astro.config.mjs (created lib/const.ts with no side effects or dependencies for this purpose).

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

    Day tags and post tags now being rendered. It's confusing when they're adjacent--I'll need to think that through. The /tags route is mostly working without me even touching it. There are a few things to fix up, especially the sidebar.

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

    Posts now rendering. Overall intra-day layout needs a lot of work, but the content is mostly there. Still need to merge in tagging/metadata from yaml collection. Also need to get og:image working again.

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

    Prepping posts to be merged into daily feed.

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

    Fixed sidebar regression where the header and footer was lost when I started dynamically generating the content. Now the static config is a template with a literal '<slot />' item that is replaced dynamically with the generated entries.

  • 2:26 pm β€” John Sherrell <dev@ohn.sh>

    Add wrangler to gitignore.

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

    Merge branch 'virtual-days'

  • 2:18 pm β€” John Sherrell <dev@ohn.sh>

    Titles fixed, filtering implemented (year >= 2025 for now).

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

    Getting close. All routes rendering, pagination working. Still need to render actual post content, fix up titles, filter days, and get og:image extraction working again.

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

    Refactoring new code.

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

    Auto-collapse all but first year and month.

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

    Proof of concept. It works. Needs lots of work, though.

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

    Getting there.

Thursday, March 12

Git Commits

days commits 4 ohnsh/days
  • 3:39 pm β€” John Sherrell <dev@ohn.sh>

    Nuke content folder, keeping actual posts for a "posts" collection. There's still a docs collection since this is starlight, but it might be empty. The days collection will be optional yaml metadata to for tagging and configuration.

  • 2:05 pm β€” John Sherrell <dev@ohn.sh>

    Updated github loader to fetch 100 commits per page. Still need to implement actual paging.

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

    Rough first pass of virtual day route.

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

    Prepping for new branch that will make major changes to project structure. Days will be virtual resources rather than concrete mdx files. The `days` collection will be strictly for metadata; posts will be a separate content collection, and they, along with github, youtube, etc., will be merged at the endpoint for a given day.

scratch commits 1 ohnsh/scratch
  • 12:51 pm β€” John Sherrell <dev@ohn.sh>

    remove note.