hugo-theme-relearn/layouts/partials/stylesheet.html

44 lines
No EOL
3.7 KiB
HTML

{{- $outputFormat := partial "output-format.hugo" . }}
{{- $assetBusting := partialCached "assetbusting.hugo" . }}
{{- /* https://github.com/filamentgroup/loadCSS/blob/master/README.md#how-to-use */}}
<link href="{{"css/fontawesome-all.min.css" | relURL}}{{ $assetBusting }}" rel="stylesheet" media="print" onload="this.media='all';this.onload=null;"><noscript><link href="{{"css/fontawesome-all.min.css" | relURL}}{{ $assetBusting }}" rel="stylesheet"></noscript>
<link href="{{"css/nucleus.css" | relURL}}{{ $assetBusting }}" rel="stylesheet">
<link href="{{"css/auto-complete.css" | relURL}}{{ $assetBusting }}" rel="stylesheet" media="print" onload="this.media='all';this.onload=null;"><noscript><link href="{{"css/auto-complete.css" | relURL}}{{ $assetBusting }}" rel="stylesheet"></noscript>
<link href="{{"css/perfect-scrollbar.min.css" | relURL}}{{ $assetBusting }}" rel="stylesheet">
<link href="{{"css/fonts.css" | relURL}}{{ $assetBusting }}" rel="stylesheet" media="print" onload="this.media='all';this.onload=null;"><noscript><link href="{{"css/fonts.css" | relURL}}{{ $assetBusting }}" rel="stylesheet"></noscript>
<link href="{{"css/theme.css" | relURL}}{{ $assetBusting }}" rel="stylesheet">
{{- $themevariants := partialCached "get-theme-variants.hugo" . }}
{{- with index $themevariants 0 }}
<link href="{{(printf "css/theme-%s.css" .identifier) | relURL}}{{ $assetBusting }}" rel="stylesheet" id="R-variant-style">
<link href="{{(printf "css/chroma-%s.css" .chroma) | safeHTML | relURL}}{{ $assetBusting }}" rel="stylesheet" id="R-variant-chroma-style">
{{- end }}
<link href="{{"css/variant.css" | relURL}}{{ $assetBusting }}" rel="stylesheet">
<link href="{{"css/print.css" | relURL}}{{ $assetBusting }}" rel="stylesheet" media="print">
{{- $f := printf "/static/css/format-%s.css" $outputFormat }}
{{- if or (partialCached "fileExists.hugo" $f $f) (resources.Get (printf "/css/format-%s.css" $outputFormat)) }}
<link href="{{(printf "css/format-%s.css" $outputFormat) | relURL}}{{ $assetBusting }}" rel="stylesheet">
{{- end }}
<script src="{{"js/variant.js" | relURL}}{{ $assetBusting }}"></script>
<script>
window.relearn = window.relearn || {};
window.relearn.relBasePath='{{ partial "relBasePath.hugo" . | safeJS }}';
window.relearn.relBaseUri='{{ partial "relBaseUri.hugo" . | safeJS }}';
window.relearn.absBaseUri='{{ replaceRE "/*$" "" .Site.BaseURL | safeJS }}';
window.relearn.disableAnchorCopy={{ printf "%t" (eq .Site.Params.disableAnchorCopy true) | safeJS }};
window.relearn.disableAnchorScrolling={{ printf "%t" (eq .Site.Params.disableAnchorScrolling true) | safeJS }};
{{ "// variant stuff" | safeJS }}
{{- $quotedthemevariants := slice }}
{{- range $themevariants }}
{{- $quotedthemevariants = $quotedthemevariants | append (printf "'%s'" .identifier) }}
{{- end }}
window.variants && variants.init( [ {{ delimit $quotedthemevariants ", " | safeJS }} ] );
{{ "// translations" | safeJS }}
{{ printf "window.T_Copy_to_clipboard = `%s`;" (T `Copy-to-clipboard`) | safeJS }}
{{ printf "window.T_Copied_to_clipboard = `%s`;" (T `Copied-to-clipboard`) | safeJS }}
{{ printf "window.T_Copy_link_to_clipboard = `%s`;" (T `Copy-link-to-clipboard`) | safeJS }}
{{ printf "window.T_Link_copied_to_clipboard = `%s`;" (T `Link-copied-to-clipboard`) | safeJS }}
{{ printf "window.T_Reset_view = `%s`;" (T `Reset-view`) | safeJS }}
{{ printf "window.T_View_reset = `%s`;" (T `View-reset`) | safeJS }}
{{ printf "window.T_No_results_found = `%s`;" (T "No-results-found") | safeJS }}
{{ printf "window.T_N_results_found = `%s`;" (T "N-results-found") | safeJS }}
</script>