Files
Eric 5a0b17bac5 Website: Update landing pages folder and routes (#45632)
Changes:
- Moved the files for four pages (linux-management, basic-comparison,
deployment, and gitops-workshop) out of the landing pages folder.
- Added policies for the moved pages
- Updated the URLs for pages in the landing pages folder to be prefixed
with /lp/, and added redirects that preserve query strings when
redirecting users.
- Created a section in the routes configuration for landing pages

<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit

* **New Features**
* Implemented /lp/* landing-page paths with 301 redirects from legacy
URLs (query strings preserved).
* Added public access exceptions so selected marketing pages are
reachable without login.

* **Refactor**
* Reorganized routing and page templates to move several pages out of
the previous landing-pages area into dedicated page paths.
* Updated included page scripts and style imports to match the
reorganized pages.

<!-- review_stack_entry_start -->

[![Review Change
Stack](https://storage.googleapis.com/coderabbit_public_assets/review-stack-in-coderabbit-ui.svg)](https://app.coderabbit.ai/change-stack/fleetdm/fleet/pull/45632)

<!-- review_stack_entry_end -->
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2026-05-15 14:04:45 -05:00

67 lines
1.3 KiB
JavaScript
Vendored

module.exports = {
friendlyName: 'View basic comparison',
description: 'Display "Basic comparison" page.',
inputs: {
slug: {
type: 'string',
description: 'The slug of the comparison page that will be displayed to the user',
required: true,
}
},
exits: {
success: {
viewTemplatePath: 'pages/articles/basic-comparison'
},
badConfig: {
responseType: 'badConfig'
},
notFound: {
responseType: 'notFound'
},
},
fn: async function ({slug}) {
if (!_.isObject(sails.config.builtStaticContent) || !_.isArray(sails.config.builtStaticContent.markdownPages) || !sails.config.builtStaticContent.markdownPages) {
throw {badConfig: 'builtStaticContent.markdownPages'};
}
let thisPage = _.find(sails.config.builtStaticContent.markdownPages, { url: '/compare/'+encodeURIComponent(slug) });
if (!thisPage) {
throw 'notFound';
}
let pageTitleForMeta;
let pageDescriptionForMeta;
if(thisPage.meta.articleTitle) {
pageTitleForMeta = thisPage.meta.articleTitle;
}
if(thisPage.meta.description) {
pageDescriptionForMeta = thisPage.meta.description;
}
// Respond with view.
return {
pageTitleForMeta,
pageDescriptionForMeta,
path: require('path'),
thisPage: thisPage,
};
}
};