Skip to content
Snippets Groups Projects
Commit b5c43cdf authored by Dominik Rimpf's avatar Dominik Rimpf :chipmunk: Committed by Michel Brodatzki
Browse files

Revert CSP fixes. They need more work.

parent 274e6d84
No related branches found
No related tags found
1 merge request!144Revert CSP fixes. They need more work.
Pipeline #363664 passed with warnings
Showing
with 144 additions and 208 deletions
......@@ -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
)
......@@ -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=
......
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
window.addEventListener('DOMContentLoaded', (event) => {
new PagefindUI({
element: "#search",
translations: {
placeholder: "{{ .Site.Params.SearchPlaceholder }}",
zero_results: "{{ .Site.Params.SearchNoResults }}"
}
})
});
\ No newline at end of file
.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
......@@ -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
{{ $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
{{ 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
{{ 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 }}
......@@ -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">
......
{{ 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">&nbsp;</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">&nbsp;</span>
<a style="float: left;" href="{{ .RelPermalink }}">Weiterlesen ...</a>
<p style="float: right;">{{ .Date | time.Format ":date_long" }}</p>
<span style="clear: both;">&nbsp;</span>
</div>
</div>
{{ end }}
......
{{ 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">&nbsp;</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>
......
{{ 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>
......
{{ 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">&nbsp;</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>
......
......@@ -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>
......@@ -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">&nbsp;</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;">&nbsp;</span>
</a>
</li>
{{ end }}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment