From 329e6187b12cb8df08357774da8b1b00fa37bf00 Mon Sep 17 00:00:00 2001 From: OllieJC Date: Thu, 28 Oct 2021 10:56:45 +0100 Subject: [PATCH 1/3] Use Middleman redirect --- config.rb | 4 ++++ source/_config.yml | 2 ++ 2 files changed, 6 insertions(+) create mode 100644 source/_config.yml diff --git a/config.rb b/config.rb index efc69f57f..9323256d6 100644 --- a/config.rb +++ b/config.rb @@ -48,6 +48,9 @@ config[:tech_docs] = YAML.load_file(config_file).with_indifferent_access activate :unique_identifier +redirect 'security.txt/index.html', to: 'https://vdp.cabinetoffice.gov.uk/.well-known/security.txt' +redirect '.well-known/security.txt/index.html', to: 'https://vdp.cabinetoffice.gov.uk/.well-known/security.txt' + helpers do include GovukTechDocs::ContributionBanner @@ -136,3 +139,4 @@ def active_page(page_path) locals: { overview: ApiCatalogueOverview.new(api_catalogue) }, ignore: true, ) + diff --git a/source/_config.yml b/source/_config.yml new file mode 100644 index 000000000..45a5ea3aa --- /dev/null +++ b/source/_config.yml @@ -0,0 +1,2 @@ +include: +- ".well-known" From 946f5ca130726fa65d7983ee4c6198c1f9b22bba Mon Sep 17 00:00:00 2001 From: OllieJC Date: Thu, 28 Oct 2021 11:03:23 +0100 Subject: [PATCH 2/3] Lint fixes --- config.rb | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/config.rb b/config.rb index 9323256d6..65495ef7a 100644 --- a/config.rb +++ b/config.rb @@ -48,8 +48,8 @@ config[:tech_docs] = YAML.load_file(config_file).with_indifferent_access activate :unique_identifier -redirect 'security.txt/index.html', to: 'https://vdp.cabinetoffice.gov.uk/.well-known/security.txt' -redirect '.well-known/security.txt/index.html', to: 'https://vdp.cabinetoffice.gov.uk/.well-known/security.txt' +redirect "security.txt/index.html", to: "https://vdp.cabinetoffice.gov.uk/.well-known/security.txt" +redirect ".well-known/security.txt/index.html", to: "https://vdp.cabinetoffice.gov.uk/.well-known/security.txt" helpers do include GovukTechDocs::ContributionBanner @@ -139,4 +139,3 @@ def active_page(page_path) locals: { overview: ApiCatalogueOverview.new(api_catalogue) }, ignore: true, ) - From 630adc2002367a52a08500120d03e2a3daabe1e0 Mon Sep 17 00:00:00 2001 From: OllieJC Date: Thu, 28 Oct 2021 11:42:07 +0100 Subject: [PATCH 3/3] Ensure _config.yml is in build --- config.rb | 1 + 1 file changed, 1 insertion(+) diff --git a/config.rb b/config.rb index 65495ef7a..b9aaa038d 100644 --- a/config.rb +++ b/config.rb @@ -50,6 +50,7 @@ redirect "security.txt/index.html", to: "https://vdp.cabinetoffice.gov.uk/.well-known/security.txt" redirect ".well-known/security.txt/index.html", to: "https://vdp.cabinetoffice.gov.uk/.well-known/security.txt" +import_file File.expand_path("_config.yml", config[:source]), "/_config.yml" helpers do include GovukTechDocs::ContributionBanner