Skip to content

Commit

Permalink
fix output pahts
Browse files Browse the repository at this point in the history
  • Loading branch information
KishiTheMechanic committed Oct 27, 2024
1 parent a51e3cf commit b7e72d8
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 7 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.4.0",
"version": "0.5.0",
"description": "Lightweight global state management library for Fresh framework using Preact signals.",
"runtimes": ["deno", "browser"],
"exports": "./mod.ts",
Expand Down
9 changes: 3 additions & 6 deletions mod.ts
Original file line number Diff line number Diff line change
Expand Up @@ -113,14 +113,12 @@ async function generateSitemap(
: path.substring(distDirectory.length)
let pathname = normalize(`/${relPath}`).split(SEPARATOR).join('/')

// Exclude files and directories with '_' prefix, grouping directories, and index files
// Exclude grouping and dynamic directories, _-prefixed files, and index files
if (
pathname.includes('(') || pathname.includes('[') ||
pathname.includes('_') || pathname.endsWith('index')
pathname.includes('_')
) continue

// Remove .tsx extension
pathname = pathname.replace(/\.tsx$/, '')
pathname = pathname.replace(/\.tsx$/, '').replace(/\/index$/, '')

const isExcluded = exclude && exclude.test(pathname.substring(1))
const isIncluded = !include || include.test(pathname.substring(1))
Expand All @@ -132,7 +130,6 @@ async function generateSitemap(
lastmod: (mtime ?? new Date()).toISOString(),
})

// Add paths for each specified language
options.languages?.forEach((lang) => {
if (lang !== options.defaultLanguage) {
sitemap.push({
Expand Down

0 comments on commit b7e72d8

Please sign in to comment.