2022-11-13 09:55:17 +00:00
{{- $page := .page }}
{{- $outputFormat := .outputFormat }}
{{- if not $page }}
{{- $page = . }}
{{- $outputFormat = partial "output-format.hugo" $page }}
{{- end }}
{{- with $page }}
2022-02-06 12:51:54 +00:00
{{- $assetBusting := not .Site.Params.disableAssetsBusting }}
2022-07-15 12:07:48 +00:00
{{ "<!-- https://github.com/filamentgroup/loadCSS/blob/master/README.md#how - to - use --> " | safeHTML }}
2022-07-17 23:17:25 +00:00
< link href = "{{" css / fontawesome-all . min . css " | relURL } } { { if $ assetBusting } } ? { { now . Unix } } { { end } } " rel = "stylesheet" media = "print" onload = "this.media='all';this.onload=null;" > < noscript > < link href = "{{" css / fontawesome-all . min . css " | relURL } } { { if $ assetBusting } } ? { { now . Unix } } { { end } } " rel = "stylesheet" > < / noscript >
2023-02-09 23:34:47 +00:00
< link href = "{{" css / nucleus . css " | relURL } } { { if $ assetBusting } } ? { { now . Unix } } { { end } } " rel = "stylesheet" >
2022-07-17 23:17:25 +00:00
< link href = "{{" css / auto-complete . css " | relURL } } { { if $ assetBusting } } ? { { now . Unix } } { { end } } " rel = "stylesheet" media = "print" onload = "this.media='all';this.onload=null;" > < noscript > < link href = "{{" css / auto-complete . css " | relURL } } { { if $ assetBusting } } ? { { now . Unix } } { { end } } " rel = "stylesheet" > < / noscript >
2022-02-06 12:51:54 +00:00
< link href = "{{" css / perfect-scrollbar . min . css " | relURL } } { { if $ assetBusting } } ? { { now . Unix } } { { end } } " rel = "stylesheet" >
2022-07-17 23:17:25 +00:00
< link href = "{{" css / fonts . css " | relURL } } { { if $ assetBusting } } ? { { now . Unix } } { { end } } " rel = "stylesheet" media = "print" onload = "this.media='all';this.onload=null;" > < noscript > < link href = "{{" css / fonts . css " | relURL } } { { if $ assetBusting } } ? { { now . Unix } } { { end } } " rel = "stylesheet" > < / noscript >
2022-02-06 12:51:54 +00:00
< link href = "{{" css / theme . css " | relURL } } { { if $ assetBusting } } ? { { now . Unix } } { { end } } " rel = "stylesheet" >
2023-02-09 23:34:47 +00:00
{{- $autotemplate := resources.Get "css/theme-auto.css" }}
{{- $autocss := $autotemplate | resources.ExecuteAsTemplate "css/theme-auto.css" .Site.Home }}
{{- $c := "" }}<!-- cause Hugo to generate our theme - auto.css -->
{{- $c = "" }}<!-- link href="{{ $autocss.RelPermalink }}{{ if $assetBusting }}?{{ now.Unix }}{{ end }}" rel="stylesheet" -->
2023-02-04 21:33:27 +00:00
{{- $themevariants := slice | append (.Site.Params.themeVariant | default "auto" ) }}
2022-02-13 00:53:23 +00:00
{{- with index $themevariants 0 }}
2023-09-23 08:18:31 +00:00
< link href = "{{(printf " css / theme- % s . css " . ) | relURL } } { { if $ assetBusting } } ? { { now . Unix } } { { end } } " rel = "stylesheet" id = "R-variant-style" >
2022-02-06 12:51:54 +00:00
{{- end }}
2022-02-20 23:35:50 +00:00
< link href = "{{" css / variant . css " | relURL } } { { if $ assetBusting } } ? { { now . Unix } } { { end } } " rel = "stylesheet" >
2022-07-09 16:42:20 +00:00
< link href = "{{" css / print . css " | relURL } } { { if $ assetBusting } } ? { { now . Unix } } { { end } } " rel = "stylesheet" media = "print" >
2022-11-12 22:21:21 +00:00
{{- $f := printf "/static/css/format-%s.css" $outputFormat }}
2022-11-12 14:16:53 +00:00
{{- if partialCached "fileExists.hugo" $f $f }}
2022-11-12 22:21:21 +00:00
< link href = "{{(printf " css / format- % s . css " $ outputFormat ) | relURL } } { { if $ assetBusting } } ? { { now . Unix } } { { end } } " rel = "stylesheet" >
2022-07-09 16:42:20 +00:00
{{- end }}
2023-02-09 23:34:47 +00:00
< link href = "{{" css / ie . css " | relURL } } { { if $ assetBusting } } ? { { now . Unix } } { { end } } " rel = "stylesheet" >
2022-11-18 08:02:39 +00:00
< script src = "{{" js / url . js " | relURL } } { { if not . Site . Params . disableAssetsBusting } } ? { { now . Unix } } { { end } } " > < / script >
2022-02-20 22:58:16 +00:00
< script src = "{{" js / variant . js " | relURL } } { { if not . Site . Params . disableAssetsBusting } } ? { { now . Unix } } { { end } } " > < / script >
2022-02-13 01:11:27 +00:00
< script >
2022-03-07 16:22:20 +00:00
{{ "// hack to let hugo tell us how to get to the root when using relativeURLs, it needs to be called *url= for it to do its magic:" | safeJS }}
{{ "// https://github.com/gohugoio/hugo/blob/145b3fcce35fbac25c7033c91c1b7ae6d1179da8/transform/urlreplacers/absurlreplacer.go#L72" | safeJS }}
2022-11-01 23:14:19 +00:00
{{- with .Site.Home.OutputFormats.Get "JSON" }}
2023-10-27 22:36:30 +00:00
{{- warnf "%q: DEPRECATED usage of 'JSON' output format found, use 'SEARCH' instead; see https://mcshelby.github.io/hugo-theme-relearn/basics/configuration/#activate-search" $page.File.Filename }}
2022-11-01 23:14:19 +00:00
window.index_json_url={{ "index.json" | relLangURL }};
{{- end }}
{{- with .Site.Home.OutputFormats.Get "SEARCH" }}
window.index_js_url={{ "index.search.js" | relLangURL }};
{{- end }}
2022-03-07 16:22:20 +00:00
var root_url="/";
var baseUri=root_url.replace(/\/$/, '');
2023-11-16 22:53:06 +00:00
window.relearn = window.relearn || {};
window.relearn.baseUriFull='{{ trim .Site.BaseURL "/" | safeJS }}/';
{{ "// variant stuff" | safeJS }}
2022-02-20 22:58:16 +00:00
{{- $quotedthemevariants := slice }}
{{- range $themevariants }}
2022-03-07 17:25:33 +00:00
{{- $quotedthemevariants = $quotedthemevariants | append (printf "'%s'" .) }}
2022-02-20 22:58:16 +00:00
{{- end }}
2022-07-09 17:46:39 +00:00
window.variants & & variants.init( [ {{ delimit $quotedthemevariants ", " | safeJS }} ] );
2023-11-16 22:53:06 +00:00
{{ "// 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 }}
2022-02-13 01:11:27 +00:00
< / script >
2022-11-13 09:55:17 +00:00
{{- end }}