Skip to content

Commit

Permalink
fixing
Browse files Browse the repository at this point in the history
  • Loading branch information
KishiTheMechanic committed Oct 28, 2024
1 parent 497e7c1 commit afd7148
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 11 deletions.
2 changes: 1 addition & 1 deletion deno.json
Original file line number Diff line number Diff line change
@@ -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",
Expand Down
13 changes: 3 additions & 10 deletions mod.ts
Original file line number Diff line number Diff line change
Expand Up @@ -100,25 +100,18 @@ 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,
)
}

// 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)
}
}
Expand Down

0 comments on commit afd7148

Please sign in to comment.