From 03d403e0b439bbba278d0bd6676dcf93b890fecf Mon Sep 17 00:00:00 2001 From: Pascal Berger Date: Wed, 22 Feb 2023 14:17:12 +0100 Subject: [PATCH] Add possibility to override Bootstrap version --- SiteKeys.cs | 10 ++++++++++ input/_Layout.cshtml | 14 +++++++++++++- 2 files changed, 23 insertions(+), 1 deletion(-) diff --git a/SiteKeys.cs b/SiteKeys.cs index ba75ffd..8c24eae 100644 --- a/SiteKeys.cs +++ b/SiteKeys.cs @@ -69,5 +69,15 @@ public static class SiteKeys /// A Google Fonts (or other) URL for use in a link element in the header. /// public const string FontLink = nameof(FontLink); + + /// + /// Version of Bootstrap to use. Default is 4.4.1. + /// + public const string BootstrapVersion = nameof(BootstrapVersion); + + /// + /// Integrity hash of Bootstrap vesion defined in . Default is integrity hash of Bootstrap 4.4.1. + /// + public const string BootstrapIntegrityHash = nameof(BootstrapIntegrityHash); } } \ No newline at end of file diff --git a/input/_Layout.cshtml b/input/_Layout.cshtml index aeaafbe..b880dc5 100644 --- a/input/_Layout.cshtml +++ b/input/_Layout.cshtml @@ -27,9 +27,21 @@ + @{ + string bootstrapVersion = Document.GetString(SiteKeys.BootstrapVersion); + if (bootstrapVersion.IsNullOrWhiteSpace()) + { + bootstrapVersion = "4.4.1"; + } + string bootstrapIntegrityHash = Document.GetString(SiteKeys.BootstrapIntegrityHash); + if (bootstrapIntegrityHash.IsNullOrWhiteSpace()) + { + bootstrapIntegrityHash = "sha384-wfSDF2E50Y2D1uUdj0O3uMBJnjuUD4Ih7YwaYd1iqfktj0Uod8GCExl3Og8ifwB6"; + } + } - +