From cc4547c645436d21e784c7786776b5b7e1eb09f4 Mon Sep 17 00:00:00 2001 From: James Fenn Date: Mon, 11 Sep 2023 12:24:56 -0400 Subject: [PATCH 1/5] fix table & inline code formatting on a few posts --- .../blog/intro-to-web-accessibility/index.md | 38 +++---------------- .../index.md | 9 +++-- .../web-components-101-lit-framework/index.md | 2 +- 3 files changed, 13 insertions(+), 36 deletions(-) diff --git a/content/blog/intro-to-web-accessibility/index.md b/content/blog/intro-to-web-accessibility/index.md index e2230a4b..bf1d30d2 100644 --- a/content/blog/intro-to-web-accessibility/index.md +++ b/content/blog/intro-to-web-accessibility/index.md @@ -23,38 +23,12 @@ Another example is users with limited mobility who utilize specialty hardware, s Something to keep in mind is that these disabilities may not be permanent. For instance, if you fall and break your arm, you may be only using one arm while healing. Likewise, there are situational impairments as well. If you're holding a cup of coffee in one hand, you'll only be using the other for device usage. Here's a chart that outlines a few more of these examples: - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
PermanentTemporarySituational
Touch
One arm

Arm injury

New parent
See
Blind

Cataract

Distracted driver
Hear
Deaf

Ear infection

Bartender
Speak
Non-verbal

Laryngitis

