From edbce48613f010eba0b6ffa0ec383c19a02d42d0 Mon Sep 17 00:00:00 2001 From: mrrpnya Date: Sun, 16 Feb 2025 19:31:39 -0800 Subject: [PATCH] beginning i18n support --- assets/config.ts | 1 + assets/meta/post_list.json | 342 ++- assets/style/style.css | 4 + components/MetaSet.vue | 2 +- components/Navbar.vue | 32 +- components/PostCard.vue | 12 +- content.config.ts | 10 + content/{ => en}/collections/awesome.md | 0 content/{ => en}/collections/badges.md | 0 content/{ => en}/collections/godot.md | 4 + .../{ => en}/collections/lgbtq_resources.md | 9 + .../en/collections/neurodiverse_resources.md | 15 + content/{ => en}/guides/old3ds_helloworld.md | 0 content/{ => en}/guides/old3ds_romfs.md | 0 content/{ => en}/guides/old3ds_touchscreen.md | 0 content/{ => en/site}/about_me.md | 4 +- content/{ => en}/site/styling_test.md | 0 content/tp/site/about_me.md | 43 + deno.lock | 1714 ++++++++++-- i18n.config.ts | 19 + log.txt | 2384 +++++++++++++++++ nuxt.config.ts | 79 +- package.json | 6 + .../article/{ => [lang]}/[category]/[id].vue | 157 +- pages/article/index.vue | 198 +- pages/index.vue | 33 +- public/images/flags/en.svg | 16 + public/images/flags/tp.svg | 76 + public/images/me.png | Bin 147504 -> 265697 bytes utils/page_updater/pages.ts | 1 + utils/page_updater/run.ts | 107 + utils/page_updater/update_pagelist.ts | 290 +- vitest.config.ts | 8 + 33 files changed, 4943 insertions(+), 623 deletions(-) create mode 100644 content.config.ts rename content/{ => en}/collections/awesome.md (100%) rename content/{ => en}/collections/badges.md (100%) rename content/{ => en}/collections/godot.md (77%) rename content/{ => en}/collections/lgbtq_resources.md (96%) create mode 100644 content/en/collections/neurodiverse_resources.md rename content/{ => en}/guides/old3ds_helloworld.md (100%) rename content/{ => en}/guides/old3ds_romfs.md (100%) rename content/{ => en}/guides/old3ds_touchscreen.md (100%) rename content/{ => en/site}/about_me.md (90%) rename content/{ => en}/site/styling_test.md (100%) create mode 100644 content/tp/site/about_me.md create mode 100644 i18n.config.ts create mode 100644 log.txt rename pages/article/{ => [lang]}/[category]/[id].vue (59%) create mode 100644 public/images/flags/en.svg create mode 100644 public/images/flags/tp.svg create mode 100644 utils/page_updater/run.ts create mode 100644 vitest.config.ts diff --git a/assets/config.ts b/assets/config.ts index 26be252..1c1a64a 100644 --- a/assets/config.ts +++ b/assets/config.ts @@ -4,6 +4,7 @@ export default { siteDescription: "Luna's rambling place!", siteUrl: 'https://mrrpnya.github.io', siteImage: '', + siteDefaultLocale: 'en_us', // Site personalization siteColor: '#550077', diff --git a/assets/meta/post_list.json b/assets/meta/post_list.json index 8808a66..ee2ac10 100644 --- a/assets/meta/post_list.json +++ b/assets/meta/post_list.json @@ -1,144 +1,212 @@ { - "last_generated": "2025-01-04 12:52:32", - "categories": { - "Site": { - "posts": [ - { - "metadata": { - "title": "Styling Test", - "description": "A test post to see how the site styling looks", - "date": "2024-12-31 16:00:00", - "tags": [ - "meta", - "web" - ] - }, - "id": "site/styling_test", - "url": "/site/styling_test", - "hash": "0ff9f34321a27f462ca26656a1dc5024c0e800ea1e176ff36316b158ab4606c9" + "last_generated": "2025-02-16 14:47:00", + "languages": { + "en": { + "categories": { + "Site": { + "posts": [ + { + "metadata": { + "title": "Styling Test", + "description": "A test post to see how the site styling looks", + "date": "2025-01-01T00:00:00.000Z", + "tags": [ + "meta", + "web" + ] + }, + "id": "site/styling_test", + "url": "en/site/styling_test", + "hash": "e581ca6fef00cdc54a660744b295ff83ce05c2d75561a43695917dde2aa2d06f" + }, + { + "metadata": { + "title": "About Me", + "prop": true + }, + "id": "site/about_me", + "url": "en/site/about_me", + "hash": "85cd293e18e1f11b8f49c3858c78b98d7cb3dfcc31b347d76db1be7d8c400b81" + } + ], + "title": "Site", + "description": "Articles to test site functionality", + "tags": [ + "site" + ], + "show": false + }, + "Collections": { + "posts": [ + { + "metadata": { + "title": "Neurodiverse Resources", + "description": "A list of neurodiversity resources", + "date": "2025-02-04T00:00:00.000Z", + "tags": [ + "neurodiversity", + "resources" + ], + "thumb": null + }, + "id": "collections/neurodiverse_resources", + "url": "en/collections/neurodiverse_resources", + "hash": "18e37836ef191c0adb0a139f151e5827d79e170d0ab039ff63d67093cf7f9e36" + }, + { + "metadata": { + "title": "Godot Resources", + "description": "A bunch of stuff for Godot", + "date": "2025-01-22T00:00:00.000Z", + "tags": [ + "godot", + "curated" + ] + }, + "id": "collections/godot", + "url": "en/collections/godot", + "hash": "0fa66e5f5346902661fb67a979340701155c25d73dafa05b3bf7446aac5a49b9" + }, + { + "metadata": { + "title": "LGBTQ+ Resources", + "description": "A list of resources for LGBTQ+ (and adjacent) individuals", + "date": "2025-01-02T00:00:00.000Z", + "tags": [ + "lgbtq", + "resources" + ] + }, + "id": "collections/lgbtq_resources", + "url": "en/collections/lgbtq_resources", + "hash": "2f1f9c04ef62313bccecf7e5f22b95e862a36fce260b34ca64286e684a453196" + }, + { + "metadata": { + "title": "Badges!", + "description": "Some 88x31 badges for various things", + "date": "2024-12-21T00:00:00.000Z", + "tags": [ + "badges", + "retro", + "web" + ] + }, + "id": "collections/badges", + "url": "en/collections/badges", + "hash": "7fc0dbfff6dfba66b5a6e93ba4394a2034ab3935ae6acaf2b5ac4a815116d24e" + }, + { + "metadata": { + "title": "Awesome", + "description": "A curated list of awesome stuff I like", + "date": "2024-11-26T00:00:00.000Z", + "tags": [ + "awesome", + "curated" + ] + }, + "id": "collections/awesome", + "url": "en/collections/awesome", + "hash": "43704f5de68e422ca3187cda0e34084d6ad3b930b4238bdd1b80535c3013c191" + } + ], + "title": "Collections", + "description": "Articles that are collections of information: Lists, Awesome lists, etc.", + "tags": [ + "collection" + ], + "show": true + }, + "Guides": { + "posts": [ + { + "metadata": { + "title": "3DS Programming - Using RomFS", + "description": "A guide to using RomFS on the 3DS. (Old)", + "date": "2025-01-01T00:00:00.000Z", + "tags": [ + "3ds", + "programming", + "c", + "devkitpro", + "old" + ], + "previous": "old3ds_helloworld.md", + "next": "old3ds_touchscreen.md" + }, + "id": "guides/old3ds_romfs", + "url": "en/guides/old3ds_romfs", + "hash": "f518b6cdf7a5eb0d72f86c305089df5ee42a4c4aae1589c7abace33368dd4ede" + }, + { + "metadata": { + "title": "3DS Programming - Touchscreen Input", + "description": "A guide to using the touchscreen on the 3DS. (Old)", + "date": "2025-01-01T00:00:00.000Z", + "tags": [ + "3ds", + "programming", + "c", + "devkitpro", + "old" + ], + "previous": "old3ds_romfs.md" + }, + "id": "guides/old3ds_touchscreen", + "url": "en/guides/old3ds_touchscreen", + "hash": "c026e506fb60c8ed9943f5806e8adf611a382a7de34e30fc2a72f4578d66899e" + }, + { + "metadata": { + "title": "3DS Programming - Hello World", + "description": "A guide to creating a simple Hello, World program for the 3DS. (Old)", + "date": "2025-01-01T00:00:00.000Z", + "tags": [ + "3ds", + "programming", + "c", + "devkitpro", + "old" + ], + "next": "old3ds_romfs.md" + }, + "id": "guides/old3ds_helloworld", + "url": "en/guides/old3ds_helloworld", + "hash": "77a21a1201a35d6a85cb2305166cfb20a0a45546fea1f73fd620b2b84ec70fda" + } + ], + "title": "Guides", + "description": "Guides and tutorials", + "tags": [ + "guide" + ], + "show": true } - ], - "title": "Site", - "description": "Articles to test site functionality", - "tags": [ - "site" - ] + } }, - "Collections": { - "posts": [ - { - "metadata": { - "title": "LGBTQ+ Resources", - "description": "A list of resources for LGBTQ+ individuals", - "date": "2025-01-01 16:00:00", - "tags": [ - "lgbtq+", - "resources" - ] - }, - "id": "collections/lgbtq_resources", - "url": "/collections/lgbtq_resources", - "hash": "3da76064aa95cc06937bde01128ed44aafb850f35a43bd214ce0cd89a875c674" - }, - { - "metadata": { - "title": "Badges!", - "description": "A collection of 88x31 badges for various things", - "date": "2024-12-20 16:00:00", - "tags": [ - "badges", - "retro", - "web" - ] - }, - "id": "collections/badges", - "url": "/collections/badges", - "hash": "338ccfecc6523dff93708330a8b43af715f1e80d55e1cc3bea2d1a7306fc4f00" - }, - { - "metadata": { - "title": "Awesome", - "description": "A curated list of awesome stuff I like", - "date": "2024-11-25 16:00:00", - "tags": [ - "awesome", - "curated" - ] - }, - "id": "collections/awesome", - "url": "/collections/awesome", - "hash": "0632400858006b93f2f36d87953538c2a400bacc75aaa29928aee226e8b343b1" + "tp": { + "categories": { + "Site": { + "posts": [ + { + "metadata": { + "title": "About Me", + "prop": true + }, + "id": "site/about_me", + "url": "tp/site/about_me", + "hash": "c6bde941d29567f1a3b98e52d68d50dad233f55a0c4d23d60b17efe292bd4e39" + } + ], + "title": "Site", + "description": "Articles to test site functionality", + "tags": [ + "site" + ], + "show": false } - ], - "title": "Collections", - "description": "Articles that are collections of information: Lists, Awesome lists, etc.", - "tags": [ - "collection" - ] - }, - "Guides": { - "posts": [ - { - "metadata": { - "title": "3DS Programming - Using RomFS", - "description": "A guide to using RomFS on the 3DS. (Old)", - "date": "2024-12-31 16:00:00", - "tags": [ - "3ds", - "programming", - "c", - "devkitpro", - "old" - ], - "previous": "old3ds_helloworld.md", - "next": "old3ds_touchscreen.md" - }, - "id": "guides/old3ds_romfs", - "url": "/guides/old3ds_romfs", - "hash": "34062b79909f5b18a647b484687cf862e779c08da9fc6052c4ebab3eef67151c" - }, - { - "metadata": { - "title": "3DS Programming - Touchscreen Input", - "description": "A guide to using the touchscreen on the 3DS. (Old)", - "date": "2024-12-31 16:00:00", - "tags": [ - "3ds", - "programming", - "c", - "devkitpro", - "old" - ], - "previous": "old3ds_romfs.md" - }, - "id": "guides/old3ds_touchscreen", - "url": "/guides/old3ds_touchscreen", - "hash": "c026e506fb60c8ed9943f5806e8adf611a382a7de34e30fc2a72f4578d66899e" - }, - { - "metadata": { - "title": "3DS Programming - Hello World", - "description": "A guide to creating a simple Hello, World program for the 3DS. (Old)", - "date": "2024-12-31 16:00:00", - "tags": [ - "3ds", - "programming", - "c", - "devkitpro", - "old" - ], - "next": "old3ds_romfs.md" - }, - "id": "guides/old3ds_helloworld", - "url": "/guides/old3ds_helloworld", - "hash": "77a21a1201a35d6a85cb2305166cfb20a0a45546fea1f73fd620b2b84ec70fda" - } - ], - "title": "Guides", - "description": "Guides and tutorials", - "tags": [ - "guide" - ] + } } } } \ No newline at end of file diff --git a/assets/style/style.css b/assets/style/style.css index 157b8ea..e90882f 100644 --- a/assets/style/style.css +++ b/assets/style/style.css @@ -9,6 +9,10 @@ html { @apply min-h-screen bg-slate-950; } +h1, h2, h3, h4, h5, h6, p { + color: white; +} + h1 { font-family: 'Lobster', cursive, 'Courier New', Courier, monospace; @apply text-3xl font-bold; diff --git a/components/MetaSet.vue b/components/MetaSet.vue index 7e4072f..9c64125 100644 --- a/components/MetaSet.vue +++ b/components/MetaSet.vue @@ -1,7 +1,7 @@ \ No newline at end of file + diff --git a/components/PostCard.vue b/components/PostCard.vue index 7104e1c..4bca493 100644 --- a/components/PostCard.vue +++ b/components/PostCard.vue @@ -67,10 +67,12 @@ async function fetchData(url: string) { onMounted(() => { fetchData(url.value) }) + +const localePath = useLocalePath();