mirror of
https://github.com/McShelby/hugo-theme-relearn.git
synced 2025-01-18 10:50:24 +00:00
theme: remove output format from topbar, dependency loader and base/header #891
This commit is contained in:
parent
4eec133b35
commit
4d706da3fc
9 changed files with 25 additions and 44 deletions
|
@ -1,6 +1,5 @@
|
|||
<!DOCTYPE html>
|
||||
{{- partialCached "page-meta.hugo" . .RelPermalink }}
|
||||
{{- $outputFormat := partial "output-format.hugo" . }}
|
||||
<html lang="{{ .Page.Language.LanguageCode }}" dir="{{ .Page.Language.LanguageDirection | default (T "Reading-direction") | default "ltr" }}" itemscope itemtype="http://schema.org/Article">
|
||||
<head>
|
||||
{{- partial "meta.html" . }}
|
||||
|
@ -8,7 +7,7 @@
|
|||
<title>{{ $title }}</title>
|
||||
<base href="{{ .Site.BaseURL }}">
|
||||
{{- partialCached "favicon.html" . }}
|
||||
{{- partial "stylesheet.html" (dict "page" . "outputFormat" $outputFormat) }}
|
||||
{{- partial "stylesheet.html" . }}
|
||||
{{- partial "custom-header.html" . }}
|
||||
</head>
|
||||
<body class="mobile-support html notfound" data-url="{{ partial "relLangPrettyUglyURL.hugo" (dict "to" .) }}">
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
{{- $page := .page }}
|
||||
{{- $location := .location }}
|
||||
{{- $outputFormat := .outputFormat | default (partial "output-format.hugo" $page) }}
|
||||
{{- range $k, $v := $page.Site.Params.relearn.dependencies }}
|
||||
{{- $has := printf "has%s" $v.name }}
|
||||
{{- $hasnested := printf "relearnHasNested%s" $v.name }}
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
{{- $assetBusting := partialCached "assetbusting.hugo" . }}
|
||||
<script src="{{"js/clipboard.min.js" | relURL}}{{ $assetBusting }}" defer></script>
|
||||
<script src="{{"js/perfect-scrollbar.min.js" | relURL}}{{ $assetBusting }}" defer></script>
|
||||
{{- partial "dependencies.html" (dict "page" . "location" "footer" "outputFormat" $outputFormat) }}
|
||||
{{- partial "dependencies.html" (dict "page" . "location" "footer") }}
|
||||
<script src="{{"js/theme.js" | relURL}}{{ $assetBusting }}" defer></script>
|
||||
{{- partial "custom-footer.html" . }}
|
||||
</body>
|
||||
|
|
|
@ -39,8 +39,8 @@
|
|||
{{- end }}
|
||||
|
||||
{{- partialCached "favicon.html" . }}
|
||||
{{- partial "stylesheet.html" (dict "page" . "outputFormat" $outputFormat) }}
|
||||
{{- partial "dependencies.html" (dict "page" . "location" "header" "outputFormat" $outputFormat) }}
|
||||
{{- partial "stylesheet.html" . }}
|
||||
{{- partial "dependencies.html" (dict "page" . "location" "header") }}
|
||||
{{- partial "custom-header.html" . }}
|
||||
</head>
|
||||
<body class="mobile-support {{ $outputFormat }}{{- if .Site.Params.disableInlineCopyToClipBoard }} disableInlineCopyToClipboard{{ end }}{{- if .Site.Params.disableHoverBlockCopyToClipBoard }} disableHoverBlockCopyToClipBoard{{ end }}" data-url="{{ partial "relLangPrettyUglyURL.hugo" (dict "to" .) }}">
|
||||
|
|
|
@ -1,10 +1,4 @@
|
|||
{{- $page := .page }}
|
||||
{{- $outputFormat := .outputFormat }}
|
||||
{{- if not $page }}
|
||||
{{- $page = . }}
|
||||
{{- $outputFormat = partial "output-format.hugo" $page }}
|
||||
{{- end }}
|
||||
{{- with $page }}
|
||||
{{- $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>
|
||||
|
@ -27,8 +21,8 @@
|
|||
<script src="{{"js/variant.js" | relURL}}{{ $assetBusting }}"></script>
|
||||
<script>
|
||||
window.relearn = window.relearn || {};
|
||||
window.relearn.relBasePath='{{ partial "relBasePath.hugo" $page | safeJS }}';
|
||||
window.relearn.relBaseUri='{{ partial "relBaseUri.hugo" $page | safeJS }}';
|
||||
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 }};
|
||||
|
@ -47,5 +41,4 @@
|
|||
{{ 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>
|
||||
{{- end }}
|
||||
</script>
|
|
@ -2,9 +2,7 @@
|
|||
{{- $onwidthm := cond (isset . "onwidthm") .onwidthm "show" }}
|
||||
{{- $onwidthl := cond (isset . "onwidthl") .onwidthl "show" }}
|
||||
{{- with .page }}
|
||||
{{- $format := partial "get-format.hugo" . }}
|
||||
{{- $outputFormat := partial "output-format.hugo" (dict "page" . "format" $format) }}
|
||||
{{- if and (eq $outputFormat "html") .File }}
|
||||
{{- if .File }}
|
||||
{{- $filePath := printf "%s%s" (strings.TrimLeft "/" (replace .File.Dir "\\" "/")) .File.LogicalName }}
|
||||
{{- $href := "" }}
|
||||
{{- if .Site.Params.editURL }}
|
||||
|
|
|
@ -2,10 +2,8 @@
|
|||
{{- $onwidthm := cond (isset . "onwidthm") .onwidthm "show" }}
|
||||
{{- $onwidthl := cond (isset . "onwidthl") .onwidthl "show" }}
|
||||
{{- with .page }}
|
||||
{{- $format := partial "get-format.hugo" . }}
|
||||
{{- $outputFormat := partial "output-format.hugo" (dict "page" . "format" $format) }}
|
||||
{{- $printFormat := .OutputFormats.Get "print" }}
|
||||
{{- if and (eq $outputFormat "html") $printFormat }}
|
||||
{{- if $printFormat }}
|
||||
{{- partial "topbar/func/button.html" (dict
|
||||
"page" .
|
||||
"class" "topbar-button-print"
|
||||
|
|
|
@ -3,11 +3,9 @@
|
|||
{{- $onwidthm := cond (isset . "onwidthm") .onwidthm "show" }}
|
||||
{{- $onwidthl := cond (isset . "onwidthl") .onwidthl "show" }}
|
||||
{{- with .page }}
|
||||
{{- $format := partial "get-format.hugo" . }}
|
||||
{{- $outputFormat := partial "output-format.hugo" (dict "page" . "format" $format) }}
|
||||
{{- $defaultDisableToc := .Site.Params.disableToc | default false }}
|
||||
{{- $currentDisableToc := .Params.disableToc | default $defaultDisableToc }}
|
||||
{{- if and (eq $outputFormat "html") (not $currentDisableToc) }}
|
||||
{{- if not $currentDisableToc }}
|
||||
{{- $content := partial "toc-class.html" . }}
|
||||
{{- $hascontent := not (eq 0 (int (len (trim ($content | plainify) "\n\r\t ")))) }}
|
||||
{{- if not $hascontent }}
|
||||
|
|
|
@ -7,22 +7,18 @@
|
|||
{{- $onwidthm := cond (isset . "onwidthm") .onwidthm "show" }}
|
||||
{{- $onwidthl := cond (isset . "onwidthl") .onwidthl "show" }}
|
||||
{{- with .page }}
|
||||
{{- $format := partial "get-format.hugo" . }}
|
||||
{{- $outputFormat := partial "output-format.hugo" (dict "page" . "format" $format) }}
|
||||
{{- if and (eq $outputFormat "html") }}
|
||||
{{- $content := printf "\n <div class=\"topbar-area topbar-area-%s\" data-area=\"%s\">%s\n </div>" $area $area (partial (printf "topbar/area/%s.html" $area) .) | safeHTML }}
|
||||
{{- partial "topbar/func/button.html" (dict
|
||||
"page" .
|
||||
"class" (printf "topbar-button-%s" $area)
|
||||
"href" "javascript:toggleTopbarFlyout(this)"
|
||||
"icon" $icon
|
||||
"onempty" $onempty
|
||||
"onwidths" $onwidths
|
||||
"onwidthm" $onwidthm
|
||||
"onwidthl" $onwidthl
|
||||
"title" $title
|
||||
"hint" $hint
|
||||
"content" $content
|
||||
)}}
|
||||
{{- end }}
|
||||
{{- $content := printf "\n <div class=\"topbar-area topbar-area-%s\" data-area=\"%s\">%s\n </div>" $area $area (partial (printf "topbar/area/%s.html" $area) .) | safeHTML }}
|
||||
{{- partial "topbar/func/button.html" (dict
|
||||
"page" .
|
||||
"class" (printf "topbar-button-%s" $area)
|
||||
"href" "javascript:toggleTopbarFlyout(this)"
|
||||
"icon" $icon
|
||||
"onempty" $onempty
|
||||
"onwidths" $onwidths
|
||||
"onwidthm" $onwidthm
|
||||
"onwidthl" $onwidthl
|
||||
"title" $title
|
||||
"hint" $hint
|
||||
"content" $content
|
||||
)}}
|
||||
{{- end }}
|
Loading…
Reference in a new issue