Skip to content

Conversation

@john-kurkowski
Copy link
Owner

@john-kurkowski john-kurkowski commented May 4, 2024

Gatsby felt like overkill for this project: a small, static site, that doesn't even use a runtime framework like React.

Changes

  • Ensure consistent frontmatter schema across all posts
    • Always write description, instead of relying on automatic excerpt calculation
  • Find and replace straight quotes with smart quotes
    • While there, replace most incorrect prose uses of "&" with "and"
    • Remark and Smartypants used to do smart quote replacement automatically at HTML generation time. With Astro and MDX, supposedly the parser only sees 1 quote character at a time, zero context, and Smartypants becomes useless.
    • I did a bulk replace via a combination of smartypants <file> and recode html..utf-8 <file> and manual review.

Discussion

The find-and-replace of smart quotes is the riskiest change in this PR, potentially losing words, like "&".

Review App

https://deploy-preview-29--john-kurkowski.netlify.app/

TODO

  • Fix FOUC when navigating between pages in the nav bar
    • I added Astro's <ViewTransition /> to every page. It helps a little.
    • It doesn't seem to happen with links within the site not in the nav, e.g. links from blog post to blog post, or blog post to blog post index.
    • The problem seems to be magnified in production. See the review app.
    • Solved: I was missing the HTML <head>. 🤦 I think Gatsby's SEO component used to provide it. With Astro, you write the regular, required HTML element directly.

@john-kurkowski john-kurkowski marked this pull request as ready for review May 4, 2024 07:04
* Ensure consistent frontmatter schema across all posts
  * Always write `description`, instead of relying on automatic excerpt calculation
While there, replace most incorrect prose uses of "&" with "and".

Remark and Smartypants used to do smart quote replacement automatically at HTML generation time. With Astro and MDX, supposedly the parser only sees 1 quote character at a time, zero context, and Smartypants becomes useless.

I did a bulk replace via a combination of `smartypants <file>` and `recode html..utf-8 <file>` and manual review.
@lost-pixel-signals
Copy link

Shot Type Count Status
Added 0 🟡
Deleted 0
Regression 23
❗ page/about__[w1280px] (click to expand)
Before After
❗ page/about__[w414px] (click to expand)
Before After
❗ page/index__[w1280px] (click to expand)
Before After
❗ page/index__[w414px] (click to expand)
Before After
❗ page/posts__[w1280px] (click to expand)
Before After
❗ page/posts__[w414px] (click to expand)
Before After
❗ page/posts-1st-class-ux-for-web-programmers__[w1280px] (click to expand)
Before After
❗ page/posts-1st-class-ux-for-web-programmers__[w414px] (click to expand)
Before After
❗ page/posts-accumulating-multiple-failures-in-a-ValidationNEL__[w1280px] (click to expand)
Before After
❗ page/posts-accumulating-multiple-failures-in-a-ValidationNEL__[w414px] (click to expand)
Before After
❗ page/posts-avoid-git-first-drafts__[w1280px] (click to expand)
Before After
❗ page/posts-avoid-git-first-drafts__[w414px] (click to expand)
Before After
❗ page/posts-code-as-craft-as-career__[w1280px] (click to expand)
Before After
❗ page/posts-code-as-craft-as-career__[w414px] (click to expand)
Before After
❗ page/posts-credo__[w1280px] (click to expand)
Before After
❗ page/posts-credo__[w414px] (click to expand)
Before After
❗ page/posts-dont-learn-to-code-learn-to-program-but-come-back-in-10-years__[w1280px] (click to expand)
Before After
❗ page/posts-dont-learn-to-code-learn-to-program-but-come-back-in-10-years__[w414px] (click to expand)
Before After
❗ page/posts-good-ideas-from-mobile-design-that-are-good-everywhere__[w1280px] (click to expand)
Before After
❗ page/posts-good-ideas-from-mobile-design-that-are-good-everywhere__[w414px] (click to expand)
Before After
❗ page/posts-ongoing-learning-in-breadth-&-depth__[w414px] (click to expand)
Before After
❗ page/posts-paint-by-types__[w1280px] (click to expand)
Before After
❗ page/posts-paint-by-types__[w414px] (click to expand)
Before After

Newer versions of Prettier thinks it's wrapping long lines, but then MDX generates unwanted paragraphs.
@lost-pixel-signals

This comment was marked as outdated.

2 similar comments
@lost-pixel-signals

This comment was marked as outdated.

@lost-pixel-signals

This comment was marked as outdated.

@lost-pixel-signals

This comment was marked as outdated.

@lost-pixel-signals

This comment was marked as outdated.

@lost-pixel-signals

This comment was marked as outdated.

* Follow Astro v5 upgrade guide
* Work around removed type
* Work around post non-deterministic sort
* Remove slug and extension from content entries
I think Gatsby's SEO component used to provide it. With Astro, you write the regular, required HTML element directly.
Astro's `entry.id` omitted a special character from 1 existing URL. Instead, parse the article filename on disk for the slug.

This also restores 1 TitleCased URL, although that was redirected to be case insensitive automatically.
@lost-pixel-signals
Copy link

Shot Type Count Status
Added 0 🟡
Deleted 0
Regression 22
❗ page/about__[w1280px] (click to expand)
Before After
❗ page/about__[w414px] (click to expand)
Before After
❗ page/index__[w1280px] (click to expand)
Before After
❗ page/index__[w414px] (click to expand)
Before After
❗ page/posts__[w1280px] (click to expand)
Before After
❗ page/posts__[w414px] (click to expand)
Before After
❗ page/posts-1st-class-ux-for-web-programmers__[w1280px] (click to expand)
Before After
❗ page/posts-1st-class-ux-for-web-programmers__[w414px] (click to expand)
Before After
❗ page/posts-accumulating-multiple-failures-in-a-ValidationNEL__[w1280px] (click to expand)
Before After
❗ page/posts-accumulating-multiple-failures-in-a-ValidationNEL__[w414px] (click to expand)
Before After
❗ page/posts-avoid-git-first-drafts__[w1280px] (click to expand)
Before After
❗ page/posts-avoid-git-first-drafts__[w414px] (click to expand)
Before After
❗ page/posts-code-as-craft-as-career__[w1280px] (click to expand)
Before After
❗ page/posts-code-as-craft-as-career__[w414px] (click to expand)
Before After
❗ page/posts-credo__[w1280px] (click to expand)
Before After
❗ page/posts-credo__[w414px] (click to expand)
Before After
❗ page/posts-dont-learn-to-code-learn-to-program-but-come-back-in-10-years__[w1280px] (click to expand)
Before After
❗ page/posts-dont-learn-to-code-learn-to-program-but-come-back-in-10-years__[w414px] (click to expand)
Before After
❗ page/posts-good-ideas-from-mobile-design-that-are-good-everywhere__[w1280px] (click to expand)
Before After
❗ page/posts-good-ideas-from-mobile-design-that-are-good-everywhere__[w414px] (click to expand)
Before After
❗ page/posts-paint-by-types__[w1280px] (click to expand)
Before After
❗ page/posts-paint-by-types__[w414px] (click to expand)
Before After

@john-kurkowski john-kurkowski merged commit 6af50e1 into master Feb 19, 2025
9 checks passed
@john-kurkowski john-kurkowski deleted the astro branch February 19, 2025 22:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants