Skip to content

Commit

Permalink
fixing
Browse files Browse the repository at this point in the history
  • Loading branch information
KishiTheMechanic committed Oct 29, 2024
1 parent 40fd1e8 commit a0135ce
Show file tree
Hide file tree
Showing 2 changed files with 9 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": "1.0.10",
"version": "1.0.11",
"description": "This plugin generates a sitemap for a Deno Fresh v2 project.",
"runtimes": ["deno", "browser"],
"exports": "./mod.ts",
Expand Down
14 changes: 8 additions & 6 deletions mod.ts
Original file line number Diff line number Diff line change
Expand Up @@ -245,16 +245,17 @@ async function generateArticlesSitemap(
/\.md$/,
'',
)
const removedLocaleSegments = relPath.split(SEPARATOR)
console.log(removedLocaleSegments)
const articleType = removedLocaleSegments[1]
const segments = relPath.split(SEPARATOR)
const articleType = segments[1]
const articleRoute = await findFolderPathRecursively(
articlesDirectory,
'./routes',
articleType,
)
if (!articleRoute) return

const routeSegments = articleRoute.split(SEPARATOR)
const routeSegments = articleRoute.replace('./routes', '').split(
SEPARATOR,
)

const segCheckObj = arrayToObject(routeSegments)

Expand All @@ -264,7 +265,8 @@ async function generateArticlesSitemap(
.filter((segment) => checkedSegments[segment] === 1)
.join('/')

const pathname = neededSegmentsPath
const slugSegmentsPath = segments.slice(3).join('/')
const pathname = neededSegmentsPath + '/' + slugSegmentsPath

console.log(pathname)

Expand Down

0 comments on commit a0135ce

Please sign in to comment.