Posts about typescript
-
Astro update broke my code blocks! |
Astro came out with version 5.1.7 recently that made unannounced breaking changes in its compatibility with various Shiki imports. Instead of trying to fix it, I moved Shiki completely off of Astro's integration instead.
-
Astro and Cloudfront: Some cache busting techniques |
Astro adds hashes at the end of asset file names, while Cloudfront caches files for a day. This causes the site to break whenever new updates are pushed...
-
Astro: Customizing content routes |
Renaming each post to its slugified publish date and title.
-
Astro: Archives by year and month |
Astro allows categorizing and sorting posts by date, even without client-side Javascript.
-
Astro: Generating tag colors the easy way |
Rather than manually assign tag colors in a database, we can generate deterministic tags using a hash.
-
Astro: Dynamic routes with params and pagination |
An example of paginated listings of posts by tag, using the Astro framework.
-
Shiki: Syntax highlighting for inline code in Astro |
Astro has Shiki built-in for code blocks, but the integration configurations don't work for inline code. How do we apply the settings to other contexts?
-
Shiki: Creating a new transformer for line skips |
Splitting up long blocks of code into multiple blocks can cause breaks in context cues. Here, we create a new transformer that enables line skips into chunks within the same block.
-
Shiki: Highlighting lines and phrases in Shiki |
Flexible highlighting of code block lines and phrases using regular expressions. Help the audience focus on the important lines of code without redundantly describing it.
-
Shiki: Line numbering for Shiki syntax highlighting |
Unlike Prism.js and Highlight.js, Shiki doesn't ship with line numbering out of the box. Here's how I implemented it.