Commit bfcbfbd

HPCesia <me@hpcesia.com>
2025-01-21 09:14:33
fix: build failed in non-ASCII
1 parent f0536d2
Changed files (2)
src
pages
archives
categories
[category]
tags
src/pages/archives/categories/[category]/[page].astro
@@ -19,7 +19,7 @@ export async function getStaticPaths() {
       const pageNum = Math.ceil(categoryPosts.length / siteConfig.postsPerPage);
       category = category.replaceAll(/[\\/]/g, '-');
       return Array.from({ length: pageNum }, (_, i) => ({
-        params: { category: category, page: (i + 1).toString() },
+        params: { category: encodeURIComponent(category), page: (i + 1).toString() },
         props: {
           posts: categoryPosts.slice(
             i * siteConfig.postsPerPage,
src/pages/archives/tags/[tag]/[page].astro
@@ -14,7 +14,7 @@ export async function getStaticPaths() {
       const pageNum = Math.ceil(tagPosts.length / siteConfig.postsPerPage);
       tag = tag.replaceAll(/[\\/]/g, '-');
       return Array.from({ length: pageNum }, (_, i) => ({
-        params: { tag: tag, page: (i + 1).toString() },
+        params: { tag: encodeURIComponent(tag), page: (i + 1).toString() },
         props: {
           posts: tagPosts.slice(i * siteConfig.postsPerPage, (i + 1) * siteConfig.postsPerPage),
           currentPage: i + 1,