refactor: Update fileLocation logic in Sitemap class
This commit is contained in:
parent
9aeaec0821
commit
4bb8b0e73d
@ -91,7 +91,7 @@ class Sitemap {
|
|||||||
return path.join(this.pagesPath, href.replace("/", ""), "+Page.tsx");
|
return path.join(this.pagesPath, href.replace("/", ""), "+Page.tsx");
|
||||||
}
|
}
|
||||||
|
|
||||||
return path.join(this.pagesPath, href.replace("/", ""), "page.md");
|
return path.join(this.dataPath, href.replace("/", ""), "page.md");
|
||||||
}
|
}
|
||||||
|
|
||||||
private loadSubitems(subitems: (typeof navigation)[number]["links"][number]["subitems"]): void {
|
private loadSubitems(subitems: (typeof navigation)[number]["links"][number]["subitems"]): void {
|
||||||
@ -117,6 +117,9 @@ class Sitemap {
|
|||||||
return this.loadSubitems(link.subitems);
|
return this.loadSubitems(link.subitems);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const fileLocation = this.getFileServerLocation(link.href);
|
||||||
|
console.log("File location:", fileLocation);
|
||||||
|
|
||||||
const priority = this.loadPriority(link.href);
|
const priority = this.loadPriority(link.href);
|
||||||
const lastmod = this.loadLastModified(link.href);
|
const lastmod = this.loadLastModified(link.href);
|
||||||
const location = `${this.baseUrl}${link.href}`;
|
const location = `${this.baseUrl}${link.href}`;
|
||||||
@ -135,8 +138,6 @@ class Sitemap {
|
|||||||
this.urls = Array.from(new Set(this.urls)).sort((a, b) => {
|
this.urls = Array.from(new Set(this.urls)).sort((a, b) => {
|
||||||
return a.location.localeCompare(b.location);
|
return a.location.localeCompare(b.location);
|
||||||
});
|
});
|
||||||
|
|
||||||
console.log("Loaded URLs:", this.urls);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public generateSitemap(): void {
|
public generateSitemap(): void {
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user