From b5c43cdf3621d0dab8cb778a51bf828ad564a871 Mon Sep 17 00:00:00 2001 From: Dominik Rimpf <dominik.rimpf@kit.edu> Date: Mon, 19 Aug 2024 21:11:55 +0000 Subject: [PATCH] Revert CSP fixes. They need more work. --- go.mod | 4 +- go.sum | 8 --- .../fsetit/assets/js/dark-mode-switch-body.js | 5 -- themes/fsetit/assets/js/pagefind-loader.js | 9 --- themes/fsetit/assets/scss/accessibility.scss | 11 --- themes/fsetit/assets/scss/bs.scss | 16 ----- themes/fsetit/assets/scss/index.scss | 36 ---------- .../fsetit/assets/scss/list/header_image.scss | 24 ------- .../assets/scss/single/header_image.scss | 21 ------ themes/fsetit/layouts/_default/baseof.html | 17 ++--- themes/fsetit/layouts/_default/list.html | 43 ++++++++---- themes/fsetit/layouts/_default/single.html | 33 ++++++--- themes/fsetit/layouts/index.html | 69 ++++++++++++------- themes/fsetit/layouts/news/single.html | 33 ++++++--- themes/fsetit/layouts/partials/head.html | 21 ++++-- themes/fsetit/layouts/partials/menu.html | 2 +- 16 files changed, 144 insertions(+), 208 deletions(-) delete mode 100644 themes/fsetit/assets/js/dark-mode-switch-body.js delete mode 100644 themes/fsetit/assets/js/pagefind-loader.js delete mode 100644 themes/fsetit/assets/scss/accessibility.scss delete mode 100644 themes/fsetit/assets/scss/index.scss delete mode 100644 themes/fsetit/assets/scss/list/header_image.scss delete mode 100644 themes/fsetit/assets/scss/single/header_image.scss diff --git a/go.mod b/go.mod index 958cb08..4facd80 100644 --- a/go.mod +++ b/go.mod @@ -7,7 +7,7 @@ require ( github.com/gohugoio/hugo-mod-jslibs-dist/popperjs/v2 v2.21100.20000 // indirect github.com/lipis/flag-icons v7.2.3+incompatible // indirect github.com/twbs/bootstrap v5.3.3+incompatible // indirect - gitlab.kit.edu/kit/fs-etit/www-ag/website-modules/available-minutes v0.0.0-20240819192222-f6681130fb7a // indirect - gitlab.kit.edu/kit/fs-etit/www-ag/website-modules/opening-hours v0.0.0-20240819203457-88723a4b72f6 // indirect + gitlab.kit.edu/kit/fs-etit/www-ag/website-modules/available-minutes v0.0.0-20240703093600-adecdf8f73bf // indirect + gitlab.kit.edu/kit/fs-etit/www-ag/website-modules/opening-hours v0.0.0-20240415225540-7f762b74fb00 // indirect gitlab.kit.edu/kit/fs-etit/www-ag/website-modules/timetables v0.0.0-20240415191818-b9e45b26479a // indirect ) diff --git a/go.sum b/go.sum index d624b97..79601cb 100644 --- a/go.sum +++ b/go.sum @@ -34,18 +34,10 @@ gitlab.kit.edu/kit/fs-etit/www-ag/website-modules/available-minutes v0.0.0-20240 gitlab.kit.edu/kit/fs-etit/www-ag/website-modules/available-minutes v0.0.0-20240703093151-96153b6ee78c/go.mod h1:ShFAmGcPPDkRZ2fl+ElsXrJib+xWi9n3IU9DZvX76kI= gitlab.kit.edu/kit/fs-etit/www-ag/website-modules/available-minutes v0.0.0-20240703093600-adecdf8f73bf h1:Mle/KbKuD+30nz8sVPst7KsdV65jreMC6DdrDrvQDtI= gitlab.kit.edu/kit/fs-etit/www-ag/website-modules/available-minutes v0.0.0-20240703093600-adecdf8f73bf/go.mod h1:ShFAmGcPPDkRZ2fl+ElsXrJib+xWi9n3IU9DZvX76kI= -gitlab.kit.edu/kit/fs-etit/www-ag/website-modules/available-minutes v0.0.0-20240819192222-f6681130fb7a h1:EIHC7k7hlwSG01swymqtQvIalQ9/Y0si7wDa66AgFrs= -gitlab.kit.edu/kit/fs-etit/www-ag/website-modules/available-minutes v0.0.0-20240819192222-f6681130fb7a/go.mod h1:ShFAmGcPPDkRZ2fl+ElsXrJib+xWi9n3IU9DZvX76kI= gitlab.kit.edu/kit/fs-etit/www-ag/website-modules/opening-hours v0.0.0-20240408223052-cd04dd4080b8 h1:ymSPyI3T86c97ojtiGaTqGfzVp3tIVPbOwk9/rf96Kw= gitlab.kit.edu/kit/fs-etit/www-ag/website-modules/opening-hours v0.0.0-20240408223052-cd04dd4080b8/go.mod h1:91aq9G7Xr1yrVXKkDp77klbPbhzbAxOB2+SW5WdcI1g= gitlab.kit.edu/kit/fs-etit/www-ag/website-modules/opening-hours v0.0.0-20240415225540-7f762b74fb00 h1:TYC3rJeC0SsdFOLeLVgq6Olp9POc1Zl1tP/JsAshGgc= gitlab.kit.edu/kit/fs-etit/www-ag/website-modules/opening-hours v0.0.0-20240415225540-7f762b74fb00/go.mod h1:91aq9G7Xr1yrVXKkDp77klbPbhzbAxOB2+SW5WdcI1g= -gitlab.kit.edu/kit/fs-etit/www-ag/website-modules/opening-hours v0.0.0-20240819193648-2ce85b9be0b5 h1:jYLsbWMJsFdZzyNkKi9rTmxCOhij4eQOJWQqU+V6DiA= -gitlab.kit.edu/kit/fs-etit/www-ag/website-modules/opening-hours v0.0.0-20240819193648-2ce85b9be0b5/go.mod h1:91aq9G7Xr1yrVXKkDp77klbPbhzbAxOB2+SW5WdcI1g= -gitlab.kit.edu/kit/fs-etit/www-ag/website-modules/opening-hours v0.0.0-20240819200131-cd1ac6026bde h1:SQ8t82G3+FVk3sTcWXuHXkDDc6csQsyYEgg0D21bTNs= -gitlab.kit.edu/kit/fs-etit/www-ag/website-modules/opening-hours v0.0.0-20240819200131-cd1ac6026bde/go.mod h1:91aq9G7Xr1yrVXKkDp77klbPbhzbAxOB2+SW5WdcI1g= -gitlab.kit.edu/kit/fs-etit/www-ag/website-modules/opening-hours v0.0.0-20240819203457-88723a4b72f6 h1:RCmr+Vemw0Kem3w3aMvuTvdEWyREpn1zArwUKvUH64c= -gitlab.kit.edu/kit/fs-etit/www-ag/website-modules/opening-hours v0.0.0-20240819203457-88723a4b72f6/go.mod h1:91aq9G7Xr1yrVXKkDp77klbPbhzbAxOB2+SW5WdcI1g= gitlab.kit.edu/kit/fs-etit/www-ag/website-modules/timetables v0.0.0-20240406175039-3f14cc7445c4 h1:4exjg0b/AiaTWQxoPnOpL0afXfn0iuJ9pUGo2D6nb7E= gitlab.kit.edu/kit/fs-etit/www-ag/website-modules/timetables v0.0.0-20240406175039-3f14cc7445c4/go.mod h1:4n2+Sz/Crij6uBtjr7gk7XPn8BXqUq4YAz707yYTQgE= gitlab.kit.edu/kit/fs-etit/www-ag/website-modules/timetables v0.0.0-20240415191818-b9e45b26479a h1:VCexmsTrxDgg2JWw0Bqw8YqsVRYgN/tQoP7+WvQf2aI= diff --git a/themes/fsetit/assets/js/dark-mode-switch-body.js b/themes/fsetit/assets/js/dark-mode-switch-body.js deleted file mode 100644 index ddc663c..0000000 --- a/themes/fsetit/assets/js/dark-mode-switch-body.js +++ /dev/null @@ -1,5 +0,0 @@ -if(localStorage.getItem("darkSwitch") === "dark" || (localStorage.getItem("darkSwitch") === null && window.matchMedia('(prefers-color-scheme: dark)').matches)) { - document.body.setAttribute("data-bs-theme", "dark"); -} else { - document.body.removeAttribute("data-bs-theme"); -} \ No newline at end of file diff --git a/themes/fsetit/assets/js/pagefind-loader.js b/themes/fsetit/assets/js/pagefind-loader.js deleted file mode 100644 index f9acdb0..0000000 --- a/themes/fsetit/assets/js/pagefind-loader.js +++ /dev/null @@ -1,9 +0,0 @@ -window.addEventListener('DOMContentLoaded', (event) => { - new PagefindUI({ - element: "#search", - translations: { - placeholder: "{{ .Site.Params.SearchPlaceholder }}", - zero_results: "{{ .Site.Params.SearchNoResults }}" - } - }) -}); \ No newline at end of file diff --git a/themes/fsetit/assets/scss/accessibility.scss b/themes/fsetit/assets/scss/accessibility.scss deleted file mode 100644 index f95104b..0000000 --- a/themes/fsetit/assets/scss/accessibility.scss +++ /dev/null @@ -1,11 +0,0 @@ -.visually-hidden { - border: 0; - padding: 0; - margin: 0; - position: absolute !important; - overflow: hidden; - clip: rect(1px 1px 1px 1px); /* IE6, IE7 - a 0 height clip, off to the bottom right of the visible 1px box */ - clip: rect(1px, 1px, 1px, 1px); /*maybe deprecated but we need to support legacy browsers */ - clip-path: inset(50%); /*modern browsers, clip-path works inwards from each corner*/ - white-space: nowrap; /* added line to stop words getting smushed together (as they go onto seperate lines and some screen readers do not understand line feeds as a space */ -} \ No newline at end of file diff --git a/themes/fsetit/assets/scss/bs.scss b/themes/fsetit/assets/scss/bs.scss index 59265b2..6fb3493 100644 --- a/themes/fsetit/assets/scss/bs.scss +++ b/themes/fsetit/assets/scss/bs.scss @@ -26,20 +26,4 @@ body[data-bs-theme="dark"] { #darkSwitch { cursor: pointer; -} - -.float-left { - float: left; -} - -.float-right { - float: right; -} - -.clearfix { - clear: both; -} - -.mh-fill { - min-height: 100vh; } \ No newline at end of file diff --git a/themes/fsetit/assets/scss/index.scss b/themes/fsetit/assets/scss/index.scss deleted file mode 100644 index cae7871..0000000 --- a/themes/fsetit/assets/scss/index.scss +++ /dev/null @@ -1,36 +0,0 @@ -{{ $background_img := resources.Get .Page.Params.Header }} - -body { - display: flex; - flex-direction: column; - min-height: 100vh; -} - -#right-with-bg { - text-align: center; - width: 100vw; - background-image: url("{{ $background_img.RelPermalink }}"); - background-size: cover; - background-position: center; - background-attachment: scroll; -} - -#index-container { - flex: 1; -} - -#main-title { - color: white; text-shadow: 0px 0px 3px black; -} - -@media (min-width: 992px) { - #right-with-bg { - text-align: left; - width: auto; - background-attachment: fixed; - } - - #right-with-bg > h1 { - width: 50%; - } -} \ No newline at end of file diff --git a/themes/fsetit/assets/scss/list/header_image.scss b/themes/fsetit/assets/scss/list/header_image.scss deleted file mode 100644 index 760944a..0000000 --- a/themes/fsetit/assets/scss/list/header_image.scss +++ /dev/null @@ -1,24 +0,0 @@ -{{ if isset .Params "header" }} -{{ $header_img := resources.Get .Params.Header }} -.header-image { - width: 100%; - background-image: url('{{ $header_img.RelPermalink }}'); - background-size: cover; - background-attachment: scroll; - background-position: center; - height: 30vh; - margin-bottom: 2rem; -} - -@media (min-width: 800px) { - .header-image { - background-attachment: fixed; - } -} -{{ end }} - -.page-image { - aspect-ratio: 1/1; - object-fit: contain; - width: 100%; -} \ No newline at end of file diff --git a/themes/fsetit/assets/scss/single/header_image.scss b/themes/fsetit/assets/scss/single/header_image.scss deleted file mode 100644 index 3ef9610..0000000 --- a/themes/fsetit/assets/scss/single/header_image.scss +++ /dev/null @@ -1,21 +0,0 @@ -{{ with .Params.Header }} -{{ $header_img := resources.Get . }} -.header-image { - width: 100%; - background-image: url('{{ $header_img.RelPermalink }}'); - background-size: cover; - background-attachment: scroll; - background-position: center 33%; - {{ with $.Params.HeaderHeight }} - height: {{ . }}; - {{ else }} - height: 30vh; - {{ end }} -} - -@media (min-width: 800px) { - .header-image { - background-attachment: fixed; - } -} -{{ end }} diff --git a/themes/fsetit/layouts/_default/baseof.html b/themes/fsetit/layouts/_default/baseof.html index 695da4a..0ad795b 100644 --- a/themes/fsetit/layouts/_default/baseof.html +++ b/themes/fsetit/layouts/_default/baseof.html @@ -6,16 +6,13 @@ {{- block "stylesheet" . }}{{- end}} </head> <body> - {{/* Load dark mode body JS. */}} - {{ $dmb_js := resources.Get "js/dark-mode-switch-body.js" | resources.Minify }} - {{ $params := dict }} - {{ $sourceMap := cond hugo.IsProduction "" "inline" }} - {{ $opts := dict "sourceMap" $sourceMap "minify" hugo.IsProduction "target" "es2018" "params" $params }} - {{ $dmb_js = $dmb_js | js.Build $opts }} - {{ if hugo.IsProduction }} - {{ $dmb_js = $dmb_js | fingerprint }} - {{ end }} - <script src="{{ $dmb_js.RelPermalink }}" {{ if hugo.IsProduction }}integrity="{{ $dmb_js.Data.Integrity }}"{{ end }} defer></script> + <script type="text/javascript"> + if(localStorage.getItem("darkSwitch") === "dark" || (localStorage.getItem("darkSwitch") === null && window.matchMedia('(prefers-color-scheme: dark)').matches)) { + document.body.setAttribute("data-bs-theme", "dark"); + } else { + document.body.removeAttribute("data-bs-theme"); + } + </script> <nav class="navbar navbar-expand-xl shadow"> <div class="container"> diff --git a/themes/fsetit/layouts/_default/list.html b/themes/fsetit/layouts/_default/list.html index 9e50af7..4138278 100644 --- a/themes/fsetit/layouts/_default/list.html +++ b/themes/fsetit/layouts/_default/list.html @@ -1,22 +1,37 @@ {{ define "stylesheet" }} -{{/* Load more SCSS. */}} -{{ $options := dict "enableSourceMap" true }} -{{ if hugo.IsProduction}} -{{ $options := dict "enableSourceMap" false "outputStyle" "compressed" }} -{{ end }} -{{ $header_styles := resources.Get "scss/list/header_image.scss" | resources.ExecuteAsTemplate "list/header_image.scss" . | resources.ToCSS $options | resources.Minify }} -{{ if hugo.IsProduction }} -{{ $header_styles = $header_styles | fingerprint }} -{{ end }} -<link href="{{ $header_styles.RelPermalink }}" rel="stylesheet" /> +<style> +{{ if isset .Params "header" }} +{{ $header_img := resources.Get .Params.Header }} +.header-image { + width: 100%; + background-image: url('{{ $header_img.RelPermalink }}'); + background-size: cover; + background-attachment: scroll; + background-position: center; + height: 30vh; + margin-bottom: 2rem; +} + +@media (min-width: 800px) { + .header-image { + background-attachment: fixed; + } +} {{ end }} +.page-image { + aspect-ratio: 1/1; + object-fit: contain; + width: 100%; +} +</style> +{{ end }} {{ define "main" }} {{ if isset .Params "header" }} <div class="header-image"> </div> {{ end }} -<div class="container" class="mh-fill"> +<div class="container" style="min-height: 100vh;"> <div class="row pt-3"> <div class="col-4"> <h1>{{ .Title }}</h1> @@ -39,9 +54,9 @@ <div class="col"> <h3>{{ .Title }}</h3> <p>{{ .Summary }}</p> - <a class="float-left" href="{{ .RelPermalink }}">Weiterlesen ...</a> - <p class="float-right">{{ .Date | time.Format ":date_long" }}</p> - <span class="clearfix"> </span> + <a style="float: left;" href="{{ .RelPermalink }}">Weiterlesen ...</a> + <p style="float: right;">{{ .Date | time.Format ":date_long" }}</p> + <span style="clear: both;"> </span> </div> </div> {{ end }} diff --git a/themes/fsetit/layouts/_default/single.html b/themes/fsetit/layouts/_default/single.html index bc2c408..1c81b9f 100644 --- a/themes/fsetit/layouts/_default/single.html +++ b/themes/fsetit/layouts/_default/single.html @@ -1,21 +1,34 @@ {{ define "stylesheet" }} -{{/* Load more SCSS. */}} -{{ $options := dict "enableSourceMap" true }} -{{ if hugo.IsProduction}} -{{ $options := dict "enableSourceMap" false "outputStyle" "compressed" }} -{{ end }} -{{ $header_styles := resources.Get "scss/single/header_image.scss" | resources.ExecuteAsTemplate "single/header_image.scss" . | resources.ToCSS $options | resources.Minify }} -{{ if hugo.IsProduction }} -{{ $header_styles = $header_styles | fingerprint }} +<style> +{{ with .Params.Header }} +{{ $header_img := resources.Get . }} +.header-image { + width: 100%; + background-image: url('{{ $header_img.RelPermalink }}'); + background-size: cover; + background-attachment: scroll; + background-position: center 33%; + {{ with $.Params.HeaderHeight }} + height: {{ . }}; + {{ else }} + height: 30vh; + {{ end }} +} + +@media (min-width: 800px) { + .header-image { + background-attachment: fixed; + } +} {{ end }} -<link href="{{ $header_styles.RelPermalink }}" rel="stylesheet" /> +</style> {{ end }} {{ define "main" }} {{ with .Params.Header }} <div class="header-image"> </div> {{ end }} -<div class="container pb-5 mh-fill"> +<div class="container pb-5" style="min-height: 100vh;"> <div class="row pb-3 pt-5"> <div class="col"> <h1>{{ .Title }}</h1> diff --git a/themes/fsetit/layouts/index.html b/themes/fsetit/layouts/index.html index c478eef..fc87aff 100644 --- a/themes/fsetit/layouts/index.html +++ b/themes/fsetit/layouts/index.html @@ -1,42 +1,61 @@ {{ define "stylesheet" }} +{{ $background_img := resources.Get .Page.Params.Header }} +<style> + body { + display: flex; + flex-direction: column; + min-height: 100vh; + } -{{/* Load Bootstrap SCSS. */}} -{{ $options := dict "enableSourceMap" true }} -{{ if hugo.IsProduction}} -{{ $options := dict "enableSourceMap" false "outputStyle" "compressed" }} -{{ end }} -{{ $index_styles := resources.Get "scss/index.scss" | resources.ExecuteAsTemplate "index.scss" . | resources.ToCSS $options | resources.Minify }} -{{ if hugo.IsProduction }} -{{ $index_styles = $index_styles | fingerprint }} -{{ end }} -<link href="{{ $index_styles.RelPermalink }}" rel="stylesheet" /> + #right-with-bg { + text-align: center; + width: 100vw; + background-image: url("{{ $background_img.RelPermalink }}"); + background-size: cover; + background-position: center; + background-attachment: scroll; + } + @media (min-width: 992px) { + #right-with-bg { + text-align: left; + width: auto; + background-attachment: fixed; + } + + #right-with-bg > h1 { + width: 50%; + } + } + +</style> {{ end }} {{ define "main" }} <script src="/_pagefind/pagefind-ui.js" type="text/javascript"></script> -<div class="container-fluid g-0" id="index-container"> +<div class="container-fluid g-0" style="flex: 1;"> <div class="row g-0"> <div class="col-lg-4"> <div class="sticky-lg-top p-3"> - <link href="/_pagefind/pagefind-ui.css" rel="stylesheet"> - <script src="/_pagefind/pagefind-ui.js" type="text/javascript"></script> + <link href="/_pagefind/pagefind-ui.css" rel="stylesheet"> + <script src="/_pagefind/pagefind-ui.js" type="text/javascript"></script> - <div id="search" class="pt-m-5"></div> - {{/* Load pagefind loader JS. */}} - {{ $pfl_js := resources.Get "js/pagefind-loader.js" | resources.Minify }} - {{ $params := dict }} - {{ $sourceMap := cond hugo.IsProduction "" "inline" }} - {{ $opts := dict "sourceMap" $sourceMap "minify" hugo.IsProduction "target" "es2018" "params" $params }} - {{ $pfl_js = $pfl_js | js.Build $opts }} - {{ if hugo.IsProduction }} - {{ $pfl_js = $pfl_js | fingerprint }} - {{ end }} - <script src="{{ $pfl_js.RelPermalink }}" {{ if hugo.IsProduction }}integrity="{{ $pfl_js.Data.Integrity }}"{{ end }} async></script> + <div id="search" class="pt-m-5"></div> + <script> + window.addEventListener('DOMContentLoaded', (event) => { + new PagefindUI({ + element: "#search", + translations: { + placeholder: "{{ .Site.Params.SearchPlaceholder }}", + zero_results: "{{ .Site.Params.SearchNoResults }}" + } + }) + }); + </script> </div> </div> <div class="col-lg-8"> <div id="right-with-bg" class="p-5 d-flex justify-content-center justify-content-lg-start align-items-center align-items-lg-end"> - <h1 id="main-title">{{ .Site.Title }}</h1> + <h1 style="color: white; text-shadow: 0px 0px 3px black;">{{ .Site.Title }}</h1> </div> <div class="container-fluid p-5"> <main> diff --git a/themes/fsetit/layouts/news/single.html b/themes/fsetit/layouts/news/single.html index 2ba2c1f..d979a94 100644 --- a/themes/fsetit/layouts/news/single.html +++ b/themes/fsetit/layouts/news/single.html @@ -1,21 +1,34 @@ {{ define "stylesheet" }} -{{/* Load more SCSS. */}} -{{ $options := dict "enableSourceMap" true }} -{{ if hugo.IsProduction}} -{{ $options := dict "enableSourceMap" false "outputStyle" "compressed" }} -{{ end }} -{{ $header_styles := resources.Get "scss/single/header_image.scss" | resources.ExecuteAsTemplate "single/header_image.scss" . | resources.ToCSS $options | resources.Minify }} -{{ if hugo.IsProduction }} -{{ $header_styles = $header_styles | fingerprint }} +<style> +{{ with .Params.Header }} +{{ $header_img := resources.Get . }} +.header-image { + width: 100%; + background-image: url('{{ $header_img.RelPermalink }}'); + background-size: cover; + background-attachment: scroll; + background-position: center 33%; + {{ with $.Params.HeaderHeight }} + height: {{ . }}; + {{ else }} + height: 30vh; + {{ end }} +} + +@media (min-width: 800px) { + .header-image { + background-attachment: fixed; + } +} {{ end }} -<link href="{{ $header_styles.RelPermalink }}" rel="stylesheet" /> +</style> {{ end }} {{ define "main" }} {{ with .Params.Header }} <div class="header-image"> </div> {{ end }} -<div class="container pb-5 mh-fill"> +<div class="container pb-5" style="min-height: 100vh;"> <div class="row pb-3 pt-5"> <div class="col"> <h1>{{ .Title }}</h1> diff --git a/themes/fsetit/layouts/partials/head.html b/themes/fsetit/layouts/partials/head.html index 8bd24be..d8d87b0 100644 --- a/themes/fsetit/layouts/partials/head.html +++ b/themes/fsetit/layouts/partials/head.html @@ -3,8 +3,6 @@ <meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta name="description" content="{{ $.Site.Params.SEODescription }}" /> -<meta http-equiv="Content-Security-Policy" content="default-src 'self' 'nonce-{{ hugo.Version | base64Encode }}'; img-src 'self' data:; connect-src *; font-src data:; script-src 'unsafe-eval';" /> - <title> {{ .Page.Title }} | {{ $.Site.Title }} </title> @@ -18,15 +16,12 @@ {{ end }} {{ $bs_styles := resources.Get "scss/bs.scss" | resources.ToCSS $options | resources.Minify }} {{ $flag_styles := resources.Get "scss/flag-icons.custom.scss" | resources.ExecuteAsTemplate "flag-icons.custom.scss" . | resources.ToCSS $options | resources.Minify }} -{{ $accessibility_styles := resources.Get "scss/accessibility.scss" | resources.ToCSS $options | resources.Minify }} {{ if hugo.IsProduction }} {{ $bs_styles = $bs_styles | fingerprint }} {{ $flag_styles = $flag_styles | fingerprint }} -{{ $accessibility_styles = $accessibility_styles | fingerprint }} {{ end }} <link href="{{ $bs_styles.RelPermalink }}" rel="stylesheet" /> <link href="{{ $flag_styles.RelPermalink }}" rel="stylesheet" /> -<link href="{{ $accessibility_styles.RelPermalink }}" rel="stylesheet" /> {{/* Load DarkMode JS. */}} {{ $darkmode_js := resources.Get "js/dark-mode-switch.js" | resources.Minify }} @@ -37,4 +32,18 @@ {{ if hugo.IsProduction }} {{ $darkmode_js = $darkmode_js | fingerprint }} {{ end }} -<script src="{{ $darkmode_js.RelPermalink }}" {{ if hugo.IsProduction }}integrity="{{ $darkmode_js.Data.Integrity }}"{{ end }} defer></script> \ No newline at end of file +<script src="{{ $darkmode_js.RelPermalink }}" {{ if hugo.IsProduction }}integrity="{{ $darkmode_js.Data.Integrity }}"{{ end }} defer></script> + +<style> +.visually-hidden { + border: 0; + padding: 0; + margin: 0; + position: absolute !important; + overflow: hidden; + clip: rect(1px 1px 1px 1px); /* IE6, IE7 - a 0 height clip, off to the bottom right of the visible 1px box */ + clip: rect(1px, 1px, 1px, 1px); /*maybe deprecated but we need to support legacy browsers */ + clip-path: inset(50%); /*modern browsers, clip-path works inwards from each corner*/ + white-space: nowrap; /* added line to stop words getting smushed together (as they go onto seperate lines and some screen readers do not understand line feeds as a space */ +} +</style> diff --git a/themes/fsetit/layouts/partials/menu.html b/themes/fsetit/layouts/partials/menu.html index ef7fad6..ce425c5 100644 --- a/themes/fsetit/layouts/partials/menu.html +++ b/themes/fsetit/layouts/partials/menu.html @@ -17,7 +17,7 @@ {{- end }} {{- end -}} lang="{{ .Lang }}" hreflang="{{ .Lang }}" href="{{ .RelPermalink }}"> - <span class="float-left">{{ .Language.LanguageName }}</span><span class="float-right"><span class="fi fi-{{ .Language.Params.Flag }}"></span></span><span class="clearfix"> </span> + <span style="float: left;">{{ .Language.LanguageName }}</span><span style="float: right;"><span class="fi fi-{{ .Language.Params.Flag }}"></span></span><span style="clear: both;"> </span> </a> </li> {{ end }} -- GitLab