From afd7148f8f87e8441ff67f3ef005fb576552952b Mon Sep 17 00:00:00 2001 From: KishiTheMechanic Date: Mon, 28 Oct 2024 02:05:45 +0100 Subject: [PATCH] fixing --- deno.json | 2 +- mod.ts | 13 +++---------- 2 files changed, 4 insertions(+), 11 deletions(-) diff --git a/deno.json b/deno.json index 29e8643..29cad13 100644 --- a/deno.json +++ b/deno.json @@ -1,6 +1,6 @@ { "name": "@elsoul/fresh-sitemap", - "version": "0.7.12", + "version": "0.7.13", "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 604d900..e9c1fc0 100644 --- a/mod.ts +++ b/mod.ts @@ -100,18 +100,10 @@ async function generateSitemap( function processPathSegments(path: string): void { // Skip non-.tsx files if (!path.endsWith('.tsx')) return - const relPath = distDirectory === '.' - ? path - : path.substring(distDirectory.length) - // Split segments and check if any segment should exclude this path - const segments = relPath.split(SEPARATOR) - - // Construct normalized path and mark it for inclusion - const normalizedPath = `/${segments.join('/')}`.replace(/\.tsx$/, '') - pathMap[normalizedPath] = 1 + pathMap[path] = 1 console.log( - `Path added to pathMap: ${normalizedPath}, pathMap state:`, + `Path added to pathMap: ${path}, pathMap state:`, pathMap, ) } @@ -119,6 +111,7 @@ async function generateSitemap( // Recursively collect all paths in the directory async function addDirectory(directory: string) { for await (const path of stableRecurseFiles(directory)) { + console.log('Processing path:', path) processPathSegments(path) } }