Philip
Philip
NNuxt
Created by MinecraftStorage on 6/27/2024 in #❓・help
How are you resolving routes while using I18n module?
No description
6 replies
NNuxt
Created by MinecraftStorage on 6/27/2024 in #❓・help
How are you resolving routes while using I18n module?
did you put in the head of the html your default lang? and can you show your nuxt config?
6 replies
NNuxt
Created by Philip on 6/27/2024 in #❓・help
sitemap module wont show dynamic routes, routes are empty
ich gucke mal wie ich Zeit finde 😅 vllt habe ich doch etwas falsch gemacht und durch Zufall einen workaround gefunden. In einem anderem Projekt werde ich nochmal genau das machen was die docs sagen und sollte sich das nochmal bestätigen, dass es nicht funktioniert mit der Ordnerstruktur, dann mache ich einen PR versprochen.
29 replies
NNuxt
Created by Philip on 6/27/2024 in #❓・help
sitemap module wont show dynamic routes, routes are empty
29 replies
NNuxt
Created by Philip on 6/27/2024 in #❓・help
sitemap module wont show dynamic routes, routes are empty
import { asSitemapUrl, defineSitemapEventHandler } from "#imports";

export default defineSitemapEventHandler(async () => {
const [pages, subpages, instructions] = await Promise.all([
$fetch("CDN URL/items/pages").then((resp) =>
resp.data.map((item) => {
return {
_path: item.slug,
modifiedAt: new Date(),
};
})
),
$fetch("CDN URL/items/sub_pages?fields=*.*.*").then(
(resp) =>
resp.data.map((item) => {
let url = "/support";
url += item.category
? `/${item.category}/${item.translations[0].slug}`
: `/${item.translations[0].slug}`;

return {
_path: url,
modifiedAt: new Date(),
};
})
),
$fetch("CDN URL/items/Instructions?fields=*.*.*").then(
(resp) =>
resp.data.flatMap((item) => {
var url = "/support/" + item.translations[0].slug + "/anleitungen/";

return item.translations[0].instructions.map((instruction) => {
return {
_path: url + instruction.slug,
modifiedAt: new Date(),
};
});
})
),
]);
return [...pages, ...subpages, ...instructions].map((p) =>
asSitemapUrl({
loc: p._path,
lastmod: p.modifiedAt,
})
);
});
import { asSitemapUrl, defineSitemapEventHandler } from "#imports";

export default defineSitemapEventHandler(async () => {
const [pages, subpages, instructions] = await Promise.all([
$fetch("CDN URL/items/pages").then((resp) =>
resp.data.map((item) => {
return {
_path: item.slug,
modifiedAt: new Date(),
};
})
),
$fetch("CDN URL/items/sub_pages?fields=*.*.*").then(
(resp) =>
resp.data.map((item) => {
let url = "/support";
url += item.category
? `/${item.category}/${item.translations[0].slug}`
: `/${item.translations[0].slug}`;

return {
_path: url,
modifiedAt: new Date(),
};
})
),
$fetch("CDN URL/items/Instructions?fields=*.*.*").then(
(resp) =>
resp.data.flatMap((item) => {
var url = "/support/" + item.translations[0].slug + "/anleitungen/";

return item.translations[0].instructions.map((instruction) => {
return {
_path: url + instruction.slug,
modifiedAt: new Date(),
};
});
})
),
]);
return [...pages, ...subpages, ...instructions].map((p) =>
asSitemapUrl({
loc: p._path,
lastmod: p.modifiedAt,
})
);
});
here our rewritten code for the sitemap.ts
29 replies
NNuxt
Created by Philip on 6/27/2024 in #❓・help
sitemap module wont show dynamic routes, routes are empty
No description
29 replies
NNuxt
Created by Philip on 6/27/2024 in #❓・help
sitemap module wont show dynamic routes, routes are empty
a small version of it wouldnt reproduce the issue
29 replies
NNuxt
Created by Philip on 6/27/2024 in #❓・help
sitemap module wont show dynamic routes, routes are empty
our project is quite big and there are some dependencies which are building on each other and i think to reproduce this case is almost like building the project again (4-5 month)
29 replies
NNuxt
Created by Philip on 6/27/2024 in #❓・help
sitemap module wont show dynamic routes, routes are empty
its just i dont really wanna publish our cdn or credentials and to reproduce everything will take ma ton of time 😦 Isnt there a better way? i get you, that you dont wanna reproduce all by yourself. But to create a new directus project cdn etc. just to reproduce this issue is a bit to much dont you think so?
29 replies
NNuxt
Created by Philip on 6/27/2024 in #❓・help
sitemap module wont show dynamic routes, routes are empty
thanks
29 replies
NNuxt
Created by Philip on 6/27/2024 in #❓・help
sitemap module wont show dynamic routes, routes are empty
i will try to do that
29 replies
NNuxt
Created by Philip on 6/27/2024 in #❓・help
sitemap module wont show dynamic routes, routes are empty
ahh i see
29 replies
NNuxt
Created by Philip on 6/27/2024 in #❓・help
sitemap module wont show dynamic routes, routes are empty
you want a small version which you can just pull and reprodurce?
29 replies
NNuxt
Created by Philip on 6/27/2024 in #❓・help
sitemap module wont show dynamic routes, routes are empty
i totally get this, but what can i provide what makes it easier for you to reproduce?
29 replies
NNuxt
Created by Philip on 6/27/2024 in #❓・help
sitemap module wont show dynamic routes, routes are empty
https://support.utm-shop.de/ this is our live webpage do you want this?
29 replies
NNuxt
Created by Philip on 6/27/2024 in #❓・help
sitemap module wont show dynamic routes, routes are empty
No description
29 replies