From c4bc41ad4fb8be9e8804ede975c0e89be991e1f5 Mon Sep 17 00:00:00 2001 From: eashaw Date: Thu, 16 Sep 2021 02:23:59 -0500 Subject: [PATCH] Add page titles and descriptions to fleetdm.com (#2082) * added title to locals in routes * using title and description if they are passed into the locals * fix error being thrown if there is no description * descriptions * fixed error, updated descriptions * update twitter card title * updated descriptions again * updated twitter title --- website/config/routes.js | 78 ++++++++++++++++++++++++++++---- website/views/layouts/layout.ejs | 7 +-- 2 files changed, 72 insertions(+), 13 deletions(-) diff --git a/website/config/routes.js b/website/config/routes.js index 6a1b6ffdeb..c107ee8700 100644 --- a/website/config/routes.js +++ b/website/config/routes.js @@ -13,19 +13,77 @@ module.exports.routes = { // ╦ ╦╔═╗╔╗ ╔═╗╔═╗╔═╗╔═╗╔═╗ // ║║║║╣ ╠╩╗╠═╝╠═╣║ ╦║╣ ╚═╗ // ╚╩╝╚═╝╚═╝╩ ╩ ╩╚═╝╚═╝╚═╝ - 'GET /': { action: 'view-homepage-or-redirect', locals: { isHomepage: true } }, - 'GET /company/contact': { action: 'view-contact' }, - 'GET /get-started': { action: 'view-get-started' }, - 'GET /pricing': { action: 'view-pricing' }, - 'GET /press-kit': { action: 'view-press-kit' }, + 'GET /': { + action: 'view-homepage-or-redirect', + locals: { isHomepage: true } + }, - 'GET /queries': { action: 'view-query-library' }, - 'GET /queries/:slug': { action: 'view-query-detail' }, + 'GET /company/contact': { + action: 'view-contact', + locals:{ + title: 'Contact us | Fleet for osquery', + description: 'Get in touch with our team.' + } + }, - 'GET /docs/?*': { skipAssets: false, action: 'docs/view-basic-documentation' },// handles /docs and /docs/foo/bar - // 'GET /handbook/?*': { skipAssets: false, action: 'handbook/view-basic-handbook' },// handles /handbook and /handbook/foo/bar + 'GET /get-started': { + action: 'view-get-started' , + locals:{ + title: 'Get Started | Fleet for osquery', + description: 'Learn about getting started with Fleet.' + } + }, - 'GET /transparency': { action: 'view-transparency' }, + 'GET /pricing': { + action: 'view-pricing', + locals:{ + title: 'Pricing | Fleet for osquery', + description: 'View Fleet plans and pricing details.' + } + }, + + 'GET /press-kit': { + action: 'view-press-kit', + locals:{ + title: 'Press kit | Fleet for osquery', + description: 'Download Fleet logos, wallpapers, and screenshots.' + } + }, + + 'GET /queries': { + action: 'view-query-library', + locals:{ + title: 'Queries | Fleet for osquery', + description: 'A growing collection of useful queries for organizations deploying Fleet and osquery.' + } + }, + + 'GET /queries/:slug': { + action: 'view-query-detail', + locals:{ + title: 'Query details | Fleet for osquery', + description: 'View more information about a query in Fleet\'s standard query library', + } + }, + + 'GET /docs/?*': { + skipAssets: false, + action: 'docs/view-basic-documentation', + locals:{ + title: 'Documentation | Fleet for osquery', + description: 'Documentation for Fleet for osquery.', + } + },// handles /docs and /docs/foo/bar + + // 'GET /handbook/?*': { skipAssets: false, action: 'handbook/view-basic-handbook' },// handles /handbook and /handbook/foo/bar + + 'GET /transparency': { + action: 'view-transparency', + locals:{ + title: 'Transparency | Fleet for osquery', + description: 'Learn what data osquery can see.', + } + }, diff --git a/website/views/layouts/layout.ejs b/website/views/layouts/layout.ejs index 2f956ccbbd..d609febe48 100644 --- a/website/views/layouts/layout.ejs +++ b/website/views/layouts/layout.ejs @@ -7,14 +7,15 @@ %> - Fleet for osquery | Open source device management + <%= typeof title !== 'undefined' ? title : 'Fleet for osquery | Open source device management' %> + <% /* Viewport tag for sensible mobile support */ %> - - + + <% /* Script tags should normally be included further down the page- but any scripts that load fonts (e.g. Fontawesome ≥v5) are special exceptions to the