Heavy accent
+| | Permanent | Temporary | Situational | +|-------|-----------|-----------|-------------| +| Touch | One arm | Arm injury | New parent | +| See | Blind | Cataract | Distracted driver | +| Hear | Deaf | Ear infection | Bartender | +| Speak | Non-verbal | Laryngitis | Heavy accent | > Microsoft originally created this chart as part of their [Inclusive Toolkit](https://download.microsoft.com/download/b/0/d/b0d4bf87-09ce-4417-8f28-d60703d672ed/inclusive_toolkit_manual_final.pdf) manual diff --git a/content/blog/web-components-101-framework-comparison/index.md b/content/blog/web-components-101-framework-comparison/index.md index 4e084251..b3d19587 100644 --- a/content/blog/web-components-101-framework-comparison/index.md +++ b/content/blog/web-components-101-framework-comparison/index.md @@ -24,8 +24,9 @@ To showcase this, let’s walk through some of these frameworks and compare and While web frameworks are the hot new jazz - it’s not like we couldn’t make web applications before them. With the advent of W3C standardized web components (without Lit), doing so today is better than it’s ever been. Here are some pros and cons of Vanilla JavaScript web components: - -
Pros Cons
  • No framework knowledge required
  • Less reliance on framework
  • Maintenance
  • Bugs
  • Security issues
  • Smaller “hello world” size
  • More control over render behavior
  • Re-rendering un-needed elements is slow
  • Handling event passing is tricky
  • Creating elements can be overly verbose
  • Binding to props requires element query
  • You’ll end up building Lit, anyway
+| Pros | Cons | +|------------|------------| +| | | To the vanilla way of doing things’ credit, there’s a bit of catharsis knowing that you’re relying on a smaller pool of upstream resources. There’s also a lessened likelihood of some bad push to NPM from someone on the Lit team breaking your build. @@ -170,7 +171,9 @@ You could work on fixing these, but ultimately, you’ve created a basis of what With the downsides (and upsides) of vanilla web components in mind, let’s compare the pros and cons of what building components using Lit looks like: -
Pros Cons
  • Faster re-renders* that are automatically handled
  • More consolidated UI/logic
  • More advanced tools after mastery
  • Smaller footprint than other frameworks
  • Framework knowledge required
  • Future breaking changes
  • Not as widely known/used as other frameworks (Vue, React, Angular)

+| Pros | Cons | +|------------|------------| +| | | While there is some overlap between this list of pros and cons and the one for avoiding Lit in favor of home-growing, there’s a few other items here. diff --git a/content/blog/web-components-101-lit-framework/index.md b/content/blog/web-components-101-lit-framework/index.md index e54575c8..fc8d421a 100644 --- a/content/blog/web-components-101-lit-framework/index.md +++ b/content/blog/web-components-101-lit-framework/index.md @@ -71,7 +71,7 @@ There are two primary differences from the vanilla JavaScript example. First, we That said, Lit components fully support the same lifecycle methods as a vanilla custom elements. -The second, easier-to-miss change from the vanilla JavaScript component to the Lit implementation, is that when we set our HTML, we don’t simply use a basic template literal (`

test

`): we pass the function `html` to the template literal (`html\`

test

\``). +The second, easier-to-miss change from the vanilla JavaScript component to the Lit implementation, is that when we set our HTML, we don’t simply use a basic template literal (`

test

`): we pass the function `html` to the template literal (``html`

test

`;``). This leverages [a somewhat infrequently used feature of template literals called tagged templates](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Template_literals#tagged_templates). Tagged templates allow a template literal to be passed to a function. This function can then transform the output based on the string input and expected interpolated placeholders. From 1d00326f45db8e795d5b8979740200a30a7eeaa8 Mon Sep 17 00:00:00 2001 From: James Fenn Date: Mon, 11 Sep 2023 14:19:00 -0400 Subject: [PATCH 2/5] add missing line breaks back to markdown table --- content/blog/intro-to-web-accessibility/index.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/content/blog/intro-to-web-accessibility/index.md b/content/blog/intro-to-web-accessibility/index.md index bf1d30d2..11463296 100644 --- a/content/blog/intro-to-web-accessibility/index.md +++ b/content/blog/intro-to-web-accessibility/index.md @@ -25,10 +25,10 @@ Something to keep in mind is that these disabilities may not be permanent. For i | | Permanent | Temporary | Situational | |-------|-----------|-----------|-------------| -| Touch | One arm | Arm injury | New parent | -| See | Blind | Cataract | Distracted driver | -| Hear | Deaf | Ear infection | Bartender | -| Speak | Non-verbal | Laryngitis | Heavy accent | +| Touch |
One arm |
Arm injury |
New parent | +| See |
Blind |
Cataract |
Distracted driver | +| Hear |
Deaf |
Ear infection |
Bartender | +| Speak |
Non-verbal |
Laryngitis |
Heavy accent | > Microsoft originally created this chart as part of their [Inclusive Toolkit](https://download.microsoft.com/download/b/0/d/b0d4bf87-09ce-4417-8f28-d60703d672ed/inclusive_toolkit_manual_final.pdf) manual From da8cbe1e63797b3b13adaecd7f0f7ccfdc251bb7 Mon Sep 17 00:00:00 2001 From: James Fenn Date: Tue, 12 Sep 2023 11:05:16 -0400 Subject: [PATCH 3/5] update MC introduction with new versions & file tree component --- .../index.md | 45 +++++++++---------- 1 file changed, 21 insertions(+), 24 deletions(-) diff --git a/content/blog/minecraft-data-packs-introduction/index.md b/content/blog/minecraft-data-packs-introduction/index.md index 280f96ba..f7331627 100644 --- a/content/blog/minecraft-data-packs-introduction/index.md +++ b/content/blog/minecraft-data-packs-introduction/index.md @@ -3,6 +3,7 @@ title: "Minecraft Data Pack Programming: Introduction", description: "Learn the beginnings of data pack development in Minecraft - using commands and functions to add custom behavior from scratch!", published: '2022-06-14T21:12:03.284Z', + edited: '2023-09-12', authors: ['fennifith'], tags: [], attached: [], @@ -93,7 +94,9 @@ The `"pack_format": 10` in this file corresponds to Minecraft 1.19; typically, t | Minecraft Version | `"pack_format"` value | |-------------------|-----------------------| -| 1.19 | `"pack_format": 10` | +| 1.20-1.20.1 | `"pack_format": 15` | +| 1.19.4 | `"pack_format": 12` | +| 1.19-1.19.3 | `"pack_format": 10` | | 1.18.2 | `"pack_format": 9` | | 1.18-1.18.1 | `"pack_format": 8` | | 1.17-1.17.1 | `"pack_format": 7` | @@ -122,15 +125,13 @@ Note that, while a preceding `/` is needed to type these commands into the text We should now have our data pack organized as follows: -```shell -1-introduction/ - pack.mcmeta - data/ - fennifith/ - functions/ - animals/ - spawn.mcfunction -``` + +- `1-introduction/` + - `pack.mcmeta` + - `data/` + - `fennifith/functions/animals/` + - `spawn.mcfunction` + ## Installing & testing the data pack @@ -189,20 +190,16 @@ In order to run a function automatically, Minecraft provides two built-in [funct We'll start with `load` — for which we'll need to create two new files in our folder structure! Below, I'm creating a new `load.mcfunction` next to our previous function, and a `minecraft/tags/functions/load.json` file for the `load` tag. -```shell -1-introduction/ - pack.mcmeta - data/ - minecraft/ - tags/ - functions/ - load.json - fennifith/ - functions/ - animals/ - load.mcfunction - spawn.mcfunction -``` + +- `1-introduction/` + - `pack.mcmeta` + - `data/` + - `minecraft/tags/functions/` + - `load.json` + - `fennifith/functions/animals/` + - `load.mcfunction` + - `spawn.mcfunction` + Note that, while I'm using the `fennifith/` namespace for my functions, the tag file lives under the `minecraft/` namespace. This helps to keep some data isolated from the rest of the game — any files in the `minecraft/` folder are *modifying Minecraft's functionality,* while anything in a different namespace is creating something that belongs to my data pack. From 417f89b51526ee8100aab2b23b12aa8deec02c11 Mon Sep 17 00:00:00 2001 From: James Fenn Date: Thu, 14 Sep 2023 10:30:27 -0400 Subject: [PATCH 4/5] make codeblock line counters absolute-positioned to fix #690 --- src/styles/shiki.scss | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/src/styles/shiki.scss b/src/styles/shiki.scss index 3f985fce..84c3a52b 100644 --- a/src/styles/shiki.scss +++ b/src/styles/shiki.scss @@ -3,16 +3,27 @@ /* * This code handles line of code counting */ -code { +pre code { counter-reset: step; counter-increment: step 0; + + display: block; + position: relative; + padding-left: 2.5rem; + tab-size: 4; } -code .line::before { +pre code .line::before { content: counter(step); counter-increment: step; + + // These must be position: absolute; to avoid contributing + // to the tab indent size within the code block. + // Otherwise, the first tab is offset by the width of the line counter, + // leading to inconsistent tab alignment. + position: absolute; + left: 0; width: 1rem; - margin-right: 1.5rem; display: inline-block; text-align: right; color: rgba(115, 138, 148, 0.4); @@ -87,7 +98,8 @@ pre.shiki div.highlight { background-color: var(--cardActiveBackground); } pre.shiki div.line { - min-height: 1rem; + // must be the same value as used for line-height + min-height: 1.7em; } /** Don't show the language identifiers */ From edd44dc11ba3b7ba5d68a14780a552d4513d0bca Mon Sep 17 00:00:00 2001 From: Corbin Crutchley Date: Sun, 17 Sep 2023 04:39:10 -0700 Subject: [PATCH 5/5] chore: add missing pathName to pages --- src/components/seo/shared.ts | 2 +- src/pages/404.astro | 2 +- src/pages/collections/[slug].astro | 1 + src/pages/collections/framework-field-guide/index.astro | 1 + src/pages/confirm.astro | 2 +- src/pages/index.astro | 2 +- src/pages/page/[page].astro | 2 +- src/pages/thanks.astro | 2 +- src/pages/unicorns/[unicornid]/index.astro | 1 + src/pages/unicorns/[unicornid]/page/[page].astro | 1 + 10 files changed, 10 insertions(+), 6 deletions(-) diff --git a/src/components/seo/shared.ts b/src/components/seo/shared.ts index 3cdf8d08..0cc13b20 100644 --- a/src/components/seo/shared.ts +++ b/src/components/seo/shared.ts @@ -12,7 +12,7 @@ export interface SEOProps { publishedTime?: string; editedTime?: string; type?: "article" | "profile" | "book"; - pathName?: string; + pathName: string; canonical?: string; isbn?: string; shareImage?: string; diff --git a/src/pages/404.astro b/src/pages/404.astro index e2a6cbbc..7157fc3a 100644 --- a/src/pages/404.astro +++ b/src/pages/404.astro @@ -8,7 +8,7 @@ const locale = "en"; --- - +
uni.id === "crutchcorn")]} diff --git a/src/pages/confirm.astro b/src/pages/confirm.astro index e8454a91..1248d684 100644 --- a/src/pages/confirm.astro +++ b/src/pages/confirm.astro @@ -8,7 +8,7 @@ const locale = "en"; --- - +
- +
diff --git a/src/pages/page/[page].astro b/src/pages/page/[page].astro index 04c116b6..e4c549c7 100644 --- a/src/pages/page/[page].astro +++ b/src/pages/page/[page].astro @@ -22,7 +22,7 @@ const SEOTitle = `Post page ${pageIndex}`; --- - +
diff --git a/src/pages/thanks.astro b/src/pages/thanks.astro index 36b109f0..e314ba88 100644 --- a/src/pages/thanks.astro +++ b/src/pages/thanks.astro @@ -8,7 +8,7 @@ const locale = "en"; --- - +