Merged in feat/SW-550-sitemap (pull request #981)

feat(SW-550): added sync functionality and sitemap generation

* feat(SW-550): added sync functionality and sitemap generation

* feat(SW-550): Added support for splitting and saving multiple sitemaps when there are 50000+ urls

* feat(SW-550): Updates after PR

* feat(SW-550): Added locale to sitemap data

* feat(SW-550): Added support for locale based sitemapData

* feat(SW-550): Saving alternates of sitemap entries

* feat(SW-550): Refactoring to use sitemap utils file

* feat(SW-550): Using Netlify.env to get environment variables

* feat(SW-550): clarify use of functions


Approved-by: Michael Zetterberg
This commit is contained in:
Erik Tiekstra
2025-02-17 10:35:11 +00:00
parent 577271c577
commit c93381ca80
13 changed files with 887 additions and 56 deletions

View File

@@ -0,0 +1,17 @@
/* eslint-disable import/no-anonymous-default-export */
import type { Context } from "@netlify/functions"
export default async (request: Request, context: Context) => {
const { next_run } = await request.json()
const SITEMAP_SYNC_SECRET = Netlify.env.get("SITEMAP_SYNC_SECRET")
const PUBLIC_URL = Netlify.env.get("PUBLIC_URL")
console.info(
`Started sitemap sync at: ${new Date().toISOString()}! Next invocation at: ${next_run}`
)
const headers = new Headers()
headers.set("x-sitemap-sync-secret", SITEMAP_SYNC_SECRET!)
fetch(`${PUBLIC_URL}/api/sitemap`, {
headers,
})
}