Skip to content

Commit

Permalink
directly inject css and use relative paths
Browse files Browse the repository at this point in the history
  • Loading branch information
NotLe0n committed Dec 4, 2024
1 parent 7289fc4 commit dad4822
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 8 deletions.
6 changes: 3 additions & 3 deletions assets/css/style.css
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
:root {
--sidebar-size: 280px;
--content-size: calc(100% - var(--sidebar-size));
--theme-toggle-img: url(/Bedienungsanleitung/svg/theme-light-dark.min.svg);
--title-img: url(/Bedienungsanleitung/svg/title.min.svg);
--line-img: url(/Bedienungsanleitung/svg/line.min.svg);
--theme-toggle-img: url(svg/theme-light-dark.min.svg);
--title-img: url(svg/title.min.svg);
--line-img: url(svg/line.min.svg);
}

:root:has(#dark-mode-check:checked) {
Expand Down
11 changes: 6 additions & 5 deletions layouts/partials/head.html
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,16 @@
{{- range resources.Match "svg/*" -}}
{{ (. | minify).Publish }}
{{ end }}
<link rel="preload" href="/Bedienungsanleitung/svg/line.min.svg" as="image" type="image/svg+xml">
<link rel="preload" href="/Bedienungsanleitung/svg/theme-light-dark.min.svg" as="image" type="image/svg+xml" fetchpriority="high" media="screen">
<link rel="preload" href="/Bedienungsanleitung/svg/title.min.svg" as="image" type="image/svg+xml" crossorigin fetchpriority="high">
<link rel="preload" href="svg/line.min.svg" as="image" type="image/svg+xml">
<link rel="preload" href="svg/theme-light-dark.min.svg" as="image" type="image/svg+xml" fetchpriority="high" media="screen">
<link rel="preload" href="svg/title.min.svg" as="image" type="image/svg+xml" crossorigin fetchpriority="high">

{{- $mdStyle := resources.Get "css/md-style.css" | minify | fingerprint }}
<link rel="preload" as="style" href="{{ $mdStyle.RelPermalink }}" integrity="{{ $mdStyle.Data.Integrity }}">

{{- $style := resources.Get "css/style.css" | minify | fingerprint }}
<link rel="stylesheet" href="{{ $style.RelPermalink }}" integrity="{{ $style.Data.Integrity }}">
<!-- Directly inject css to prevent blocking network request, prinf because vscode is stupid -->
{{- $style := resources.Get "css/style.css" | minify }}
{{ (printf "<%s>%s</style>" "style" ($style.Content | safeCSS)) | safeHTML }}

<script defer>
class TODOElement extends HTMLElement {
Expand Down

0 comments on commit dad4822

Please sign in to comment.