From 5f496a4f8f7f3fca6dcb896c15cbccdb21f943d1 Mon Sep 17 00:00:00 2001 From: Stephen Fluin Date: Sat, 24 Aug 2024 03:41:53 -0500 Subject: [PATCH] fix: add trailing slashes to search results (#1122) --- generate-search-index.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/generate-search-index.js b/generate-search-index.js index e6df1fd7f..c2952d630 100644 --- a/generate-search-index.js +++ b/generate-search-index.js @@ -37,9 +37,9 @@ function walk(dir) { // remove file extension, order matters here const url = filepath .replace("src/pages", "") - .replace(".astro", "") - .replace(".mdx", "") - .replace(".md", ""); + .replace(".astro", "/") + .replace(".mdx", "/") + .replace(".md", "/"); const mtime = stats.mtime.toISOString(); const sha = crypto.createHash("sha256"); sha.update(url);