Skip to content

Commit 6a40551

Browse files
adding last mod to jobs in sitemap
1 parent bdc01bf commit 6a40551

File tree

1 file changed

+19
-6
lines changed

1 file changed

+19
-6
lines changed

astro.config.mjs

Lines changed: 19 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,22 @@ import image from "@astrojs/image";
1515
// https://astro.build/config
1616
export default defineConfig({
1717
site: "https://cucoders.dev/",
18-
integrations: [tailwind(), sitemap(), partytown({
19-
config: {
20-
forward: ["dataLayer.push"]
21-
}
22-
}), image()]
23-
});
18+
integrations: [
19+
tailwind(),
20+
sitemap({
21+
serialize(item) {
22+
if (/.*empleos\/(\d{4}-\d{2}-\d{2})\/.*/.test(item.url)) {
23+
const date = item.url.split("/")[4]
24+
item.lastmod = new Date(date);
25+
}
26+
return item;
27+
},
28+
}),
29+
partytown({
30+
config: {
31+
forward: ["dataLayer.push"],
32+
},
33+
}),
34+
image(),
35+
],
36+
});

0 commit comments

Comments
 (0)