Skip to content

Commit 7ad44f4

Browse files
maudetesEstelle
andauthored
feat(sitemap): use udata generated sitemap (#1176)
Following opendatateam/udata#3830 Both udata and cdata sitemaps index will be exposed in robots.txt. --------- Co-authored-by: Estelle <estelle@example.com>
1 parent 5481fb0 commit 7ad44f4

2 files changed

Lines changed: 3 additions & 95 deletions

File tree

nuxt.config.ts

Lines changed: 3 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ import { resolve } from 'node:path'
22
import tailwindcss from '@tailwindcss/vite'
33
import toml from './rollup-plugin-smol-toml'
44

5-
const nbSitemapsDatasets = 10
65
const isFrenchGovernment = true
76
// const swrDuration = process.env.NUXT_TEMPLATE_CACHE_DURATION ? parseInt(process.env.NUXT_TEMPLATE_CACHE_DURATION) : 60
87
// https://nuxt.com/docs/api/configuration/nuxt-config
@@ -392,45 +391,18 @@ export default defineNuxtConfig({
392391
sitemap: {
393392
cacheMaxAgeSeconds: 3600, // 1 hour
394393
sitemaps: {
395-
content: {
394+
static: {
396395
includeAppSources: true,
397396
exclude: ['/admin/**'],
398397
},
399-
dataservices: {
400-
sources: [
401-
'/nuxt-api/sitemaps/urls?type=dataservice',
402-
],
403-
},
404-
organizations: {
405-
sources: [
406-
'/nuxt-api/sitemaps/urls?type=organization',
407-
],
408-
},
409-
posts: {
410-
sources: [
411-
'/nuxt-api/sitemaps/urls?type=post',
412-
],
413-
},
414-
reuses: {
415-
sources: [
416-
'/nuxt-api/sitemaps/urls?type=reuse',
417-
],
418-
},
419-
// split datasets between nbSitemapsDatasets sections
420-
...Array.from({ length: nbSitemapsDatasets }, (_, i) => i + 1).map(section => ({
421-
[`datasets_${section}`]: {
422-
sources: [
423-
`/nuxt-api/sitemaps/urls?type=dataset&section=${section}&nbSitemapSections=${nbSitemapsDatasets}`,
424-
],
425-
},
426-
})).reduce((acc, obj) => ({ ...acc, ...obj }), {}),
427398
pages: {
428399
sources: [
429400
'/nuxt-api/sitemaps/pages',
430401
],
431402
},
432-
// TODO: add support
433403
},
404+
405+
// TODO: add /support pages
434406
},
435407
// TODO: add sentry config for stack traces based on source maps
436408
// https://docs.sentry.io/platforms/javascript/guides/nuxt/#add-readable-stack-traces-to-errors

server/routes/nuxt-api/sitemaps/urls.ts

Lines changed: 0 additions & 64 deletions
This file was deleted.

0 commit comments

Comments
 (0)