diff --git a/content/blog/2025/fixing-up-japanese-language-tags.md b/content/blog/2025/fixing-up-japanese-language-tags.md index 1cb4b0a..06cb858 100644 --- a/content/blog/2025/fixing-up-japanese-language-tags.md +++ b/content/blog/2025/fixing-up-japanese-language-tags.md @@ -1,14 +1,15 @@ --- title: "Fixing Up Japanese Language Tags" date: 2025-01-07T13:33:20-08:00 -draft: true +description: Updating Japanese language tag slugs to make them easier to navigate. tags: - Meta - Hugo - japanese + - japan --- -Two years ago, I took a trip to Japan with Tess. I wrote up my experiences on +Two years ago, I took a trip to Japan with {{< tess >}}. I wrote up my experiences on that trip in various posts, and shared several photos. Feeling perhaps overly-confident in my ability to read Japanese and my website @@ -19,9 +20,44 @@ Japanese language tags: [東京]({{< ref "/tags/japan-tokyo" >}}), [京都]({{< ref "/tags/japan-kyoto" >}}). -This led to some difficult URLs because of how Hugo rendered the Japanese +This led to some unweildy URLs because of how Hugo rendered the Japanese language tags names into ASCII when generating file paths. -It's always bothered me a bit to have paths that look like this, so I went -through today and updated those tags to have ASCII slugs, and Japanese titles. I -went a step further +```html + +``` + +It's not necessary to convert URLs to punycode if your document is UTF8, but +Hugo does it. Browsers should automatically handle converting to and from +punycode when sending HTTP requests over the wire. Nevertheless... + +I went through my post tags and updated all of the Japanese language tags to +have English slugs and Japanese titles. Now, these URLs are more friendly for +typing (and the file paths are easier to navigate in a terminal) while still +showing up in posts and tag list pages with the Japanese name. + +```html + +``` + + +## One More Thing + +I often tag posts with tags by location. For example, several of my posts from +my Japan trip in 2023 are tagged with `/tags/japan` and with (e.g.) +`/tags/tokyo`. For the place tags that are within a large region, like cities +within countries, I added the larger region to the tag: + +* `/tags/tokyo` → `/tags/japan-tokyo` +* `/tags/kyoto` → `/tags/japan-kyoto` + +I only did this for the Japan tags for now. I'll be making more such updates +going forward.