mirror of
https://github.com/McShelby/hugo-theme-relearn.git
synced 2025-01-18 10:50:24 +00:00
0505b36141
implements the first part, working for configured variants; for that, loading of stylesheets was overhauled by now merging all configured variants into one big stylesheet for each output format and loading this instead of one stylesheet per configured variant; previously @media print styles were applied on top of @media screen styles; this is now strictly isolated, which doesn't require styles like neon to revert styles for print anymore; this change was also used to implement the minify parameter, to shrink those generated stylesheets, making them shrink to 66% of their unminified size for the exampleSite; the theme switcher functionality is now completely independend of variant.js; the switch is now handled by in-page javascript which avoids waiting for external scripts to load, so switching can happen as early as possible; switching of themes is now implemented by just setting a data attribute to the html element, were previously a complex mechanism of dynamically loading of variant CSS files was implemented; the call for variant.js was removed in this changeset, making the generator broken and useless; this will be fixed with the next patch;
83 lines
4.3 KiB
HTML
83 lines
4.3 KiB
HTML
<!DOCTYPE html>
|
|
{{- block "storeOutputFormat" . }}{{ end }}
|
|
{{- if .IsHome }}
|
|
{{- $hugoVersion := "0.126.0" }}
|
|
{{- if lt hugo.Version $hugoVersion }}
|
|
{{- errorf "The Relearn theme requires Hugo %s or later" $hugoVersion }}
|
|
{{- end }}
|
|
{{- end }}
|
|
{{- if .Site.Params.description }}
|
|
{{- warnf "UNSUPPORTED usage of 'params.description' config parameter found, move it to the front matter of your home page; see https://mcshelby.github.io/hugo-theme-relearn/introduction/releasenotes/6/#6-0-0" }}
|
|
{{- end }}
|
|
<html lang="{{ .Page.Language.LanguageCode }}" dir="{{ .Page.Language.LanguageDirection | default (T "Reading-direction") | default "ltr" }}" itemscope itemtype="http://schema.org/Article" data-r-output-format="{{ with .Store.Get "relearnOutputFormat" }}{{ . }}{{ else }}html{{ end }}">
|
|
<head>
|
|
{{- partial "meta.html" . }}
|
|
{{- $title := partial "title.gotmpl" (dict "page" . "fullyQualified" true "reverse" true) }}
|
|
<title>{{ $title }}</title>
|
|
|
|
{{- /* multilingual stuff */}}
|
|
{{- if .IsTranslated -}}
|
|
{{- range $index, $trans := .AllTranslations }}
|
|
{{- if eq $index 0 }}
|
|
<link href="{{ partial "permalink.gotmpl" (dict "to" . "abs" true) }}" rel="alternate" hreflang="x-default">
|
|
{{- end }}
|
|
<link href="{{ partial "permalink.gotmpl" (dict "to" . "abs" true) }}" rel="alternate" hreflang="{{ .Language.LanguageCode }}">
|
|
{{- end }}
|
|
{{- end }}
|
|
|
|
{{- /* output formats */}}
|
|
{{- $page := . }}
|
|
{{- $link := "<link href=\"%s\" rel=\"%s\" type=\"%s\" title=\"%s\">" }}
|
|
{{- range .AlternativeOutputFormats }}
|
|
{{- if eq .Rel "canonical" }}
|
|
{{ (printf $link (partial "permalink.gotmpl" (dict "to" . "abs" true)) .Rel .MediaType.Type ($title | htmlEscape)) | safeHTML }}
|
|
{{- else if not (partial "_relearn/pageIsSpecial.gotmpl" $page) }}
|
|
{{ (printf $link (partial "permalink.gotmpl" (dict "to" .)) .Rel .MediaType.Type ($title | htmlEscape)) | safeHTML }}
|
|
{{- end }}
|
|
{{- end }}
|
|
{{- partialCached "favicon.html" . }}
|
|
{{- partial "stylesheet.html" . }}
|
|
{{- partial "dependencies.gotmpl" (dict "page" . "location" "header") }}
|
|
{{- partial "custom-header.html" . }}
|
|
</head>
|
|
<body class="mobile-support {{ with .Store.Get "relearnOutputFormat" }}{{ . }}{{ else }}html{{ end }}{{- if .Site.Params.disableInlineCopyToClipBoard }} disableInlineCopyToClipboard{{ end }}{{- if .Site.Params.disableHoverBlockCopyToClipBoard }} disableHoverBlockCopyToClipBoard{{ end }}" data-url="{{ partial "permalink.gotmpl" (dict "to" .) }}">
|
|
<div id="R-body" class="default-animation">
|
|
<div id="R-body-overlay"></div>
|
|
<nav id="R-topbar">
|
|
<div class="topbar-wrapper">
|
|
<div class="topbar-sidebar-divider"></div>
|
|
<div class="topbar-area topbar-area-start" data-area="start">
|
|
{{- partial "topbar/area/start.html" . }}
|
|
</div>
|
|
{{- $showBreadcrumb := (and (not .Params.disableBreadcrumb) (not .Site.Params.disableBreadcrumb)) }}
|
|
{{- if $showBreadcrumb }}
|
|
<ol class="topbar-breadcrumbs breadcrumbs highlightable" itemscope itemtype="http://schema.org/BreadcrumbList">
|
|
{{- partial "breadcrumbs.html" (dict "page" .) }}
|
|
</ol>
|
|
{{- else }}
|
|
<span class="topbar-breadcrumbs highlightable">
|
|
{{ partial "title.gotmpl" (dict "page" . "linkTitle" true) }}
|
|
</span>
|
|
{{- end }}
|
|
<div class="topbar-area topbar-area-end" data-area="end">
|
|
{{- partial "topbar/area/end.html" . }}
|
|
</div>
|
|
</div>
|
|
</nav>
|
|
<div id="R-main-overlay"></div>
|
|
<main id="R-body-inner" class="highlightable{{ with or .Type "default" }} {{ . }}{{ end }}" tabindex="-1">
|
|
<div class="flex-block-wrapper">
|
|
{{- block "body" . }}{{ end }}
|
|
</div>
|
|
</main>
|
|
{{- partial "custom-comments.html" . }}
|
|
</div>
|
|
{{- block "menu" . }}{{ end }}
|
|
{{- $assetBusting := partialCached "assetbusting.gotmpl" . }}
|
|
<script src="{{"js/clipboard.min.js" | relURL}}{{ $assetBusting }}" defer></script>
|
|
<script src="{{"js/perfect-scrollbar.min.js" | relURL}}{{ $assetBusting }}" defer></script>
|
|
{{- partial "dependencies.gotmpl" (dict "page" . "location" "footer") }}
|
|
<script src="{{"js/theme.js" | relURL}}{{ $assetBusting }}" defer></script>
|
|
{{- partial "custom-footer.html" . }}
|
|
</body>
|
|
</html>
|