From 26acb2420d1ca08df8a6c3646b8acd8a62be09a1 Mon Sep 17 00:00:00 2001 From: KishiTheMechanic Date: Mon, 28 Oct 2024 00:45:00 +0100 Subject: [PATCH] fix output paths --- deno.json | 2 +- mod.ts | 8 +++----- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/deno.json b/deno.json index 1b7739d..5cb3044 100644 --- a/deno.json +++ b/deno.json @@ -1,6 +1,6 @@ { "name": "@elsoul/fresh-sitemap", - "version": "0.5.0", + "version": "0.6.0", "description": "Lightweight global state management library for Fresh framework using Preact signals.", "runtimes": ["deno", "browser"], "exports": "./mod.ts", diff --git a/mod.ts b/mod.ts index 72f2795..41cc93a 100644 --- a/mod.ts +++ b/mod.ts @@ -114,11 +114,9 @@ async function generateSitemap( let pathname = normalize(`/${relPath}`).split(SEPARATOR).join('/') // Exclude grouping and dynamic directories, _-prefixed files, and index files - if ( - pathname.includes('(') || pathname.includes('[') || - pathname.includes('_') - ) continue - pathname = pathname.replace(/\.tsx$/, '').replace(/\/index$/, '') + pathname = pathname.replace(/\(.*?\)/g, '') // Remove content within parentheses + if (pathname.includes('_') || pathname.endsWith('index')) continue + pathname = pathname.replace(/\.tsx$/, '') const isExcluded = exclude && exclude.test(pathname.substring(1)) const isIncluded = !include || include.test(pathname.substring(1))