mirror of
https://github.com/fleetdm/fleet
synced 2026-05-23 17:08:53 +00:00
Website: Update policies and vitals page URLs in download-sitemap (#25719)
Related to: https://github.com/fleetdm/fleet/issues/25718 Changes: - Updated `download-sitemap.js` to add the correct URLS of vitals and policies pages.
This commit is contained in:
parent
e81f0f82f2
commit
7fd9d8a3e9
1 changed files with 12 additions and 1 deletions
13
website/api/controllers/download-sitemap.js
vendored
13
website/api/controllers/download-sitemap.js
vendored
|
|
@ -34,6 +34,8 @@ module.exports = {
|
|||
throw {badConfig: 'builtStaticContent.queries'};
|
||||
} else if (!_.isArray(sails.config.builtStaticContent.markdownPages)) {
|
||||
throw {badConfig: 'builtStaticContent.markdownPages'};
|
||||
} else if (!_.isArray(sails.config.builtStaticContent.policies)) {
|
||||
throw {badConfig: 'builtStaticContent.policies'};
|
||||
}
|
||||
|
||||
// Start with sitemap.xml preamble + the root relative URLs of other webpages that aren't being generated from markdown
|
||||
|
|
@ -79,9 +81,18 @@ module.exports = {
|
|||
// ╔╦╗╦ ╦╔╗╔╔═╗╔╦╗╦╔═╗ ╔═╗╔═╗╦═╗ ╔═╗ ╦ ╦╔═╗╦═╗╦ ╦ ╔═╗╔═╗╔═╗╔═╗╔═╗
|
||||
// ║║╚╦╝║║║╠═╣║║║║║ ╠═╝║╣ ╠╦╝───║═╬╗║ ║║╣ ╠╦╝╚╦╝ ╠═╝╠═╣║ ╦║╣ ╚═╗
|
||||
// ═╩╝ ╩ ╝╚╝╩ ╩╩ ╩╩╚═╝ ╩ ╚═╝╩╚═ ╚═╝╚╚═╝╚═╝╩╚═ ╩ ╩ ╩ ╩╚═╝╚═╝╚═╝
|
||||
for (let query of sails.config.builtStaticContent.queries) {
|
||||
let vitals = _.where(sails.config.builtStaticContent.queries, {kind: 'built-in'});
|
||||
let queries = _.where(sails.config.builtStaticContent.queries, {kind: 'query'});
|
||||
let policies = _.where(sails.config.builtStaticContent.policies, {kind: 'policy'});
|
||||
for (let query of queries) {
|
||||
sitemapXml +=`<url><loc>${_.escape(sails.config.custom.baseUrl+`/queries/${query.slug}`)}</loc></url>`;// note we omit lastmod for some sitemap entries. This is ok, to mix w/ other entries that do have lastmod. Why? See https://docs.google.com/document/d/1SbpSlyZVXWXVA_xRTaYbgs3750jn252oXyMFLEQxMeU/edit
|
||||
}//∞
|
||||
for (let query of vitals) {
|
||||
sitemapXml +=`<url><loc>${_.escape(sails.config.custom.baseUrl+`/vitals/${query.slug}`)}</loc></url>`;// note we omit lastmod for some sitemap entries. This is ok, to mix w/ other entries that do have lastmod. Why? See https://docs.google.com/document/d/1SbpSlyZVXWXVA_xRTaYbgs3750jn252oXyMFLEQxMeU/edit
|
||||
}//∞
|
||||
for (let query of policies) {
|
||||
sitemapXml +=`<url><loc>${_.escape(sails.config.custom.baseUrl+`/policies/${query.slug}`)}</loc></url>`;// note we omit lastmod for some sitemap entries. This is ok, to mix w/ other entries that do have lastmod. Why? See https://docs.google.com/document/d/1SbpSlyZVXWXVA_xRTaYbgs3750jn252oXyMFLEQxMeU/edit
|
||||
}//∞
|
||||
// ╔╦╗╦ ╦╔╗╔╔═╗╔╦╗╦╔═╗ ╔═╗╔═╗╔═╗╔═╗╔═╗ ╔═╗╦═╗╔═╗╔╦╗ ╔╦╗╔═╗╦═╗╦╔═╔╦╗╔═╗╦ ╦╔╗╔
|
||||
// ║║╚╦╝║║║╠═╣║║║║║ ╠═╝╠═╣║ ╦║╣ ╚═╗ ╠╣ ╠╦╝║ ║║║║ ║║║╠═╣╠╦╝╠╩╗ ║║║ ║║║║║║║
|
||||
// ═╩╝ ╩ ╝╚╝╩ ╩╩ ╩╩╚═╝ ╩ ╩ ╩╚═╝╚═╝╚═╝ ╚ ╩╚═╚═╝╩ ╩ ╩ ╩╩ ╩╩╚═╩ ╩═╩╝╚═╝╚╩╝╝╚╝
|
||||
|
|
|
|||
Loading…
Reference in a new issue