From 20a1baf6f9e110b370002e597754229c86e0269f Mon Sep 17 00:00:00 2001 From: Peter Hedenskog Date: Wed, 8 May 2024 10:58:20 +0200 Subject: [PATCH] Make the home URL configure (#4151) --- lib/cli/cli.js | 5 +++++ lib/plugins/html/htmlBuilder.js | 3 +++ lib/plugins/html/templates/header.pug | 2 +- 3 files changed, 9 insertions(+), 1 deletion(-) diff --git a/lib/cli/cli.js b/lib/cli/cli.js index 07a3143ba..2ecc6a6b7 100644 --- a/lib/cli/cli.js +++ b/lib/cli/cli.js @@ -1789,6 +1789,11 @@ export async function parseCommandLine() { default: false, type: 'boolean' }) + .option('html.homeurl', { + default: 'https://www.sitespeed.io/', + describe: 'The URL for the logo in the result', + group: 'HTML' + }) .option('summary', { describe: 'Show brief text summary to stdout', default: false, diff --git a/lib/plugins/html/htmlBuilder.js b/lib/plugins/html/htmlBuilder.js index 0ef793a1c..854715ac9 100644 --- a/lib/plugins/html/htmlBuilder.js +++ b/lib/plugins/html/htmlBuilder.js @@ -312,6 +312,7 @@ export class HTMLBuilder { rootPath, resultUrls: this.context.resultUrls, assetsPath: assetsBaseURL || rootPath, + sitespeedioURL: options.html.homeurl, menu: 'pages', pageTitle: `Summary for ${helpers.plural( this.options.browsertime.iterations, @@ -384,6 +385,7 @@ export class HTMLBuilder { rootPath, resultUrls: this.context.resultUrls, assetsPath: assetsBaseURL || rootPath, + sitespeedioURL: options.html.homeurl, menu: 'pages', pageTitle: `Run ${ Number.parseInt(runIndex) + 1 @@ -449,6 +451,7 @@ export class HTMLBuilder { h: helpers, rootPath: '', assetsPath: assetsBaseURL || '', + sitespeedioURL: options.html.homeurl, menu: name, pageTitle: name, pageDescription: '', diff --git a/lib/plugins/html/templates/header.pug b/lib/plugins/html/templates/header.pug index d5120854c..3190abb7c 100644 --- a/lib/plugins/html/templates/header.pug +++ b/lib/plugins/html/templates/header.pug @@ -7,7 +7,7 @@ mixin headerLink(id, name) .darkblue.nav .navgrid .logo - a(href='https://www.sitespeed.io') + a(href=sitespeedioURL) img.navbar-brand(src= assetsPath + 'img/sitespeed.io-logo.png', width='162', height='50', alt='sitespeed.io logo') ul +headerLink('index', 'Summary')