First batch of day one
This commit is contained in:
143
themes/hugo-theme-relearn/layouts/404.html
Normal file
143
themes/hugo-theme-relearn/layouts/404.html
Normal file
@@ -0,0 +1,143 @@
|
||||
<!DOCTYPE html>
|
||||
{{- partialCached "page-meta.hugo" . .RelPermalink }}
|
||||
{{- $outputFormat := partial "output-format.hugo" . }}
|
||||
<html lang="{{ .Page.Language.LanguageCode | default "en" }}" dir="{{ .Page.Language.LanguageDirection | default (T "Reading-direction") | default "ltr" }}">
|
||||
<head>
|
||||
{{- partial "meta.html" . }}
|
||||
{{- $title := .Title }}
|
||||
{{- if eq .Site.Data.titles .Title }}
|
||||
{{- $title = (index .Site.Data.titles .Title).title }}
|
||||
{{- end }}
|
||||
{{- if and $title .Site.Title (not (eq $title .Site.Title)) }}
|
||||
{{- $title = printf "%s %s %s" $title (default "::" .Site.Params.titleSeparator) .Site.Title }}
|
||||
{{- end }}
|
||||
<title>{{ $title }}</title>
|
||||
<base href="{{ .Site.BaseURL }}">
|
||||
{{- partialCached "favicon.html" . }}
|
||||
{{- partial "stylesheet.html" (dict "page" . "outputFormat" $outputFormat) }}
|
||||
<style>
|
||||
p {
|
||||
text-align: center
|
||||
}
|
||||
.notfound #R-body {
|
||||
margin-inline-start: 0;
|
||||
max-width: 100%;
|
||||
min-width: 100%;
|
||||
width: 100%;
|
||||
}
|
||||
.notfound h1 {
|
||||
color: var(--MAIN-TEXT-color);
|
||||
line-height: 1;
|
||||
font-size: 5rem;
|
||||
overflow: hidden;
|
||||
}
|
||||
.notfound h1 span {
|
||||
font-size: 6.5rem;
|
||||
font-weight: 500;
|
||||
}
|
||||
.notfound h1 i {
|
||||
font-size: 5rem;
|
||||
vertical-align: text-top;
|
||||
}
|
||||
.notfound h2 {
|
||||
color: var(--MAIN-TEXT-color);
|
||||
font-size: 2.5rem;
|
||||
font-weight: 500;
|
||||
padding: 0;
|
||||
text-align: center;
|
||||
}
|
||||
#shrug svg,
|
||||
#shrug svg * {
|
||||
color: #000000;
|
||||
color: var(--MAIN-TEXT-color);
|
||||
fill: #000000 !important;
|
||||
fill: var(--MAIN-TEXT-color) !important;
|
||||
}
|
||||
#shrug svg{
|
||||
transform: scaleX(-1);
|
||||
width: 15rem;
|
||||
}
|
||||
</style>
|
||||
{{- partial "custom-header.html" . }}
|
||||
</head>
|
||||
<body class="mobile-support html notfound" data-url="{{ partial "relLangPrettyUglyURL.hugo" (dict "to" .) }}">
|
||||
<div id="R-body" class="default-animation">
|
||||
<main id="R-body-inner" class="chapter" tabindex="-1">
|
||||
<div class="flex-block-wrapper">
|
||||
<article>
|
||||
<h1 id="404"><span>4</span>{{ partial "shortcodes/icon.html" (dict "page" . "icon" "far fa-frown" )}}<span>4</span></h1>
|
||||
<h2 id="{{ T "title-404" | plainify | anchorize }}">{{ T "title-404" }}</h2>
|
||||
<p></p>
|
||||
<p>{{ T "message-404" }}</p>
|
||||
<p></p>
|
||||
<p><a href="{{ partial "relLangPrettyUglyURL.hugo" (dict "to" .Site.Home) }}">{{ T "Go-to-homepage" }}</a></p>
|
||||
<p id="shrug">
|
||||
<svg xmlns="http://www.w3.org/2000/svg"
|
||||
viewBox="0 0 512.000000 512.000000"
|
||||
preserveAspectRatio="xMidYMid meet">
|
||||
|
||||
<g transform="translate(0.000000,512.000000) scale(0.100000,-0.100000)"
|
||||
style="fill:#000000;stroke:none;">
|
||||
<path d="M2359 4821 c-330 -72 -613 -312 -803 -681 -53 -102 -74 -133 -105
|
||||
-154 -46 -32 -103 -113 -121 -170 -7 -23 -11 -72 -8 -120 3 -65 10 -91 33
|
||||
-134 36 -66 91 -117 161 -149 30 -13 54 -30 54 -38 0 -33 56 -199 94 -281 54
|
||||
-115 110 -196 192 -283 35 -38 64 -71 64 -74 0 -3 -17 -11 -37 -18 -57 -18
|
||||
-170 -77 -238 -122 -75 -52 -213 -184 -270 -259 -51 -68 -46 -74 -75 101 -12
|
||||
68 -32 150 -45 182 -65 160 -179 253 -342 279 -125 20 -234 85 -376 224 -103
|
||||
101 -149 127 -233 134 -115 9 -217 -48 -272 -152 -38 -73 -38 -177 0 -259 68
|
||||
-146 246 -382 417 -554 l101 -102 96 -533 c52 -293 104 -556 113 -583 67 -191
|
||||
246 -315 455 -315 138 0 251 46 347 142 l49 49 0 -256 c0 -208 3 -263 15 -293
|
||||
20 -47 50 -79 97 -103 36 -18 71 -19 838 -19 780 0 802 1 840 20 44 22 82 68
|
||||
99 119 7 22 11 122 11 278 l0 244 49 -49 c96 -96 209 -142 347 -142 209 0 388
|
||||
124 455 315 9 27 61 290 113 583 l96 533 101 102 c171 172 349 408 417 554 38
|
||||
82 38 186 0 259 -55 104 -157 161 -272 152 -84 -7 -130 -33 -233 -134 -142
|
||||
-139 -251 -204 -376 -224 -163 -26 -277 -119 -342 -279 -13 -32 -33 -114 -45
|
||||
-182 -29 -175 -24 -169 -75 -101 -101 134 -259 264 -423 346 l-72 36 92 93
|
||||
c51 50 109 116 128 144 l35 52 57 1 c164 0 310 134 325 298 7 74 -10 147 -48
|
||||
207 -26 40 -30 60 -40 168 -24 283 -91 497 -213 682 -155 232 -387 382 -706
|
||||
456 -128 30 -405 35 -521 10z m426 -197 c120 -20 265 -71 362 -125 106 -60
|
||||
242 -196 302 -302 70 -125 126 -307 146 -479 9 -70 13 -69 -153 -32 -360 81
|
||||
-724 280 -888 486 -63 79 -100 105 -160 114 -61 9 -107 -10 -204 -83 -144
|
||||
-109 -279 -163 -403 -163 l-59 0 37 68 c50 92 164 240 233 303 118 108 259
|
||||
183 402 214 88 18 275 18 385 -1z m-295 -674 c108 -107 232 -191 421 -284 207
|
||||
-103 534 -206 656 -206 60 0 123 -64 123 -125 0 -43 -27 -93 -62 -115 -26 -17
|
||||
-43 -20 -83 -15 -134 16 -135 15 -203 -90 -69 -106 -230 -260 -332 -318 -255
|
||||
-143 -537 -153 -781 -26 -242 126 -419 382 -469 679 -15 90 -43 124 -111 135
|
||||
-89 15 -129 56 -129 132 0 49 18 82 58 109 30 20 40 22 154 17 103 -4 138 -2
|
||||
210 16 136 32 283 108 388 199 l35 31 19 -27 c10 -15 58 -65 106 -112z m-2091
|
||||
-974 c186 -176 301 -240 493 -276 119 -23 182 -109 213 -290 8 -52 42 -230 75
|
||||
-395 78 -394 103 -549 95 -588 -29 -136 -171 -202 -287 -134 -25 15 -55 42
|
||||
-67 60 -21 34 -54 197 -131 642 -23 132 -46 256 -52 275 -7 23 -43 65 -109
|
||||
128 -220 210 -444 522 -425 595 9 37 44 67 78 67 22 0 49 -19 117 -84z m4489
|
||||
54 c38 -36 39 -67 2 -138 -75 -145 -239 -351 -399 -504 -66 -63 -102 -105
|
||||
-109 -128 -6 -19 -29 -143 -52 -275 -77 -445 -110 -608 -131 -642 -12 -18 -42
|
||||
-45 -67 -60 -116 -68 -258 -2 -287 134 -8 39 17 194 95 588 33 165 67 343 75
|
||||
395 31 181 94 267 213 290 192 36 307 100 493 276 96 91 125 103 167 64z
|
||||
m-2850 -536 c56 -270 324 -461 595 -424 205 28 393 204 439 411 6 30 14 58 18
|
||||
62 8 10 128 -34 190 -70 166 -96 311 -245 387 -398 57 -113 57 -117 28 -287
|
||||
-56 -322 -58 -411 -13 -510 74 -161 263 -254 420 -205 45 14 47 14 38 -2 -17
|
||||
-33 -87 -88 -133 -106 -68 -26 -179 -17 -240 18 -25 15 -92 78 -150 142 l-105
|
||||
114 -4 97 c-3 91 -5 97 -31 120 -38 33 -96 33 -134 0 l-28 -24 -3 -476 -3
|
||||
-476 -749 0 -749 0 -3 481 -3 481 -28 24 c-38 33 -96 33 -134 0 -26 -23 -28
|
||||
-29 -31 -120 l-4 -97 -105 -114 c-58 -64 -125 -127 -150 -142 -61 -35 -172
|
||||
-44 -240 -18 -46 18 -116 73 -133 106 -9 16 -7 16 38 2 157 -49 346 44 420
|
||||
205 45 99 43 188 -13 510 -29 170 -29 174 28 287 97 197 295 373 507 451 60
|
||||
22 65 19 78 -42z m421 -4 c96 -15 253 -8 346 14 33 8 62 13 64 10 11 -10 -35
|
||||
-99 -74 -141 -175 -195 -480 -111 -559 154 l-7 21 73 -23 c40 -13 111 -29 157
|
||||
-35z"/>
|
||||
<path d="M2236 3664 c-20 -20 -26 -37 -26 -68 0 -52 20 -81 65 -96 70 -23 141
|
||||
42 127 116 -13 71 -113 100 -166 48z"/>
|
||||
<path d="M2865 3548 c-94 -51 -61 -188 45 -188 103 0 141 138 50 185 -34 18
|
||||
-67 19 -95 3z"/>
|
||||
<path d="M2308 3093 c-29 -18 -48 -52 -48 -86 0 -33 36 -86 62 -92 134 -31
|
||||
266 -55 303 -55 63 0 95 32 95 92 0 82 -11 88 -230 133 -144 29 -147 29 -182
|
||||
8z"/>
|
||||
</g>
|
||||
</svg>
|
||||
</p>
|
||||
</article>
|
||||
</div>
|
||||
</main>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,6 @@
|
||||
{{- partial "shortcodes/math.html" (dict
|
||||
"page" .Page
|
||||
"attributes" .Attributes
|
||||
"content" .Inner
|
||||
"align" (index .Attributes "align")
|
||||
) }}
|
||||
@@ -0,0 +1,6 @@
|
||||
{{- partial "shortcodes/mermaid.html" (dict
|
||||
"page" .Page
|
||||
"attributes" .Attributes
|
||||
"content" .Inner
|
||||
"align" (index .Attributes "align")
|
||||
) }}
|
||||
@@ -0,0 +1,7 @@
|
||||
{{- partial "shortcodes/highlight.html" (dict
|
||||
"page" .Page
|
||||
"attributes" .Attributes
|
||||
"content" .Inner
|
||||
"options" .Options
|
||||
"type" .Type
|
||||
) }}
|
||||
@@ -0,0 +1,9 @@
|
||||
{{- $id := "" }}
|
||||
{{- partial "shortcodes/image.html" (dict
|
||||
"page" .Page
|
||||
"url" .Destination
|
||||
"title" .Title
|
||||
"alt" .Text
|
||||
"id" $id
|
||||
"attributes" .Attributes
|
||||
) }}
|
||||
@@ -0,0 +1,6 @@
|
||||
{{- partial "shortcodes/link.html" (dict
|
||||
"page" .Page
|
||||
"url" .Destination
|
||||
"title" .Title
|
||||
"content" .Text
|
||||
) }}
|
||||
1
themes/hugo-theme-relearn/layouts/_default/index.html
Normal file
1
themes/hugo-theme-relearn/layouts/_default/index.html
Normal file
@@ -0,0 +1 @@
|
||||
{{- partial "_main.hugo" . }}
|
||||
23
themes/hugo-theme-relearn/layouts/_default/index.json
Normal file
23
themes/hugo-theme-relearn/layouts/_default/index.json
Normal file
@@ -0,0 +1,23 @@
|
||||
{{- partialCached "page-meta.hugo" . .RelPermalink }}
|
||||
{{- $pages := slice }}
|
||||
{{- range .Site.Pages }}
|
||||
{{- if and .Title .RelPermalink (or (ne (.Scratch.Get "relearnIsHiddenStem") true) (ne .Site.Params.disableSearchHiddenPages true) ) }}
|
||||
{{- $title := .Title }}
|
||||
{{- if eq .Kind "taxonomy" }}
|
||||
{{- $title = default (default .Data.Plural (i18n .Data.Plural)) .Params.Title }}
|
||||
{{- else if eq .Kind "term" }}
|
||||
{{- $taxonomy_page := .Site.GetPage .Data.Plural }}
|
||||
{{- $title = default (default .Data.Singular (i18n .Data.Singular)) $taxonomy_page.Params.SingularTitle }}
|
||||
{{- $title = printf "%s %s %s" $title (default "::" .Site.Params.titleSeparator) (default (humanize .Data.Term | strings.Title) .Title) }}
|
||||
{{- end }}
|
||||
{{- $pages = $pages | append (dict
|
||||
"uri" (partial "relLangPrettyUglyURL.hugo" (dict "to" .))
|
||||
"title" $title
|
||||
"tags" .Params.tags
|
||||
"breadcrumb" (trim ((partial "breadcrumbs.html" (dict "page" . "dirOnly" true)) | plainify | htmlUnescape) "\n\r\t ")
|
||||
"description" .Description
|
||||
"content" (.Plain | htmlUnescape)
|
||||
) }}
|
||||
{{- end }}
|
||||
{{- end -}}
|
||||
{{- $pages | jsonify (dict "indent" " ") }}
|
||||
23
themes/hugo-theme-relearn/layouts/_default/index.search.js
Normal file
23
themes/hugo-theme-relearn/layouts/_default/index.search.js
Normal file
@@ -0,0 +1,23 @@
|
||||
{{- partialCached "page-meta.hugo" . .RelPermalink }}
|
||||
{{- $pages := slice }}
|
||||
{{- range .Site.Pages }}
|
||||
{{- if and .Title .RelPermalink (or (ne (.Scratch.Get "relearnIsHiddenStem") true) (ne .Site.Params.disableSearchHiddenPages true) ) }}
|
||||
{{- $title := .Title }}
|
||||
{{- if eq .Kind "taxonomy" }}
|
||||
{{- $title = default (default .Data.Plural (i18n .Data.Plural)) .Params.Title }}
|
||||
{{- else if eq .Kind "term" }}
|
||||
{{- $taxonomy_page := .Site.GetPage .Data.Plural }}
|
||||
{{- $title = default (default .Data.Singular (i18n .Data.Singular)) $taxonomy_page.Params.SingularTitle }}
|
||||
{{- $title = printf "%s %s %s" $title (default "::" .Site.Params.titleSeparator) (default (humanize .Data.Term | strings.Title) .Title) }}
|
||||
{{- end }}
|
||||
{{- $pages = $pages | append (dict
|
||||
"uri" (partial "relLangPrettyUglyURL.hugo" (dict "to" .))
|
||||
"title" $title
|
||||
"tags" .Params.tags
|
||||
"breadcrumb" (trim ((partial "breadcrumbs.html" (dict "page" . "dirOnly" true)) | plainify | htmlUnescape) "\n\r\t ")
|
||||
"description" .Description
|
||||
"content" (.Plain | htmlUnescape)
|
||||
) }}
|
||||
{{- end }}
|
||||
{{- end -}}
|
||||
var relearn_search_index = {{ $pages | jsonify (dict "indent" " ") }}
|
||||
1
themes/hugo-theme-relearn/layouts/_default/list.html
Normal file
1
themes/hugo-theme-relearn/layouts/_default/list.html
Normal file
@@ -0,0 +1 @@
|
||||
{{- partial "_main.hugo" . }}
|
||||
54
themes/hugo-theme-relearn/layouts/_default/rss.xml
Normal file
54
themes/hugo-theme-relearn/layouts/_default/rss.xml
Normal file
@@ -0,0 +1,54 @@
|
||||
{{- partialCached "page-meta.hugo" . .RelPermalink }}
|
||||
{{- /* Deprecate site.Author.email in favor of site.Params.author.email */}}
|
||||
{{- $authorEmail := "" }}
|
||||
{{- if and .Site.Params.author (reflect.IsMap .Site.Params.author) .Site.Params.author.email }}
|
||||
{{- $authorEmail = .Site.Params.author.email }}
|
||||
{{- else }}
|
||||
{{- with .Site.Author.email }}
|
||||
{{- $authorEmail = . }}
|
||||
{{- $hugoVersion := "0.120.0" }}
|
||||
{{- if ge hugo.Version $hugoVersion }}
|
||||
{{- warnf "The author key in site configuration is deprecated. Use params.author.email instead." }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
|
||||
{{- /* Deprecate site.Author.name in favor of site.Params.author.name */}}
|
||||
{{- $authorName := partialCached "authorname.hugo" . }}
|
||||
|
||||
{{- $pages := .Page.Pages }}
|
||||
{{- $limit := .Site.Config.Services.RSS.Limit }}
|
||||
{{- if ge $limit 0 }}
|
||||
{{- $pages = $pages | first $limit }}
|
||||
{{- end }}
|
||||
{{- $page := . }}
|
||||
{{- printf "<?xml version=\"1.0\" encoding=\"utf-8\" standalone=\"yes\"?>" | safeHTML }}
|
||||
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
|
||||
<channel>
|
||||
<title>{{ if eq .Title .Site.Title }}{{ .Site.Title }}{{ else }}{{ with .Title }}{{ . }} on {{ end }}{{ .Site.Title }}{{ end }}</title>
|
||||
<link>{{ partial "relLangPrettyUglyURL.hugo" (dict "to" . "abs" true) }}</link>
|
||||
<description>Recent content {{ if ne .Title .Site.Title }}{{ with .Title }}in {{ . }} {{ end }}{{ end }}on {{ .Site.Title }}</description>
|
||||
<generator>Hugo -- gohugo.io</generator>{{ with .Site.LanguageCode }}
|
||||
<language>{{ . }}</language>{{end}}{{ with $authorEmail }}
|
||||
<managingEditor>{{ . }}{{ with $authorName }} ({{ . }}){{ end }}</managingEditor>{{ end }}{{ with $authorEmail }}
|
||||
<webMaster>{{ . }}{{ with $authorName }} ({{ . }}){{ end }}</webMaster>{{ end }}{{ with .Site.Copyright }}
|
||||
<copyright>{{ . }}</copyright>{{ end }}{{ if not .Date.IsZero }}
|
||||
<lastBuildDate>{{ .Date.Format "Mon, 02 Jan 2006 15:04:05 -0700" | safeHTML }}</lastBuildDate>{{ end }}
|
||||
{{- with .OutputFormats.Get "rss" }}
|
||||
{{ printf "<atom:link href=%q rel=\"self\" type=%q />" ( partial "relLangPrettyUglyURL.hugo" (dict "to" . "abs" true)) .MediaType | safeHTML }}
|
||||
{{- end -}}
|
||||
{{- range $pages }}
|
||||
{{- $relearnIsHiddenFrom := index ($page.Scratch.Get "relearnIsHiddenFrom") .RelPermalink }}
|
||||
{{- if and .Permalink .Title (or (not $relearnIsHiddenFrom) (ne .Site.Params.disableSeoHiddenPages true) ) }}
|
||||
<item>
|
||||
<title>{{ .Title }}</title>
|
||||
<link>{{ partial "relLangPrettyUglyURL.hugo" (dict "to" . "abs" true) }}</link>
|
||||
<pubDate>{{ .Date.Format "Mon, 02 Jan 2006 15:04:05 -0700" | safeHTML }}</pubDate>
|
||||
{{- with $authorEmail }}<author>{{ . }}{{ with $authorName }} ({{ . }}){{ end }}</author>{{ end }}
|
||||
<guid>{{ partial "relLangPrettyUglyURL.hugo" (dict "to" . "abs" true) }}</guid>
|
||||
<description>{{ .Summary | html }}</description>
|
||||
</item>
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
</channel>
|
||||
</rss>
|
||||
1
themes/hugo-theme-relearn/layouts/_default/single.html
Normal file
1
themes/hugo-theme-relearn/layouts/_default/single.html
Normal file
@@ -0,0 +1 @@
|
||||
{{- partial "_main.hugo" . }}
|
||||
28
themes/hugo-theme-relearn/layouts/_default/sitemap.xml
Normal file
28
themes/hugo-theme-relearn/layouts/_default/sitemap.xml
Normal file
@@ -0,0 +1,28 @@
|
||||
{{- partialCached "page-meta.hugo" . .RelPermalink }}
|
||||
{{- printf "<?xml version=\"1.0\" encoding=\"utf-8\" standalone=\"yes\" ?>" | safeHTML }}
|
||||
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9" xmlns:xhtml="http://www.w3.org/1999/xhtml">
|
||||
{{- range .Data.Pages }}
|
||||
{{- if and .Title .RelPermalink (or (ne (.Scratch.Get "relearnIsHiddenStem") true) (ne .Site.Params.disableSeoHiddenPages true) ) }}
|
||||
<url>
|
||||
<loc>{{ partial "relLangPrettyUglyURL.hugo" (dict "to" . "abs" true) }}</loc>
|
||||
{{- if not .Lastmod.IsZero }}
|
||||
<lastmod>{{ safeHTML ( .Lastmod.Format "2006-01-02T15:04:05-07:00" ) }}</lastmod>
|
||||
{{- end }}
|
||||
{{- with .Sitemap.ChangeFreq }}
|
||||
<changefreq>{{ . }}</changefreq>
|
||||
{{- end }}
|
||||
{{- if ge .Sitemap.Priority 0.0 }}
|
||||
<priority>{{ .Sitemap.Priority }}</priority>
|
||||
{{- end }}
|
||||
{{- if .IsTranslated }}
|
||||
{{- range $index, $trans := .AllTranslations }}
|
||||
{{- if eq $index 0 }}
|
||||
<xhtml:link rel="alternate" hreflang="x-default" href="{{ partial "relLangPrettyUglyURL.hugo" (dict "to" . "abs" true) }}" />
|
||||
{{- end }}
|
||||
<xhtml:link rel="alternate" hreflang="{{ .Language.LanguageCode }}" href="{{ partial "relLangPrettyUglyURL.hugo" (dict "to" . "abs" true) }}" />
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
</url>
|
||||
{{- end -}}
|
||||
{{- end }}
|
||||
</urlset>
|
||||
33
themes/hugo-theme-relearn/layouts/_default/taxonomy.html
Normal file
33
themes/hugo-theme-relearn/layouts/_default/taxonomy.html
Normal file
@@ -0,0 +1,33 @@
|
||||
{{- partialCached "page-meta.hugo" . .RelPermalink }}
|
||||
{{- partial "header.html" . }}
|
||||
<article>
|
||||
<header class="headline">
|
||||
</header>
|
||||
{{- $page := . }}
|
||||
|
||||
{{- $title := default (default .Data.Plural (i18n .Data.Plural)) .Params.Title }}
|
||||
<h1 id="{{ $title | plainify | anchorize }}">{{ $title }}</h1>
|
||||
{{- .Content }}
|
||||
{{- $lastCapital := "" }}
|
||||
{{- $pages := partialCached "partials/pageHelper/taxonomyPages.html" . . }}
|
||||
{{- range $pages }}
|
||||
{{- $capital := substr .Title 0 1 | upper }}
|
||||
{{- if ne $lastCapital $capital }}
|
||||
{{- if ne $lastCapital "" }}
|
||||
</ul>
|
||||
{{- end }}
|
||||
<h2 id="{{ $capital | plainify | anchorize }}">{{ $capital }}</h2>
|
||||
<ul class="columnize">
|
||||
{{- end }}
|
||||
{{- $c:=""}}{{/* display terms of a taxonomy */}}
|
||||
<li><a href="{{ partial "relLangPrettyUglyURL.hugo" (dict "to" .Page) }}">{{ .Title }}</a> ({{ .Count }})</li>
|
||||
{{- $lastCapital = $capital }}
|
||||
{{- end }}
|
||||
{{- if ne $lastCapital "" }}
|
||||
</ul>
|
||||
{{- end }}
|
||||
|
||||
<footer class="footline">
|
||||
</footer>
|
||||
</article>
|
||||
{{- partial "footer.html" . }}
|
||||
39
themes/hugo-theme-relearn/layouts/_default/term.html
Normal file
39
themes/hugo-theme-relearn/layouts/_default/term.html
Normal file
@@ -0,0 +1,39 @@
|
||||
{{- partialCached "page-meta.hugo" . .RelPermalink }}
|
||||
{{- partial "header.html" . }}
|
||||
<article>
|
||||
<header class="headline">
|
||||
</header>
|
||||
{{- $page := . }}
|
||||
|
||||
{{- $taxonomy_page := .Site.GetPage .Data.Plural }}
|
||||
{{- $title := default (default .Data.Singular (i18n .Data.Singular)) $taxonomy_page.Params.SingularTitle }}
|
||||
{{- $title = printf "%s %s %s" $title (default "::" .Site.Params.titleSeparator) (default (humanize .Data.Term | strings.Title) .Title) }}
|
||||
<h1 id="{{ $title | plainify | anchorize }}">{{ $title }}</h1>
|
||||
{{- .Content }}
|
||||
{{- $lastCapital := "" }}
|
||||
{{- $pages := partialCached "partials/pageHelper/termPages.html" . . }}
|
||||
{{- range $pages }}
|
||||
{{- $capital := substr .Title 0 1 | upper }}
|
||||
{{- if ne $lastCapital $capital }}
|
||||
{{- if ne $lastCapital "" }}
|
||||
</ul>
|
||||
{{- end }}
|
||||
<h2 id="{{ $capital | plainify | anchorize }}">{{ $capital }}</h2>
|
||||
<ul class="columnize">
|
||||
{{- end }}
|
||||
{{- $c:=""}}{{/* display pages of a term */}}
|
||||
{{- $breadcrumb := "" }}
|
||||
{{- if (ne .Page.Site.Params.disableTermBreadcrumbs true) }}
|
||||
{{- $breadcrumb = (trim ((partial "breadcrumbs.html" (dict "page" .Page "dirOnly" true)) | plainify | htmlUnescape) "\n\r\t ") }}
|
||||
{{- end }}
|
||||
<li><a href="{{ partial "relLangPrettyUglyURL.hugo" (dict "to" .Page) }}">{{ .Title }}</a>{{ with $breadcrumb }}<div class="breadcrumbs highlightable" title="{{ . }}">{{ . }}</div>{{ end }}</li>
|
||||
{{- $lastCapital = $capital }}
|
||||
{{- end }}
|
||||
{{- if ne $lastCapital "" }}
|
||||
</ul>
|
||||
{{- end }}
|
||||
|
||||
<footer class="footline">
|
||||
</footer>
|
||||
</article>
|
||||
{{- partial "footer.html" . }}
|
||||
30
themes/hugo-theme-relearn/layouts/alias.html
Normal file
30
themes/hugo-theme-relearn/layouts/alias.html
Normal file
@@ -0,0 +1,30 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
{{- $url := .Permalink }}
|
||||
{{- if site.BaseURL }}
|
||||
{{- $url = replace .Permalink site.BaseURL "/" }}
|
||||
{{- end }}
|
||||
{{- $url = replace $url "//" "/" }}
|
||||
{{- with site.Home.GetPage $url }}
|
||||
{{- $c := "" }}{{/* if defaultContentLanguageInSubdir=false we are ending here for home page of the default language */}}
|
||||
{{- $url = partial "relLangPrettyUglyURL.hugo" (dict "to" .) }}
|
||||
{{- else }}
|
||||
{{- $url_alt := replaceRE "^/[^/]*(/.*)" "${1}" $url }}
|
||||
{{- with site.Home.GetPage $url_alt }}
|
||||
{{- $c := "" }}{{/* if defaultContentLanguageInSubdir=true we are ending here for home page */}}
|
||||
{{- $url = partial "relLangPrettyUglyURL.hugo" (dict "to" .) }}
|
||||
{{- else }}
|
||||
{{- $c := "" }}{{/* for regular aliases we are ending here with no original page found */}}
|
||||
{{- $url = partial "relLangPrettyUglyURL.hugo" (dict "link" $url) }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
<meta charset="utf-8">
|
||||
<meta name="robots" content="noindex">
|
||||
<meta http-equiv="refresh" content="0; url={{ $url }}">
|
||||
{{- $link := "<link href=\"%s\" rel=\"%s\" type=\"%s\" title=\"%s\">" }}
|
||||
<title>{{ $url }}</title>
|
||||
|
||||
{{ (printf $link $url "canonical" "text/html" ($url | htmlEscape)) | safeHTML }}
|
||||
</head>
|
||||
</html>
|
||||
2
themes/hugo-theme-relearn/layouts/partials/BaseName.hugo
Normal file
2
themes/hugo-theme-relearn/layouts/partials/BaseName.hugo
Normal file
@@ -0,0 +1,2 @@
|
||||
{{- $ret := path.Base (strings.TrimSuffix (path.Ext .) .) }}
|
||||
{{- return $ret }}
|
||||
9
themes/hugo-theme-relearn/layouts/partials/_main.hugo
Normal file
9
themes/hugo-theme-relearn/layouts/partials/_main.hugo
Normal file
@@ -0,0 +1,9 @@
|
||||
{{- partialCached "page-meta.hugo" . .RelPermalink }}
|
||||
{{- $outputFormat := partial "output-format.hugo" . }}
|
||||
{{- partial "output-partial.hugo" (dict "base" "header" "page" . "parameter" . "outputFormat" $outputFormat) }}
|
||||
{{- if not .File }}
|
||||
{{- partial "output-partial.hugo" (dict "base" "body" "page" . "parameter" (dict "page" . "content" (partial "output-partial.hugo" (dict "base" "initial" "page" . "parameter" . "outputFormat" $outputFormat))) "outputFormat" $outputFormat) }}
|
||||
{{- else }}
|
||||
{{- partial "output-partial.hugo" (dict "base" "body" "page" . "parameter" (dict "page" . "content" (partial "output-partial.hugo" (dict "base" "content" "page" . "parameter" . "outputFormat" $outputFormat))) "outputFormat" $outputFormat) }}
|
||||
{{- end }}
|
||||
{{- partial "output-partial.hugo" (dict "base" "footer" "page" . "parameter" . "outputFormat" $outputFormat) }}
|
||||
27
themes/hugo-theme-relearn/layouts/partials/archetype.hugo
Normal file
27
themes/hugo-theme-relearn/layouts/partials/archetype.hugo
Normal file
@@ -0,0 +1,27 @@
|
||||
{{- $hook := .hook }}
|
||||
{{- $page := .page }}
|
||||
{{- $parameter := .parameter }}
|
||||
{{- $outputFormat := .outputFormat }}
|
||||
{{- if not $outputFormat }}
|
||||
{{- $outputFormat = partial "output-format.hugo" $page }}
|
||||
{{- end }}
|
||||
{{- $archetype := "default" }}
|
||||
{{- if not $page.File }}
|
||||
{{- else if $page.Params.archetype }}
|
||||
{{- $archetype = $page.Params.archetype }}
|
||||
{{- else if $page.Params.chapter }}
|
||||
{{- $archetype = "chapter" }}
|
||||
{{- if findRE `(?s)<h1.*?>.*?</h1>` .Content }}
|
||||
{{- $archetype = "deprecated-chapter" }}
|
||||
{{- end }}
|
||||
{{- else if $page.IsHome }}
|
||||
{{- $archetype = "home" }}
|
||||
{{- if findRE `(?s)<h1.*?>.*?</h1>` .Content }}
|
||||
{{- $archetype = "deprecated-home" }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{- $f := printf "/layouts/partials/archetypes/%s" $archetype }}
|
||||
{{- if not (partialCached "fileExists.hugo" $f $f) }}
|
||||
{{- $archetype = "default" }}
|
||||
{{- end }}
|
||||
{{- partial "output-partial.hugo" (dict "base" (printf "archetypes/%s/%s" $archetype $hook) "page" $page "parameter" $parameter "outputFormat" $outputFormat) }}
|
||||
@@ -0,0 +1,16 @@
|
||||
{{- $page := .page }}
|
||||
{{- $content := .content }}
|
||||
{{- with $page }}
|
||||
<article class="chapter">
|
||||
<header class="headline">
|
||||
{{- partial "content-header.html" . }}
|
||||
</header>
|
||||
{{ partial "heading-pre.html" . }}<div class="article-subheading">{{ T "Chapter" .Params.Weight }}</div>
|
||||
{{ partial "heading.html" . }}{{ partial "heading-post.html" . }}
|
||||
|
||||
{{ $content | safeHTML }}
|
||||
<footer class="footline">
|
||||
{{- partial "content-footer.html" . }}
|
||||
</footer>
|
||||
</article>
|
||||
{{- end }}
|
||||
@@ -0,0 +1 @@
|
||||
chapter narrow
|
||||
@@ -0,0 +1,15 @@
|
||||
{{- $page := .page }}
|
||||
{{- $content := .content }}
|
||||
{{- with $page }}
|
||||
<article class="default">
|
||||
<header class="headline">
|
||||
{{- partial "content-header.html" . }}
|
||||
</header>
|
||||
{{ partial "heading-pre.html" . }}{{ partial "heading.html" . }}{{ partial "heading-post.html" . }}
|
||||
|
||||
{{ $content | safeHTML }}
|
||||
<footer class="footline">
|
||||
{{- partial "content-footer.html" . }}
|
||||
</footer>
|
||||
</article>
|
||||
{{- end }}
|
||||
@@ -0,0 +1 @@
|
||||
default
|
||||
@@ -0,0 +1,15 @@
|
||||
{{- $page := .page }}
|
||||
{{- $content := .content }}
|
||||
{{- with $page }}
|
||||
{{- warnf "%q: DEPRECATED usage of old 'chapter' archetype found, remove 'chapter=true' and add 'archetype=\"chapter\"' to your frontmatter and remove the leading h3 and h1 headings; see https://mcshelby.github.io/hugo-theme-relearn/basics/migration#500" $page.File.Filename }}
|
||||
<article class="chapter deprecated">
|
||||
<header class="headline">
|
||||
{{- partial "content-header.html" . }}
|
||||
</header>
|
||||
|
||||
{{ $content | safeHTML }}
|
||||
<footer class="footline">
|
||||
{{- partial "content-footer.html" . }}
|
||||
</footer>
|
||||
</article>
|
||||
{{- end }}
|
||||
@@ -0,0 +1 @@
|
||||
chapter narrow
|
||||
@@ -0,0 +1,15 @@
|
||||
{{- $page := .page }}
|
||||
{{- $content := .content }}
|
||||
{{- with $page }}
|
||||
{{- warnf "%q: DEPRECATED usage of old 'home' archetype found, add 'archetype=\"home\"' to your frontmatter and remove the leading h1 heading; see https://mcshelby.github.io/hugo-theme-relearn/basics/migration#500" $page.File.Filename }}
|
||||
<article class="home deprecated">
|
||||
<header class="headline">
|
||||
{{- partial "content-header.html" . }}
|
||||
</header>
|
||||
|
||||
{{ $content | safeHTML }}
|
||||
<footer class="footline">
|
||||
{{- partial "content-footer.html" . }}
|
||||
</footer>
|
||||
</article>
|
||||
{{- end }}
|
||||
@@ -0,0 +1 @@
|
||||
home
|
||||
@@ -0,0 +1,15 @@
|
||||
{{- $page := .page }}
|
||||
{{- $content := .content }}
|
||||
{{- with $page }}
|
||||
<article class="home">
|
||||
<header class="headline">
|
||||
{{- partial "content-header.html" . }}
|
||||
</header>
|
||||
{{ partial "heading-pre.html" . }}{{ partial "heading.html" . }}{{ partial "heading-post.html" . }}
|
||||
|
||||
{{ $content | safeHTML }}
|
||||
<footer class="footline">
|
||||
{{- partial "content-footer.html" . }}
|
||||
</footer>
|
||||
</article>
|
||||
{{- end }}
|
||||
@@ -0,0 +1 @@
|
||||
home
|
||||
5
themes/hugo-theme-relearn/layouts/partials/article.html
Normal file
5
themes/hugo-theme-relearn/layouts/partials/article.html
Normal file
@@ -0,0 +1,5 @@
|
||||
{{- $page := .page }}
|
||||
{{- $content := .content }}
|
||||
{{- $outputFormat := .outputFormat }}
|
||||
{{- $hook := "article" }}
|
||||
{{- partialCached "archetype.hugo" (dict "hook" $hook "page" $page "parameter" (dict "page" $page "content" $content) "outputFormat" $outputFormat) $page.RelPermalink $outputFormat $hook }}
|
||||
20
themes/hugo-theme-relearn/layouts/partials/authorname.hugo
Normal file
20
themes/hugo-theme-relearn/layouts/partials/authorname.hugo
Normal file
@@ -0,0 +1,20 @@
|
||||
{{- $authorName := "" }}
|
||||
{{- if .Site.Params.author }}
|
||||
{{- if reflect.IsMap .Site.Params.author }}
|
||||
{{- with .Site.Params.author.name }}
|
||||
{{- $authorName = . }}
|
||||
{{- end }}
|
||||
{{- else }}
|
||||
{{- warnf "DEPRECATED usage of 'params.author' config parameter found, replace it with `params.author.name` in your hugo.toml; see https://mcshelby.github.io/hugo-theme-relearn/basics/migration#5230" }}
|
||||
{{- $authorName = .Site.Params.author }}
|
||||
{{- end }}
|
||||
{{- else }}
|
||||
{{- with .Site.Author.name }}
|
||||
{{- $authorName = . }}
|
||||
{{- $hugoVersion := "0.120.0" }}
|
||||
{{- if ge hugo.Version $hugoVersion }}
|
||||
{{- warnf "The author key in site configuration is deprecated. Use params.author.name instead." }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{- return $authorName }}
|
||||
4
themes/hugo-theme-relearn/layouts/partials/body.html
Normal file
4
themes/hugo-theme-relearn/layouts/partials/body.html
Normal file
@@ -0,0 +1,4 @@
|
||||
{{- $page := .page }}
|
||||
{{- $content := .content }}
|
||||
{{- $outputFormat := partial "output-format.hugo" .page }}
|
||||
{{- partial "single-article.hugo" (dict "page" $page "content" $content "outputFormat" $outputFormat) }}
|
||||
@@ -0,0 +1,4 @@
|
||||
{{- $page := .page }}
|
||||
{{- $content := .content }}
|
||||
{{- $outputFormat := partial "output-format.hugo" .page }}
|
||||
{{- partial "nested-article.hugo" (dict "page" $page "outputFormat" $outputFormat) }}
|
||||
@@ -0,0 +1,29 @@
|
||||
{{- $page := .page }}
|
||||
{{- $title := T "Search" }}
|
||||
<article class="default">
|
||||
<header class="headline">
|
||||
</header>
|
||||
<h1 id="{{ $title | plainify | anchorize }}">{{ $title }}</h1>
|
||||
|
||||
<form action="javascript:triggerSearch()">
|
||||
<div class="searchform">
|
||||
<label class="a11y-only" for="R-search-by-detail">{{ T "Search" }}</label>
|
||||
<input data-search-input id="R-search-by-detail" class="search-by" name="search-by" type="search" placeholder="{{ T "Search-placeholder" }}">
|
||||
{{- partial "shortcodes/button.html" (dict
|
||||
"page" $page
|
||||
"type" "submit"
|
||||
"style" "secondary"
|
||||
"icon" "search"
|
||||
"content" (T "Search")
|
||||
)}}
|
||||
</div>
|
||||
</form>
|
||||
<div class="searchhint">
|
||||
</div>
|
||||
<hr>
|
||||
<div id="R-searchresults">
|
||||
</div>
|
||||
|
||||
<footer class="footline">
|
||||
</footer>
|
||||
</article>
|
||||
51
themes/hugo-theme-relearn/layouts/partials/breadcrumbs.html
Normal file
51
themes/hugo-theme-relearn/layouts/partials/breadcrumbs.html
Normal file
@@ -0,0 +1,51 @@
|
||||
{{- $page := .page }}
|
||||
{{- $to := $page }}
|
||||
{{- $pageurl := partial "relLangPrettyUglyURL.hugo" (dict "to" $page) }}
|
||||
{{- $lasturl := partial "relLangPrettyUglyURL.hugo" (dict "to" $page) }}
|
||||
{{- if .dirOnly }}
|
||||
{{- $page = $page.Parent }}
|
||||
{{- $to = $page }}
|
||||
{{- $lasturl = partial "relLangPrettyUglyURL.hugo" (dict "to" $page) }}
|
||||
{{- end }}
|
||||
{{- $depth := add 1 (int (partial "get-page-depth.hugo" (dict "page" $page))) }}
|
||||
{{- if .page.Site.Params.disableRootBreadcrumb }}
|
||||
{{- $depth = add $depth -1 }}
|
||||
{{- end }}
|
||||
{{- $breadcrumb := slice }}
|
||||
{{- range seq $depth }}
|
||||
{{- if $to }}
|
||||
{{- if or $to.Title (eq $to.Kind "taxonomy") (eq $to.Kind "term") }}
|
||||
{{- $breadcrumb = $breadcrumb | append $to }}
|
||||
{{- end }}
|
||||
{{- else }}
|
||||
{{- break }}
|
||||
{{- end }}
|
||||
{{- $to = $to.Parent }}
|
||||
{{- end }}
|
||||
{{- $len := len $breadcrumb -}}
|
||||
{{- $breadcrumbReversed := slice }}
|
||||
{{- range seq $len }}
|
||||
{{- $breadcrumbReversed = $breadcrumbReversed | append (index $breadcrumb (sub $len .)) }}
|
||||
{{- end }}
|
||||
{{- $depth := 0 }}
|
||||
{{- range $i, $e := $breadcrumbReversed }}
|
||||
{{- $to := $e }}
|
||||
{{- $depth = add $depth 1 }}
|
||||
{{- $title := $to.Title }}
|
||||
{{- if eq $to.Kind "taxonomy" }}
|
||||
{{- $title = default (default $to.Data.Plural (i18n $to.Data.Plural)) $to.Params.Title }}
|
||||
{{- else if eq $to.Kind "term" }}
|
||||
{{- $taxonomy_page := $to.Site.GetPage $to.Data.Plural }}
|
||||
{{- $title = default (default $to.Data.Singular (i18n $to.Data.Singular)) $taxonomy_page.Params.SingularTitle }}
|
||||
{{- $title = printf "%s %s %s" $title (default "::" $to.Site.Params.titleSeparator) (default (humanize $to.Data.Term | strings.Title) $to.Title) }}
|
||||
{{- end }}
|
||||
{{- if not $title }}
|
||||
{{- $title = $to.Site.Title }}
|
||||
{{- end }}
|
||||
{{- $url := partial "relLangPrettyUglyURL.hugo" (dict "to" $to) }}
|
||||
{{- $isPage := eq $url $pageurl }}
|
||||
{{- $isLast := eq $url $lasturl }}
|
||||
{{- $link := and $url (not $isPage) }}
|
||||
{{- printf "<li" | safeHTML }}
|
||||
itemscope itemtype="https://schema.org/ListItem" itemprop="itemListElement">{{ if $link }}<a itemprop="item" href="{{ $url }}">{{end}}<span itemprop="name">{{ $title }}</span>{{ if $link }}</a>{{ end }}<meta itemprop="position" content="{{ $depth }}">{{ if not $isLast }}{{ (printf " %s " (default ">" .Site.Params.breadcrumbSeparator)) | safeHTML }}{{ end }}</li>
|
||||
{{- end }}
|
||||
@@ -0,0 +1,35 @@
|
||||
{{- $LastModifierDisplayName := "" }}
|
||||
{{- $LastModifierEmail := "" }}
|
||||
{{- $Date := "" }}
|
||||
{{- with .GitInfo }}
|
||||
{{- with .AuthorName }}
|
||||
{{- $LastModifierDisplayName = . }}
|
||||
{{- end }}
|
||||
{{- with .AuthorEmail }}
|
||||
{{- $LastModifierEmail = . }}
|
||||
{{- end }}
|
||||
{{- with .AuthorDate }}
|
||||
{{- $Date = . | time.Format ":date_medium" }}
|
||||
{{- end }}
|
||||
{{- else }}
|
||||
{{- with .Params.LastModifierDisplayName }}
|
||||
{{- $LastModifierDisplayName = . }}
|
||||
{{- end }}
|
||||
{{- with .Params.LastModifierEmail }}
|
||||
{{- $LastModifierEmail = . }}
|
||||
{{- end }}
|
||||
{{- with .Date }}
|
||||
{{- $Date = . | time.Format ":date_medium" }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{- if $LastModifierDisplayName }}
|
||||
<i class='fa-fw fas fa-user'></i> {{ with $LastModifierEmail }}<a href="mailto:{{ . }}">{{ end }}{{ $LastModifierDisplayName }}{{ with $LastModifierEmail }}</a>{{ end }}
|
||||
{{- with $Date }}
|
||||
<i class='fa-fw fas fa-calendar'></i> {{ . }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{- partial "term-list.html" (dict
|
||||
"page" .
|
||||
"taxonomy" "categories"
|
||||
"icon" "layer-group"
|
||||
) }}
|
||||
@@ -0,0 +1 @@
|
||||
{{- partial "tags.html" . }}
|
||||
1
themes/hugo-theme-relearn/layouts/partials/content.html
Normal file
1
themes/hugo-theme-relearn/layouts/partials/content.html
Normal file
@@ -0,0 +1 @@
|
||||
{{- .Content }}
|
||||
@@ -0,0 +1,3 @@
|
||||
<!-- import your comments system
|
||||
{{ template "_internal/disqus.html" . }}
|
||||
-->
|
||||
@@ -0,0 +1,5 @@
|
||||
<!-- Partial intended to be overwritten with tags loaded at the end of the page loading (usually for Javascript)
|
||||
<script>
|
||||
console.log("running some javascript");
|
||||
</script>
|
||||
-->
|
||||
@@ -0,0 +1,5 @@
|
||||
<!-- Partial intended to be overwritten to add custom headers, like CSS or any other info
|
||||
<style>
|
||||
/* Custom css */
|
||||
</style>
|
||||
-->
|
||||
12
themes/hugo-theme-relearn/layouts/partials/dependencies.html
Normal file
12
themes/hugo-theme-relearn/layouts/partials/dependencies.html
Normal file
@@ -0,0 +1,12 @@
|
||||
{{- $page := .page }}
|
||||
{{- $location := .location }}
|
||||
{{- $outputFormat := .outputFormat }}
|
||||
{{- range $k, $v := $page.Site.Params.relearn.dependencies }}
|
||||
{{- $has := printf "has%s" $v.name }}
|
||||
{{- $nestedhas := printf "nestedHas%s" $v.name }}
|
||||
{{- $wants := or ($page.Page.Store.Get $has) (and ($page.Page.Store.Get (printf "%sIsNested" $outputFormat)) ($page.Page.Store.Get $nestedhas)) }}
|
||||
{{- if and $wants (eq $location $v.location) }}
|
||||
{{- $dep := printf "dependencies/%s.html" $k }}
|
||||
{{- partial $dep (dict "page" $page) }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
@@ -0,0 +1,44 @@
|
||||
{{- $page := .page }}
|
||||
{{- with $page }}
|
||||
{{- $init := "{}" }}
|
||||
{{- if isset .Params "mathjaxinitialize" }}
|
||||
{{- $init = .Params.mathJaxInitialize }}
|
||||
{{- else if isset .Site.Params "mathjaxinitialize" }}
|
||||
{{- $init = .Site.Params.mathJaxInitialize }}
|
||||
{{- end }}
|
||||
<script>
|
||||
function useMathJax( config ){
|
||||
if( !Object.assign ){
|
||||
// We don't support MathJax for IE11 anyways, so bail out early
|
||||
return;
|
||||
}
|
||||
window.MathJax = Object.assign( window.MathJax || {}, {
|
||||
loader: {
|
||||
load: ['[tex]/mhchem']
|
||||
},
|
||||
startup: {
|
||||
elements: [
|
||||
'.math'
|
||||
]
|
||||
},
|
||||
tex: {
|
||||
inlineMath: [
|
||||
['$', '$'], // allow for single dollars as we set startup.elements
|
||||
['\\(', '\\)']
|
||||
]
|
||||
},
|
||||
options: {
|
||||
enableMenu: false // avoid translation hassle for context menu
|
||||
}
|
||||
}, config );
|
||||
}
|
||||
useMathJax( JSON.parse({{ $init }}) );
|
||||
</script>
|
||||
{{- if and (isset .Params "custommathjaxurl") .Params.customMathJaxURL }}
|
||||
<script id="MathJax-script" async src="{{ .Params.customMathJaxURL }}"></script>
|
||||
{{- else if and (isset .Site.Params "custommathjaxurl") .Site.Params.customMathJaxURL }}
|
||||
<script id="MathJax-script" async src="{{ .Site.Params.customMathJaxURL }}"></script>
|
||||
{{- else }}
|
||||
<script id="MathJax-script" async src="{{"js/mathjax/tex-mml-chtml.js" | relURL}}{{ if not .Site.Params.disableAssetsBusting }}?{{ now.Unix }}{{ end }}"></script>
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
@@ -0,0 +1,29 @@
|
||||
{{- $page := .page }}
|
||||
{{- with $page }}
|
||||
<script src="{{"js/d3/d3-color.min.js" | relURL}}{{ if not .Site.Params.disableAssetsBusting }}?{{ now.Unix }}{{ end }}" defer></script>
|
||||
<script src="{{"js/d3/d3-dispatch.min.js" | relURL}}{{ if not .Site.Params.disableAssetsBusting }}?{{ now.Unix }}{{ end }}" defer></script>
|
||||
<script src="{{"js/d3/d3-drag.min.js" | relURL}}{{ if not .Site.Params.disableAssetsBusting }}?{{ now.Unix }}{{ end }}" defer></script>
|
||||
<script src="{{"js/d3/d3-ease.min.js" | relURL}}{{ if not .Site.Params.disableAssetsBusting }}?{{ now.Unix }}{{ end }}" defer></script>
|
||||
<script src="{{"js/d3/d3-interpolate.min.js" | relURL}}{{ if not .Site.Params.disableAssetsBusting }}?{{ now.Unix }}{{ end }}" defer></script>
|
||||
<script src="{{"js/d3/d3-selection.min.js" | relURL}}{{ if not .Site.Params.disableAssetsBusting }}?{{ now.Unix }}{{ end }}" defer></script>
|
||||
<script src="{{"js/d3/d3-timer.min.js" | relURL}}{{ if not .Site.Params.disableAssetsBusting }}?{{ now.Unix }}{{ end }}" defer></script>
|
||||
<script src="{{"js/d3/d3-transition.min.js" | relURL}}{{ if not .Site.Params.disableAssetsBusting }}?{{ now.Unix }}{{ end }}" defer></script>
|
||||
<script src="{{"js/d3/d3-zoom.min.js" | relURL}}{{ if not .Site.Params.disableAssetsBusting }}?{{ now.Unix }}{{ end }}" defer></script>
|
||||
<script src="{{"js/js-yaml.min.js" | relURL}}{{ if not .Site.Params.disableAssetsBusting }}?{{ now.Unix }}{{ end }}" defer></script>
|
||||
{{- if and (isset .Params "custommermaidurl") .Params.customMermaidURL }}
|
||||
<script src="{{ .Params.customMermaidURL }}" defer></script>
|
||||
{{- else if and (isset .Site.Params "custommermaidurl") .Site.Params.customMermaidURL }}
|
||||
<script src="{{ .Site.Params.customMermaidURL }}" defer></script>
|
||||
{{- else }}
|
||||
<script src="{{"js/mermaid.min.js" | relURL}}{{ if not .Site.Params.disableAssetsBusting }}?{{ now.Unix }}{{ end }}" defer></script>
|
||||
{{- end }}
|
||||
{{- $init := "{}" }}
|
||||
{{- if isset .Params "mermaidinitialize" }}
|
||||
{{- $init = .Params.mermaidInitialize }}
|
||||
{{- else if isset .Site.Params "mermaidinitialize" }}
|
||||
{{- $init = .Site.Params.mermaidInitialize }}
|
||||
{{- end }}
|
||||
<script>
|
||||
window.themeUseMermaid = JSON.parse({{ $init }});
|
||||
</script>
|
||||
{{- end }}
|
||||
@@ -0,0 +1,27 @@
|
||||
{{- $page := .page }}
|
||||
{{- with $page }}
|
||||
<script src="{{"js/js-yaml.min.js" | relURL}}{{ if not .Site.Params.disableAssetsBusting }}?{{ now.Unix }}{{ end }}" defer></script>
|
||||
{{- $urlOpenapi := "" }}
|
||||
{{- $relOpenapi := "" }}
|
||||
{{- $cssInProject := false }}
|
||||
{{- if and (isset .Params "customopenapiurl") .Params.customOpenapiURL }}
|
||||
{{- $urlOpenapi = .Params.customOpenapiURL }}
|
||||
{{- $relOpenapi = .Params.customOpenapiURL }}
|
||||
{{- else if and (isset .Site.Params "customopenapiurl") .Site.Params.customOpenapiURL }}
|
||||
{{- $urlOpenapi = .Site.Params.customOpenapiURL }}
|
||||
{{- $relOpenapi = .Site.Params.customOpenapiURL }}
|
||||
{{- else }}
|
||||
{{- $urlOpenapi = printf "%s%s" ("js/swagger-ui/swagger-ui-bundle.js" | relURL) (cond .Site.Params.disableAssetsBusting "" (printf "?%d" now.Unix)) }}
|
||||
{{- $relOpenapi = printf "%s%s" ("/js/swagger-ui/swagger-ui-bundle.js") (cond .Site.Params.disableAssetsBusting "" (printf "?%d" now.Unix)) }}
|
||||
{{- $cssInProject = true }}
|
||||
{{- end }}
|
||||
<script>window.noZensmooth = true;</script>
|
||||
<script src="{{ $urlOpenapi }}" defer></script>
|
||||
{{- $urlOpenapi := replace $urlOpenapi "swagger-ui-bundle" "swagger-ui-standalone-preset" }}
|
||||
<script src="{{ $urlOpenapi }}" defer></script>
|
||||
{{- $relOpenapi := replace $relOpenapi "swagger-ui-bundle" "swagger-ui" }}
|
||||
{{- $relOpenapi := replace $relOpenapi ".js" ".css" }}
|
||||
<script>
|
||||
window.themeUseOpenapi = { css: {{ $relOpenapi }}, cssInProject: {{ $cssInProject | safeJS }}, assetsBuster: {{ cond (not .Site.Params.disableAssetsBusting) now.Unix 0 }} };
|
||||
</script>
|
||||
{{- end }}
|
||||
32
themes/hugo-theme-relearn/layouts/partials/favicon.html
Normal file
32
themes/hugo-theme-relearn/layouts/partials/favicon.html
Normal file
@@ -0,0 +1,32 @@
|
||||
{{- $assetBusting := not .Site.Params.disableAssetsBusting }}
|
||||
{{- $faviconMatch := false }}
|
||||
{{- $svg := dict "ext" "svg" "type" "type=\"image/svg+xml\"" }}
|
||||
{{- $png := dict "ext" "png" "type" "type=\"image/png\"" }}
|
||||
{{- $ico := dict "ext" "ico" "type" "type=\"image/x-icon\" sizes=\"any\"" }}
|
||||
{{- $faviconTypes := slice $svg $png $ico }}
|
||||
{{- $faviconNames := slice "favicon" "logo" }}
|
||||
{{- range $faviconNames }}
|
||||
{{- $faviconName := . }}
|
||||
{{- range $faviconTypes }}
|
||||
{{- if fileExists (printf "/static/images/%s.%s" $faviconName .ext) }}
|
||||
{{- $faviconMatch = true }}
|
||||
<link href="{{ printf "images/%s.%s" $faviconName .ext | relURL }}{{ if $assetBusting }}?{{ now.Unix }}{{ end }}" rel="icon" {{ .type | safeHTMLAttr }}>
|
||||
{{- end }}
|
||||
{{- $c:="" }}{{/*
|
||||
Warning: IE and old browser versions do not support media queries necessary for the light & dark theme option.
|
||||
If you have requirements to support IE and/or older browser versions, use one of the other options.
|
||||
Reference: https://caniuse.com/css-media-interaction
|
||||
*/}}
|
||||
{{- if (fileExists (printf "/static/images/%s-light.%s" $faviconName .ext)) }}
|
||||
{{- $faviconMatch = true }}
|
||||
<link href="{{ printf "images/%s-light.%s" $faviconName .ext | relURL }}{{ if $assetBusting }}?{{ now.Unix }}{{ end }}" rel="icon" {{ .type | safeHTMLAttr }} media="(prefers-color-scheme: light)">
|
||||
{{- end }}
|
||||
{{- if (fileExists (printf "/static/images/%s-dark.%s" $faviconName .ext)) }}
|
||||
{{- $faviconMatch = true }}
|
||||
<link href="{{ printf "images/%s-dark.%s" $faviconName .ext | relURL }}{{ if $assetBusting }}?{{ now.Unix }}{{ end }}" rel="icon" {{ .type | safeHTMLAttr }} media="(prefers-color-scheme: dark)">
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{- if $faviconMatch }}
|
||||
{{- break }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
@@ -0,0 +1 @@
|
||||
{{- return fileExists . }}
|
||||
13
themes/hugo-theme-relearn/layouts/partials/footer.html
Normal file
13
themes/hugo-theme-relearn/layouts/partials/footer.html
Normal file
@@ -0,0 +1,13 @@
|
||||
</div>
|
||||
</main><!-- #R-body-inner -->
|
||||
{{- partial "custom-comments.html" . }}
|
||||
</div><!-- #R-body -->
|
||||
{{- $outputFormat := partial "output-format.hugo" .Page }}
|
||||
{{- partial "output-partial.hugo" (dict "base" "menu" "page" . "parameter" . "outputFormat" $outputFormat) }}
|
||||
<script src="{{"js/clipboard.min.js" | relURL}}{{ if not .Site.Params.disableAssetsBusting }}?{{ now.Unix }}{{ end }}" defer></script>
|
||||
<script src="{{"js/perfect-scrollbar.min.js" | relURL}}{{ if not .Site.Params.disableAssetsBusting }}?{{ now.Unix }}{{ end }}" defer></script>
|
||||
{{- partial "dependencies.html" (dict "page" . "location" "footer" "outputFormat" $outputFormat) }}
|
||||
<script src="{{"js/theme.js" | relURL}}{{ if not .Site.Params.disableAssetsBusting }}?{{ now.Unix }}{{ end }}" defer></script>
|
||||
{{- partial "custom-footer.html" . }}
|
||||
</body>
|
||||
</html>
|
||||
44
themes/hugo-theme-relearn/layouts/partials/get-format.hugo
Normal file
44
themes/hugo-theme-relearn/layouts/partials/get-format.hugo
Normal file
@@ -0,0 +1,44 @@
|
||||
{{/*
|
||||
https://discourse.gohugo.io/t/question-about-printf-v/22923/4
|
||||
|
||||
GetCurrentOutput
|
||||
Retrieves the OuputFormat of the page, from a list of predefined outputs
|
||||
|
||||
@author @regisphilibert with modification by @McShelby
|
||||
|
||||
@context Page (.)
|
||||
|
||||
@access public
|
||||
|
||||
@return A String among the predefined list
|
||||
|
||||
@example - Go Template
|
||||
{{ $currentOutputFormat := partial "func/GetCurrentOutput" . }}
|
||||
|
||||
@warning This partial cannot be cached.
|
||||
*/}}
|
||||
|
||||
{{/* We create a slice listing the concerned output formats */}}
|
||||
{{- $outputs := slice }}
|
||||
{{- range .OutputFormats }}
|
||||
{{- $outputs = $outputs | append .Name }}
|
||||
{{- end }}
|
||||
{{- $alt := slice }}
|
||||
{{/* We range on the page's Alternative Output Formats which returns all output formats
|
||||
except the current one. */}}
|
||||
{{- range .AlternativeOutputFormats }}
|
||||
{{/* If an output format matches one in the concerned list, we add it to our slice of outputs */}}
|
||||
{{- if in $outputs .Name }}
|
||||
{{- $alt = $alt | append .Name }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{- $current := "default" }}
|
||||
{{/* If any alternate output formats part of the "concerned" ones have been found, we range on them. */}}
|
||||
{{- range $outputs }}
|
||||
{{/* If the output format is not listed as an "alternate", it means it is the current one. */}}
|
||||
{{- if not (in $alt .) }}
|
||||
{{- $current = . }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
|
||||
{{- return .OutputFormats.Get $current }}
|
||||
@@ -0,0 +1,9 @@
|
||||
{{- /* https://discourse.gohugo.io/t/how-to-know-the-section-depth/37302/4 */ -}}
|
||||
{{- $page := .page }}
|
||||
{{- $depth := .depth | default 0 }}
|
||||
{{- with $page.Parent }}
|
||||
{{- $depth = add $depth 1 }}
|
||||
{{- partial "get-page-depth.hugo" (dict "page" . "depth" $depth) }}
|
||||
{{- else }}
|
||||
{{- $depth }}
|
||||
{{- end }}
|
||||
@@ -0,0 +1,150 @@
|
||||
{{- $page := . }}
|
||||
{{- $mod := $page.Site.Params.themeVariantModifier | default "" }}
|
||||
{{- $autores := resources.Get "css/auto.css" }}
|
||||
{{- $printres := resources.Get "css/format-print.css" }}
|
||||
|
||||
{{- /*
|
||||
Config run:
|
||||
- convert from old forms to slice of dicts
|
||||
- convert auto property to slice
|
||||
- add name property
|
||||
*/}}
|
||||
{{- $refthemevariants := slice | append "relearn-light" | append "relearn-dark" }}
|
||||
{{- $tempthemevariants := slice | append (.Site.Params.themeVariant | default "auto" ) }}
|
||||
{{- $themevariants := slice }}
|
||||
{{- range $tempthemevariant := $tempthemevariants }}
|
||||
{{- $themevariant := $tempthemevariant }}
|
||||
{{- if not (reflect.IsMap $themevariant) }}
|
||||
{{- $themevariant = dict "identifier" $tempthemevariant }}
|
||||
{{- end }}
|
||||
{{- if not $themevariant.name }}
|
||||
{{- $themevariant = collections.Merge $themevariant (dict "name" ($themevariant.identifier | humanize | strings.Title)) }}
|
||||
{{- end }}
|
||||
{{- if eq $themevariant.identifier "auto" }}
|
||||
{{- $themevariant = collections.Merge $themevariant (dict "auto" ($themevariant.auto | default slice)) }}
|
||||
{{- $refthemevariants = $refthemevariants | append $themevariant.auto }}
|
||||
{{- end }}
|
||||
{{- $themevariant = collections.Merge $themevariant (dict "config" true) }}
|
||||
{{- $themevariants = $themevariants | append $themevariant }}
|
||||
{{- end }}
|
||||
|
||||
{{- /*
|
||||
Ref run:
|
||||
- add non-configured but referenced variants
|
||||
*/}}
|
||||
{{- range $refthemevariant := $refthemevariants }}
|
||||
{{- if not (index (collections.Where $themevariants "identifier" $refthemevariant) 0) }}
|
||||
{{- $themevariant := (dict "identifier" $refthemevariant "name" ($refthemevariant | humanize | strings.Title) "config" false) }}
|
||||
{{- $themevariants = $themevariants | append $themevariant }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
|
||||
{{- /*
|
||||
Non-auto run
|
||||
- fix and regenerate theme css for advanced config mode
|
||||
- add chroma property from stylesheet
|
||||
*/}}
|
||||
{{- $tempthemevariants = $themevariants }}
|
||||
{{- $themevariants = slice }}
|
||||
{{- range $tempthemevariant := $tempthemevariants }}
|
||||
{{- $themevariant := $tempthemevariant }}
|
||||
{{- if not (collections.IsSet $themevariant "auto") }}
|
||||
{{- $themevariant = partial "get-theme-details.html" (dict "themevariant" $themevariant "identifier" $themevariant.identifier "mod" $mod)}}
|
||||
{{- end }}
|
||||
{{- $themevariants = $themevariants | append $themevariant }}
|
||||
{{- end }}
|
||||
|
||||
{{- /*
|
||||
Auto run
|
||||
- fill up auto property
|
||||
- fill up chroma property
|
||||
- generate theme and chroma css files from template
|
||||
*/}}
|
||||
{{- $tempthemevariants = $themevariants }}
|
||||
{{- $themevariants = slice }}
|
||||
{{- range $tempthemevariant := $tempthemevariants }}
|
||||
{{- $themevariant := $tempthemevariant }}
|
||||
{{- if collections.IsSet $themevariant "auto" }}
|
||||
{{- $i := 0 }}
|
||||
{{- if eq (int (len $themevariant.auto)) 0 }}
|
||||
{{- range $tempthemevariants }}
|
||||
{{- $i = add $i 1 }}
|
||||
{{- if not (collections.IsSet . "auto") }}
|
||||
{{- $themevariant = collections.Merge $themevariant (dict "auto" ($themevariant.auto | append .identifier)) }}
|
||||
{{- break }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{- if eq (int (len $themevariant.auto)) 0 }}
|
||||
{{- $themevariant = collections.Merge $themevariant (dict "auto" ($themevariant.auto | append "relearn-light")) }}
|
||||
{{- end }}
|
||||
{{- if eq (int (len $themevariant.auto)) 1 }}
|
||||
{{- $poppedthemevariants := last (sub (len $tempthemevariants) $i) $tempthemevariants }}
|
||||
{{- range $poppedthemevariants }}
|
||||
{{- if not (collections.IsSet . "auto") }}
|
||||
{{- $themevariant = collections.Merge $themevariant (dict "auto" ($themevariant.auto | append .identifier)) }}
|
||||
{{- break }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{- if eq (int (len $themevariant.auto)) 1 }}
|
||||
{{- $themevariant = collections.Merge $themevariant (dict "auto" ($themevariant.auto | append "relearn-dark")) }}
|
||||
{{- end }}
|
||||
{{- $themevariant = collections.Merge $themevariant (dict "auto" ($themevariant.auto | first 2)) }}
|
||||
{{- $light := index $themevariant.auto 0 }};
|
||||
{{- $dark := index $themevariant.auto 1 }};
|
||||
{{- $cssres := $autores | resources.ExecuteAsTemplate (printf "css/theme-%s%s.css" $themevariant.identifier $mod) (dict "prefix" "theme" "suffix" $mod "light" $light "dark" $dark) }}
|
||||
{{- /* the following code causes Hugo to generate our css file - although it is in comments */}}<!-- {{ $cssres.RelPermalink }} -->
|
||||
{{- $themevariant = collections.Merge $themevariant (dict "chroma" $themevariant.identifier) }}
|
||||
{{- $light = (index (collections.Where $tempthemevariants "identifier" $light) 0).chroma }}
|
||||
{{- $dark = (index (collections.Where $tempthemevariants "identifier" $dark) 0).chroma }}
|
||||
{{- $cssres = $autores | resources.ExecuteAsTemplate (printf "css/chroma-%s.css" $themevariant.chroma) (dict "prefix" "chroma" "suffix" "" "light" $light "dark" $dark) }}
|
||||
{{- /* the following code causes Hugo to generate our css file - although it is in comments */}}<!-- {{ $cssres.RelPermalink }} -->
|
||||
{{- end }}
|
||||
{{- $themevariants = $themevariants | append $themevariant }}
|
||||
{{- end }}
|
||||
|
||||
{{- $cssres := $printres | resources.ExecuteAsTemplate "css/format-print.css" (dict "themevariant" (index (collections.Where $themevariants "identifier" "relearn-light") 0) "mod" $mod) }}
|
||||
{{- /* the following code causes Hugo to generate our css file - although it is in comments */}}<!-- {{ $cssres.RelPermalink }} -->
|
||||
|
||||
{{- return collections.Where $themevariants "config" true }}
|
||||
|
||||
{{ define "partials/get-theme-details.html" }}
|
||||
{{- $themevariant := .themevariant }}
|
||||
{{- $identifier := .identifier }}
|
||||
{{- $mod := .mod }}
|
||||
{{- $themecontent := "" }}
|
||||
{{- with resources.Get (printf "css/theme-%s.css" $identifier) }}
|
||||
{{- $themecontent = .Content}}
|
||||
{{- else }}
|
||||
{{- if fileExists (printf "static/css/theme-%s.css" $identifier) }}
|
||||
{{- $themecontent = readFile (printf "static/css/theme-%s.css" $identifier) }}
|
||||
{{- else }}
|
||||
{{- errorf "\"theme-%s.css\": file not found neither in \"static/css\" and \"assets/css\"" $identifier }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{- replaceRE (printf `([ \t]*@import\s+[^$]*?theme-[^.]*?)(?:%s)?(\.css)` (replace $mod "." "\\.")) (printf "${1}%s${2}" $mod) $themecontent }}
|
||||
{{- $chroma := "" }}
|
||||
{{- range findRESubmatch `[ \t]*--CODE-theme\s*:\s*([^;]*?)\s*;` $themecontent }}
|
||||
{{- $chroma = index . 1 }}
|
||||
{{- else }}
|
||||
{{- range findRESubmatch `[ \t]*@import\s+[^$]*?chroma-([^.]*?)\.css` $themecontent }}
|
||||
{{- $chroma = index . 1 }}
|
||||
{{- warnf "\"theme-%s.css\": DEPRECATED use of @import for chroma stylesheet, instead use '--CODE-theme: %s;'" $identifier $chroma }}
|
||||
{{- $themecontent = replaceRE `[ \t]*@import\s+[^$]*?chroma-[^.]*?\.css.*?\n` "" $themecontent }}
|
||||
{{- else }}
|
||||
{{- range findRESubmatch (printf `[ \t]*@import\s+[^$]*?theme-([^.]*?)%s\.css` (replace $mod "." "\\.")) $themecontent }}
|
||||
{{- $subidentifier := index . 1 }}
|
||||
{{- $themevariant = partial "get-theme-details.html" (dict "themevariant" $themevariant "identifier" $subidentifier "mod" $mod) }}
|
||||
{{- $chroma = $themevariant.chroma }}
|
||||
{{- else }}
|
||||
{{- $chroma = "relearn-light" }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{- $themecontent = replaceRE `(:root\s*\{[ \t]*)(\s*)` (printf "${1}${2}--CODE-theme: %s;${2}" $chroma) $themecontent }}
|
||||
{{- end }}
|
||||
{{- $themevariant = collections.Merge $themevariant (dict "chroma" $chroma) }}
|
||||
{{- $cssres := $themecontent | resources.FromString (printf "css/theme-%s%s.css" $identifier $mod) }}
|
||||
{{- /* the following code causes Hugo to generate our css file - although it is in comments */}}<!-- {{ $cssres.RelPermalink }} -->
|
||||
{{- return $themevariant }}
|
||||
{{- end }}
|
||||
100
themes/hugo-theme-relearn/layouts/partials/header.html
Normal file
100
themes/hugo-theme-relearn/layouts/partials/header.html
Normal file
@@ -0,0 +1,100 @@
|
||||
<!DOCTYPE html>
|
||||
{{- $format := partial "get-format.hugo" . }}
|
||||
{{- $outputFormat := partial "output-format.hugo" (dict "page" . "format" $format) }}
|
||||
{{- $basename := "index" }}
|
||||
{{- if eq $outputFormat "searchpage" }}
|
||||
{{- $basename = partial "BaseName.hugo" $format.RelPermalink }}
|
||||
{{- end }}
|
||||
{{- if eq . .Site.Sites.First.Home }}
|
||||
{{- $hugoVersion := "0.112.4" }}
|
||||
{{- if lt hugo.Version $hugoVersion }}
|
||||
{{- errorf "The Relearn theme requires Hugo %s or later" $hugoVersion }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
<html lang="{{ .Page.Language.LanguageCode | default "en" }}" dir="{{ .Page.Language.LanguageDirection | default (T "Reading-direction") | default "ltr" }}">
|
||||
<head>
|
||||
{{- partial "meta.html" . }}
|
||||
{{- $page := . }}
|
||||
{{- $link := "<link href=\"%s\" rel=\"%s\" type=\"%s\" title=\"%s\">" }}
|
||||
{{- $title := .Title }}
|
||||
{{- if eq $outputFormat "searchpage" }}
|
||||
{{- $title = T "Search" }}
|
||||
{{- else if eq .Kind "taxonomy" }}
|
||||
{{- $title = default (default .Data.Plural (i18n .Data.Plural)) .Params.Title }}
|
||||
{{- else if eq .Kind "term" }}
|
||||
{{- $taxonomy_page := .Site.GetPage .Data.Plural }}
|
||||
{{- $title = default (default .Data.Singular (i18n .Data.Singular)) $taxonomy_page.Params.SingularTitle }}
|
||||
{{- $title = printf "%s %s %s" (default (humanize .Data.Term | strings.Title) .Title) (default "::" .Site.Params.titleSeparator) $title }}
|
||||
{{- end }}
|
||||
{{- if and $title .Site.Title (not (eq $title .Site.Title)) }}
|
||||
{{- $title = printf "%s %s %s" $title (default "::" .Site.Params.titleSeparator) .Site.Title }}
|
||||
{{- end }}
|
||||
{{- if .Params.menuTitle }}
|
||||
{{- warnf "%q: DEPRECATED frontmatter 'menutitle' found, use 'linktitle' instead" $page.File.Filename }}
|
||||
{{- end }}
|
||||
<title>{{ $title }}</title>
|
||||
|
||||
{{- if .IsTranslated -}}
|
||||
{{- range $index, $trans := .AllTranslations }}
|
||||
{{- if eq $index 0 }}
|
||||
<link href="{{ partial "relLangPrettyUglyURL.hugo" (dict "to" . "abs" true "basename" $basename) }}" rel="alternate" hreflang="x-default">
|
||||
{{- end }}
|
||||
<link href="{{ partial "relLangPrettyUglyURL.hugo" (dict "to" . "abs" true "basename" $basename) }}" rel="alternate" hreflang="{{ .Language.LanguageCode }}">
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
|
||||
{{- if not (and .Title (or (ne (.Scratch.Get "relearnIsHiddenStem") true) (ne .Site.Params.disableSeoHiddenPages true) ) ) }}
|
||||
{{- else }}
|
||||
{{- range .AlternativeOutputFormats }}
|
||||
{{- if eq .Rel "canonical" }}
|
||||
{{ (printf $link (partial "relLangPrettyUglyURL.hugo" (dict "to" . "abs" true "basename" $basename)) .Rel .MediaType.Type ($title | htmlEscape)) | safeHTML }}
|
||||
{{- else if eq $outputFormat "searchpage" }}
|
||||
{{- else if eq .Name "searchpage" }}
|
||||
{{- else if and (ne .Name "json") (ne .Name "search") }}
|
||||
{{ (printf $link (partial "relLangPrettyUglyURL.hugo" (dict "to" .)) .Rel .MediaType.Type ($title | htmlEscape)) | safeHTML }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
|
||||
{{- if and (ne .Site.Params.disableSeoHiddenPages true) (ne .Site.Params.disableSearchHiddenPages true) }}
|
||||
{{- range .AlternativeOutputFormats }}
|
||||
{{- if eq .Name "searchpage" }}
|
||||
{{- else if eq .Name "json" }}
|
||||
{{ (printf $link (.Permalink | relURL) .Rel .MediaType.Type ($title | htmlEscape)) | safeHTML }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
|
||||
{{- partialCached "favicon.html" . }}
|
||||
{{- partial "stylesheet.html" (dict "page" . "outputFormat" $outputFormat) }}
|
||||
{{- partial "dependencies.html" (dict "page" . "location" "header" "outputFormat" $outputFormat) }}
|
||||
{{- 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" .) }}">
|
||||
<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">
|
||||
{{ .Title }}
|
||||
</span>
|
||||
{{- end }}
|
||||
<div class="topbar-area topbar-area-end" data-area="end">
|
||||
{{- partial "topbar/area/end.html" . }}
|
||||
</div>
|
||||
</div>
|
||||
</nav>
|
||||
{{- $hook := "styleclass" }}
|
||||
<div id="R-main-overlay"></div>
|
||||
<main id="R-body-inner" class="highlightable {{ partialCached "archetype.hugo" (dict "hook" $hook "page" . "parameter" . "outputFormat" $outputFormat) .RelPermalink $outputFormat $hook }}" tabindex="-1">
|
||||
<div class="flex-block-wrapper">
|
||||
@@ -0,0 +1 @@
|
||||
{{ .Params.headingPost | safeHTML }}
|
||||
@@ -0,0 +1 @@
|
||||
{{ .Params.headingPre | safeHTML }}
|
||||
1
themes/hugo-theme-relearn/layouts/partials/heading.html
Normal file
1
themes/hugo-theme-relearn/layouts/partials/heading.html
Normal file
@@ -0,0 +1 @@
|
||||
<h1 id="{{ .Title | plainify | anchorize }}">{{ .Title }}</h1>
|
||||
3
themes/hugo-theme-relearn/layouts/partials/indent.html
Normal file
3
themes/hugo-theme-relearn/layouts/partials/indent.html
Normal file
@@ -0,0 +1,3 @@
|
||||
{{- $content := .content }}
|
||||
{{- $indention := .indention }}
|
||||
{{- replaceRE "(\\r\\n|\\r|\\n)" (printf "$1%s" $indention) (replaceRE "^" $indention (trim $content " \n\r\t")) | safeHTML }}
|
||||
6
themes/hugo-theme-relearn/layouts/partials/initial.html
Normal file
6
themes/hugo-theme-relearn/layouts/partials/initial.html
Normal file
@@ -0,0 +1,6 @@
|
||||
{{- if not .Title }}
|
||||
{{- $title := .Site.Title }}
|
||||
<h1 id="{{ $title | plainify | anchorize }}">{{ $title }}</h1>
|
||||
{{- end }}
|
||||
|
||||
{{- "layouts/partials/initial.md" | readFile | .RenderString }}
|
||||
9
themes/hugo-theme-relearn/layouts/partials/initial.md
Normal file
9
themes/hugo-theme-relearn/layouts/partials/initial.md
Normal file
@@ -0,0 +1,9 @@
|
||||
## Create this Page
|
||||
|
||||
You need to create a file for this page. You can either
|
||||
|
||||
- create a file in the `content` folder and fill it with Markdown content
|
||||
- inside a folder named by the page's title like `<TITLE>/_index.md` or `<TITLE>/index.md`
|
||||
- named by the page's title like `<TITLE>.md`
|
||||
- create a file in the `static` folder and fill it with HTML content
|
||||
- inside a folder named by the page's title like `<TITLE>/index.html`
|
||||
68
themes/hugo-theme-relearn/layouts/partials/logo.html
Normal file
68
themes/hugo-theme-relearn/layouts/partials/logo.html
Normal file
@@ -0,0 +1,68 @@
|
||||
<style>
|
||||
#R-logo svg,
|
||||
#R-logo svg * {
|
||||
color: #282828;
|
||||
color: var(--MENU-SECTIONS-BG-color);
|
||||
fill: #282828 !important;
|
||||
fill: var(--MENU-SECTIONS-BG-color) !important;
|
||||
opacity: .945;
|
||||
}
|
||||
a#R-logo {
|
||||
color: #282828;
|
||||
color: var(--MENU-SECTIONS-BG-color);
|
||||
font-family: 'Work Sans', 'Helvetica', 'Tahoma', 'Geneva', 'Arial', sans-serif;
|
||||
font-size: 1.875rem;
|
||||
font-weight: 300;
|
||||
margin-top: -.8125rem;
|
||||
max-width: 60%;
|
||||
text-transform: uppercase;
|
||||
width: 14.125rem;
|
||||
white-space: nowrap;
|
||||
}
|
||||
a#R-logo:hover {
|
||||
color: #282828;
|
||||
color: var(--MENU-SECTIONS-BG-color);
|
||||
}
|
||||
#R-logo svg {
|
||||
margin-bottom: -1.25rem;
|
||||
margin-inline-start: -1.47rem;
|
||||
margin-inline-end: .5rem;
|
||||
width: 40.5%;
|
||||
}
|
||||
@media only all and (max-width: 59.999rem) {
|
||||
a#R-logo {
|
||||
font-size: 1.5625rem;
|
||||
margin-top: -.1875rem;
|
||||
}
|
||||
#R-logo svg {
|
||||
margin-bottom: -.75rem;
|
||||
margin-inline-start: -1.47rem;
|
||||
margin-inline-end: .5rem;
|
||||
}
|
||||
}
|
||||
@media all and (-ms-high-contrast:none) {
|
||||
{{ "/* IE11s understanding of positioning is weird at best */" | safeCSS }}
|
||||
a#R-logo {
|
||||
margin-top: -3.625rem;
|
||||
}
|
||||
#R-logo svg {
|
||||
margin-bottom: -3.875rem;
|
||||
margin-left: -1.47rem;
|
||||
margin-right: .5rem;
|
||||
}
|
||||
}
|
||||
@media only all and (-ms-high-contrast:none) and (max-width: 59.999rem) {
|
||||
#R-logo svg {
|
||||
margin-left: -1.47rem;
|
||||
margin-right: .5rem;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
<a id="R-logo" href="{{ partial "relLangPrettyUglyURL.hugo" (dict "to" .Site.Home) }}">
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 64.044 64.044">
|
||||
<path d="M46.103 136.34c-.642-.394-1.222-2.242-1.98-2.358-.76-.117-1.353.506-1.618 1.519-.266 1.012-.446 4.188.173 5.538.213.435.482.787 1.03.845.547.057.967-.504 1.45-1.027.482-.523.437-.9 1.142-.612.705.289 1.051.4 1.586 1.229.535.828 1.085 4.043.868 5.598-.241 1.458-.531 2.8-.59 4.088.26.075.517.148.772.217 2.68.724 5.373 1.037 7.873.02.001-.028.01-.105.008-.11-.048-.165-.18-.41-.36-.698-.18-.29-.414-.645-.586-1.114a3.212 3.212 0 0 1-.125-1.735c.056-.21.153-.342.249-.475 1.237-1.193 2.932-1.373 4.244-1.384.557-.004 1.389.016 2.198.255.809.239 1.706.724 2.068 1.843.187.578.114 1.17-.043 1.623-.153.438-.369.783-.545 1.091-.178.31-.329.6-.401.821-.007.02-.003.071-.005.094 2.256 1.008 4.716.91 7.189.398.55-.114 1.11-.247 1.673-.377.344-1.085.678-2.145.852-3.208.124-.752.158-2.311-.078-3.538-.118-.613-.306-1.15-.52-1.489-.221-.349-.413-.501-.747-.538-.243-.027-.51.013-.796.098-.67.223-1.33.606-1.966.76l-.008.002-.109.032c-.556.152-1.233.158-1.797-.36-.556-.51-.89-1.367-1.117-2.596-.283-1.528-.075-3.279.89-4.518l.071-.09h.07c.65-.71 1.485-.802 2.16-.599.706.213 1.333.629 1.772.84.736.354 1.185.319 1.475.171.291-.148.5-.439.668-.955.332-1.017.301-2.819.022-4.106-.148-.684-.13-1.292-.13-1.883-1.558-.463-3.067-.982-4.574-1.208-1.128-.169-2.263-.173-3.298.164-.13.046-.256.095-.38.15-.373.164-.633.342-.805.52-.077.098-.081.105-.087.21-.004.068.031.289.13.571.1.282.256.634.467 1.03.279.524.448 1.063.431 1.618a2.12 2.12 0 0 1-.499 1.309 1.757 1.757 0 0 1-.62.51h-.002c-.515.291-1.107.404-1.723.464-.86.083-1.787.026-2.598-.097-.806-.123-1.47-.28-1.948-.555-.444-.256-.79-.547-1.037-.925a2.273 2.273 0 0 1-.356-1.301c.029-.837.403-1.437.625-1.897.111-.23.191-.433.236-.583.045-.15.044-.25.046-.24-.005-.029-.127-.355-1.015-.741-1.138-.495-2.322-.673-3.533-.668h-.015a9.711 9.711 0 0 0-.521.016h-.002c-1.163.057-2.35.308-3.541.569.383 1.531.79 2.753.818 4.502-.096 1.297.158 2.114-1.03 2.935-.85.588-1.508.729-2.15.335" style="fill:#282828;fill-opacity:1;stroke:none;stroke-width:1.03763;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" transform="translate(-40.698 -95.175)"/>
|
||||
<path d="M61.472 101.34v.002c-.3-.003-.603.01-.894.04-.544.055-1.39.165-1.778.306-1.238.364.13 2.344.41 2.913.28.569.285 2.03.14 2.134-.144.103-.375.261-.934.345-.56.084.03-.037-1.589.086-1.62.122-5.506.29-8.265.248-.022.26-.036.521-.097.808-.309 1.442-.63 3.163-.494 4.074.071.473.168.65.414.8.23.14.737.235 1.62-.004.834-.227 1.3-.442 1.887-.456.595-.016 1.555.472 1.965.717.411.245-.03-.008.002 0s.128.05.176.102c.049.053-.276-.523.104.199.379.721.72 3.256.002 4.68-.46.913-1.01 1.49-1.64 1.711-.63.22-1.229.067-1.734-.135-.881-.353-1.584-.7-2.205-.647-1.199 1.94-1.186 4.17-.6 6.602.097.397.212.814.327 1.23 2.68-.556 5.542-1.016 8.337.132 1.064.437 1.73 1.015 1.902 1.857.169.831-.193 1.508-.438 1.986-.122.238-.23.46-.307.642-.07.164-.096.28-.104.324.069.429.309.723.686.945.385.227.89.355 1.35.423.723.104 1.567.152 2.287.086.693-.064 1.032-.338 1.241-.544a2.447 2.447 0 0 0 .303-.437.175.175 0 0 0 .013-.035c-.004-.066-.037-.246-.195-.527-.46-.816-.87-1.595-.817-2.51.028-.476.218-.938.529-1.288.304-.343.698-.586 1.186-.79 1.442-.606 2.96-.609 4.372-.409 1.525.216 2.963.679 4.378 1.083.226-2.09.784-3.9.592-5.77-.058-.565-.287-1.333-.598-1.827-.32-.508-.59-.717-1.036-.642-.648.11-1.472.935-2.707 1.078-.791.092-1.494-.267-1.95-.86-.45-.583-.678-1.335-.78-2.101-.202-1.525.031-3.229.89-4.27.615-.747 1.45-.887 2.15-.74.687.145 1.307.492 1.857.745v-.002c.546.252 1.033.388 1.281.344a.547.547 0 0 0 .353-.188c.113-.124.242-.35.384-.75.604-1.712.206-3.68-.303-5.654-.667.145-1.336.293-2.018.413-1.341.236-2.73.392-4.136.273-.656-.055-1.695-.085-2.58-.476-.442-.195-.903-.514-1.157-1.093-.259-.591-.205-1.313.08-2.014.223-.64 1.082-2.178.692-2.585-.391-.407-1.651-.56-2.554-.571z" style="fill:#282828;fill-opacity:1;stroke:none;stroke-width:.992837;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" transform="translate(-40.698 -95.175)"/>
|
||||
<path d="M83.128 98.116c-.484 1.875-1.057 3.757-2.486 5.033-.638.57-1.13.666-1.483.548-.401-.134-.715-.506-1.058-.973-.338-.461-.655-.97-1.076-1.332-.192-.165-.404-.315-.683-.38-.279-.066-.599-.02-.9.102-.489.196-.89.58-1.28 1.047a6.1 6.1 0 0 0-.985 1.632c-.234.591-.356 1.174-.277 1.713.072.487.392.977.905 1.185.463.187.926.156 1.36.154.433 0 .843.01 1.242.147.55.189.79.736.822 1.368.034.66-.145 1.412-.393 1.988l-.008.021c-.74 1.705-1.946 2.893-3.004 4.349l-.664.915.979.099c.924.092 1.788.26 2.468.675.46.281 1.806 1.205 2.794 2.222.497.513.888 1.031 1.047 1.502.078.231.095.422.05.6a.93.93 0 0 1-.345.474c-.301.223-.606.395-.864.532l-.354.186c-.107.058-.189.087-.345.228a.637.637 0 0 1 .062-.045l-.064.041-.209.236-.103.343s.003.126.007.152c.003.017.003.007.004.015v.002c.016.195.061.307.133.476a4.1 4.1 0 0 0 .32.596 5.7 5.7 0 0 0 2.8 2.258c.284.108.908.321 1.548.36.33.02.59.015.912-.13h.002c.08-.037.228-.095.382-.281.153-.186.19-.355.212-.445l.019-.075.003-.078c.023-.585-.037-1.296.072-1.899.153-.657.435-.956 1.009-.909 2.771.239 4.74 1.955 6.693 3.83l.742.714.279-1.155c.55-2.29 1.093-4.464 2.928-5.977.692-.57 1.184-.642 1.527-.509.39.151.676.536.996.995.319.458.605.926 1.07 1.212.194.119.464.232.784.209.32-.024.638-.163.988-.384 1.022-.645 1.778-1.756 2.086-2.942.136-.522.102-.991-.046-1.301-.158-.334-.433-.553-.754-.707-.653-.314-1.468-.373-2.094-.486-.825-.15-1.22-.475-1.345-.878-.13-.417 0-.953.335-1.61.6-1.173 1.887-2.602 3.13-3.911l.498-.526-.449-.432c-1.545-1.49-3.163-3.01-5.252-3.715h-.002c-.473-.16-1.097-.413-1.73-.424h-.003c-.311-.004-.596.04-.883.24v.002c-.22.155-.483.537-.583.937l-.008.036-.006.038c-.116.773-.06 1.467-.217 1.995-.063.212-.198.418-.359.507-.202.111-.492.153-.976.072-.582-.097-1.978-.69-3.021-1.503-.523-.407-.934-.85-1.117-1.3a1.153 1.153 0 0 1-.083-.63c.03-.184.1-.477.308-.593.21-.116.941-.32 1.377-.642h.002c.192-.141.403-.367.518-.64.114-.275.127-.526.123-.774-.006-.142-.036-.192-.08-.3a8.417 8.417 0 0 0-3-3.027c-1.226-.725-2.585-1.135-3.927-1.539-.434-.12-.844-.111-1.02.466zm.912.947c1.186.364 2.357.718 3.345 1.303 1.035.612 1.864 1.488 2.507 2.528-.514.263-1.095.5-1.44.79-.345.29-.729.914-.815 1.434-.084.509 0 .968.155 1.347.301.74.85 1.276 1.44 1.735 1.18.92 2.554 1.545 3.47 1.698.604.1 1.186.088 1.739-.216.594-.327.935-.911 1.088-1.427.264-.884.193-1.664.262-2.17h.1c.3.006.926.206 1.417.371 1.646.554 3.044 1.773 4.431 3.089-1.102 1.174-2.222 2.423-2.888 3.73-.42.823-.73 1.789-.453 2.687.283.913 1.1 1.415 2.138 1.603.691.126 1.472.226 1.84.403.19.091.258.182.278.223.03.064.058.075-.023.387-.21.804-.761 1.598-1.413 2.01-.247.155-.365.183-.407.187-.042.003-.061.002-.172-.066-.144-.088-.455-.473-.772-.929-.317-.454-.714-1.07-1.452-1.356-.783-.304-1.776-.022-2.713.75-1.942 1.6-2.626 3.764-3.146 5.8-1.802-1.676-3.772-3.138-6.589-3.517h-.002c-.346-.095-1.013-.031-1.293.143-.735.501-1.005 1.132-1.168 2.007-.125.69-.082 1.216-.074 1.659-.055.006-.046.01-.104.006-.42-.026-1.035-.215-1.244-.295-.947-.361-1.774-1.006-2.314-1.857-.054-.085-.072-.132-.109-.2l.027-.016c.284-.15.656-.36 1.045-.648.44-.327.789-.798.93-1.35a2.4 2.4 0 0 0-.068-1.379c-.254-.751-.753-1.353-1.295-1.911-1.09-1.124-2.452-2.049-2.99-2.378-.609-.372-1.303-.44-1.981-.56.875-1.094 1.878-2.251 2.596-3.921.294-.823.543-1.907.513-2.658-.049-.97-.489-2.013-1.52-2.367-.579-.2-1.131-.204-1.58-.203-.45.002-.786-.006-.97-.08h-.002c-.264-.107-.236-.108-.268-.33-.025-.17.021-.553.183-.962a4.67 4.67 0 0 1 .725-1.192c.29-.348.617-.59.705-.626.142-.057.176-.05.22-.04.045.011.127.052.263.17.235.201.56.671.92 1.161.354.484.791 1.08 1.543 1.33.8.267 1.784-.052 2.671-.846 1.594-1.424 2.235-3.317 2.714-5.051zm11.705 7.023c-.02.014.042-.002.042 0l-.008.035c.05-.2-.028-.04-.034-.035zM79.472 122.45a.198.198 0 0 1 .005.023v.014c-.002-.01-.003-.03-.005-.037zm-.29.732-.006.01-.044.027c.016-.01.033-.024.05-.036z" style="color:#000;fill:#282828;stroke-width:1.02352;-inkscape-stroke:none" transform="translate(-40.698 -95.175)"/>
|
||||
<path d="M76.694 128.845c-.85-.012-1.668.253-2.434.67-.01.592-.015 1.17.109 1.772.323 1.573.422 3.553-.07 5.147-.247.804-.684 1.535-1.347 1.891-.663.356-1.467.296-2.362-.159-.522-.266-1.059-.62-1.487-.757-.223-.072-.392-.096-.522-.069-.13.027-.232.094-.362.27-.53.719-.681 1.823-.497 2.876.177 1.012.418 1.438.543 1.56.143.137.26.154.604.055.548-.158 1.523-.857 2.573-.972l.02-.002.5.058c.686.081 1.247.562 1.622 1.19.372.62.591 1.37.73 2.136.279 1.532.25 3.16.083 4.232-.14.91-.394 1.72-.632 2.53 1.719-.385 3.485-.692 5.307-.36 1.174.214 2.749.574 3.762 1.977l.088.122.046.159c.162.551.16 1.114.024 1.578-.13.45-.348.772-.533 1.023-.181.246-.336.444-.437.606-.102.16-.141.275-.145.336-.01.17 0 .197.07.315.057.1.186.242.39.366.408.246 1.106.414 1.843.45a7.842 7.842 0 0 0 2.174-.21 4.28 4.28 0 0 0 .822-.296c.218-.106.385-.242.377-.233l.029-.031c.025-.035.05-.072.05-.068 0-.004 0-.017-.003-.05a2.733 2.733 0 0 0-.21-.579c-.26-.548-.839-1.333-.822-2.46.01-.657.27-1.21.598-1.576.32-.357.696-.575 1.074-.736.759-.323 1.57-.418 2.054-.458 1.653-.136 3.252.296 4.755.765.457.142.905.29 1.352.434.325-2.258.902-4.247.598-6.217-.071-.46-.25-1.169-.486-1.684-.238-.518-.495-.762-.675-.779-.351-.032-.716.14-1.174.418-.457.277-1.005.665-1.695.742-.745.082-1.406-.291-1.84-.908-.428-.608-.653-1.394-.754-2.196-.203-1.596.016-3.377.794-4.493.568-.813 1.358-.984 2.024-.835.65.146 1.243.51 1.769.779.524.267.99.413 1.237.365a.527.527 0 0 0 .346-.2c.11-.132.235-.373.37-.798.612-1.918.27-3.894-.246-6.054-2.815-.851-5.49-1.534-8.089-.267a.727.727 0 0 0-.223.148c-.024.028-.018.021-.026.056.001-.003-.01.178.07.44.162.522.611 1.29.911 1.978l.004.009.029.063.024.084V133c.162.635.016 1.297-.274 1.727-.272.404-.618.636-.952.81-.675.353-1.399.484-1.724.533a5.888 5.888 0 0 1-3.973-.795c-.512-.311-.876-.594-1.133-1.02-.282-.466-.318-1.084-.172-1.557.252-.814.715-1.266.971-1.89a.663.663 0 0 0 .047-.14c.001-.013 0-.006-.007-.037a.761.761 0 0 0-.184-.268c-.264-.267-.865-.595-1.54-.826-1.356-.462-3.07-.659-3.583-.686-.062-.002-.121-.006-.178-.006z" style="fill:#282828;fill-opacity:1;stroke:none;stroke-width:.991342;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" transform="translate(-40.698 -95.175)"/>
|
||||
</svg>Relearn
|
||||
</a>
|
||||
@@ -0,0 +1,13 @@
|
||||
{{- $page := . }}
|
||||
{{- if (ne $page.Site.Params.disableRandomIds true) }}
|
||||
{{- $random := "" }}
|
||||
{{- $set := split "012345abcdefghijklmnopqrstuvwxyz" "" }}
|
||||
{{- range (seq 16) }}
|
||||
{{- with ($set | shuffle | first 1) }}
|
||||
{{- $random = printf "%s%s" $random . }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{- md5 $random }}
|
||||
{{- else }}
|
||||
{{- printf "00000000000000000000000000000000" }}
|
||||
{{- end }}
|
||||
@@ -0,0 +1,2 @@
|
||||
|
||||
<p>Built with <a href="https://github.com/McShelby/hugo-theme-relearn" title="love"><i class="fas fa-heart"></i></a> by <a href="https://gohugo.io/">Hugo</a></p>
|
||||
@@ -0,0 +1 @@
|
||||
{{ if .Params.menuPost }}{{ .Params.menuPost | safeHTML }}{{ else }}{{ .Params.Post | safeHTML }}{{ end }}
|
||||
1
themes/hugo-theme-relearn/layouts/partials/menu-pre.html
Normal file
1
themes/hugo-theme-relearn/layouts/partials/menu-pre.html
Normal file
@@ -0,0 +1 @@
|
||||
{{ if .Params.menuPre }}{{ .Params.menuPre | safeHTML }}{{ else }}{{ .Params.Pre | safeHTML }}{{ end }}
|
||||
170
themes/hugo-theme-relearn/layouts/partials/menu.html
Normal file
170
themes/hugo-theme-relearn/layouts/partials/menu.html
Normal file
@@ -0,0 +1,170 @@
|
||||
|
||||
{{- $showvisitedlinks := .Site.Params.showVisitedLinks }}
|
||||
{{- $format := partial "get-format.hugo" . }}
|
||||
{{- $outputFormat := partial "output-format.hugo" (dict "page" . "format" $format) }}
|
||||
{{- $basename := "index" }}
|
||||
{{- if eq $outputFormat "searchpage" }}
|
||||
{{- $basename = partial "BaseName.hugo" $format.RelPermalink }}
|
||||
{{- end }}
|
||||
<aside id="R-sidebar" class="default-animation{{ if $showvisitedlinks }} showVisitedLinks{{ end }}">
|
||||
{{- $currentNode := . }}
|
||||
<div id="R-header-topbar" class="default-animation"></div>
|
||||
<div id="R-header-wrapper" class="default-animation">
|
||||
<div id="R-header" class="default-animation">
|
||||
{{ partial "logo.html" . }}
|
||||
</div>
|
||||
{{- if not .Site.Params.disableSearch }}
|
||||
{{ partial "search.html" . }}
|
||||
{{- end }}
|
||||
</div>
|
||||
<div id="R-homelinks" class="default-animation{{ if not .Site.Params.disableLandingPageButton }} homelinks{{ end }}">
|
||||
{{- if not .Site.Params.disableLandingPageButton }}
|
||||
{{- if (ne .Site.Params.landingPageURL nil) }}
|
||||
{{- warnf "%q: UNSUPPORTED usage of 'landingPageURL' config parameter found, remove it and optionally overwrite the `logo.html` partial to provide a link if it should not point to the project's home page; see https://mcshelby.github.io/hugo-theme-relearn/basics/migration#420" .File.Filename }}
|
||||
{{- end }}
|
||||
<ul>
|
||||
<li><a class="padding" href="{{ partial "relLangPrettyUglyURL.hugo" (dict "to" .Site.Home) }}">{{ .Site.Params.landingPageName | default `<i class="fa-fw fas fa-home"></i> Home` | safeHTML }}</a></li>
|
||||
</ul>
|
||||
{{- end }}
|
||||
<hr class="padding">
|
||||
</div>
|
||||
<div id="R-content-wrapper" class="highlightable">
|
||||
<div id="R-topics">
|
||||
<ul class="enlarge morespace collapsible-menu">
|
||||
{{- $pages := partial "pageHelper/pagesBy.html" (dict "page" .Site.Home "hidden" true) }}
|
||||
{{- $defaultAlwaysopen := .Site.Params.alwaysopen | default false }}
|
||||
{{- range $pages }}
|
||||
{{- template "section-tree-nav" dict "sect" . "currentnode" $currentNode "showvisitedlinks" $showvisitedlinks "alwaysopen" $defaultAlwaysopen }}
|
||||
{{- end }}
|
||||
</ul>
|
||||
</div>
|
||||
{{- $page := . }}
|
||||
{{- $disableShortcutsTitle := .Site.Params.DisableShortcutsTitle }}
|
||||
{{- with .Site.Menus.shortcuts }}
|
||||
<div id="R-shortcuts">
|
||||
<div class="nav-title padding">{{ if not $disableShortcutsTitle }}{{ T "Shortcuts-Title" }}{{ end }}</div>
|
||||
<ul class="space">
|
||||
{{- range sort . "Weight" }}
|
||||
{{- $shortcut := . }}
|
||||
{{- with $page.Site.GetPage (printf "%s" $shortcut.URL ) }}
|
||||
{{- $to := . }}
|
||||
<li>{{ $shortcut.Pre }}<a class="padding" href="{{ partial "relLangPrettyUglyURL.hugo" (dict "to" $to) }}">{{ safeHTML $shortcut.Name }}</a>{{ $shortcut.Post }}</li>
|
||||
{{- else }}
|
||||
<li>{{ $shortcut.Pre }}<a class="padding" href="{{ $shortcut.URL | relLangURL }}">{{ safeHTML $shortcut.Name }}</a>{{ $shortcut.Post }}</li>
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
</ul>
|
||||
</div>
|
||||
{{- end }}
|
||||
{{- $siteLanguages := .Site.Languages }}
|
||||
{{- $showlangswitch := and .Site.IsMultiLingual (not .Site.Params.disableLanguageSwitchingButton) (gt (int (len $siteLanguages)) 1) }}
|
||||
{{- $themevariants := partialCached "get-theme-variants.hugo" . }}
|
||||
{{- $showvariantswitch := gt (int (len $themevariants)) 1 }}
|
||||
{{- $footer := partial "menu-footer.html" . }}
|
||||
{{- $showfooter := not (eq 0 (int (len ($footer | plainify)))) }}
|
||||
<div class="padding footermargin footerLangSwitch footerVariantSwitch footerVisitedLinks footerFooter{{if $showlangswitch}} showLangSwitch{{end}}{{if $showvariantswitch}} showVariantSwitch{{end}}{{if $showvisitedlinks}} showVisitedLinks{{end}}{{if $showfooter}} showFooter{{end}}"></div>
|
||||
<div id="R-menu-footer">
|
||||
<hr class="padding default-animation footerLangSwitch footerVariantSwitch footerVisitedLinks footerFooter{{if $showlangswitch}} showLangSwitch{{end}}{{if $showvariantswitch}} showVariantSwitch{{end}}{{if $showvisitedlinks}} showVisitedLinks{{end}}{{if $showfooter}} showFooter{{end}}">
|
||||
<div id="R-prefooter" class="footerLangSwitch footerVariantSwitch footerVisitedLinks{{if $showlangswitch}} showLangSwitch{{end}}{{if $showvariantswitch}} showVariantSwitch{{end}}{{if $showvisitedlinks}} showVisitedLinks{{end}}">
|
||||
<ul>
|
||||
<li id="R-select-language-container" class="footerLangSwitch{{if $showlangswitch}} showLangSwitch{{end}}">
|
||||
<div class="padding menu-control">
|
||||
<i class="fa-fw fas fa-language"></i>
|
||||
<span> </span>
|
||||
<div class="control-style">
|
||||
<label class="a11y-only" for="R-select-language">{{ T "Language" }}</label>
|
||||
<select id="R-select-language" onchange="location = this.querySelector( this.value ).dataset.url;">
|
||||
{{- $page := .Page }}
|
||||
{{- $pageLang := .Page.Language.Lang }}
|
||||
{{- range .Page.AllTranslations }}
|
||||
<option id="R-select-language-{{ .Language.Lang }}" value="#R-select-language-{{ .Language.Lang }}" data-url="{{ partial "relLangPrettyUglyURL.hugo" (dict "to" . "basename" $basename) }}" lang="{{ .Language.LanguageCode }}"{{ if eq $pageLang .Language.Lang }} selected{{ end }}>{{ .Language.LanguageName }}</option>
|
||||
{{- end }}
|
||||
</select>
|
||||
</div>
|
||||
<div class="clear"></div>
|
||||
</div>
|
||||
</li>
|
||||
<li id="R-select-variant-container" class="footerVariantSwitch{{if $showvariantswitch}} showVariantSwitch{{end}}">
|
||||
<div class="padding menu-control">
|
||||
<i class="fa-fw fas fa-paint-brush"></i>
|
||||
<span> </span>
|
||||
<div class="control-style">
|
||||
<label class="a11y-only" for="R-select-variant">{{ T "Theme" }}</label>
|
||||
<select id="R-select-variant" onchange="window.variants && variants.changeVariant( this.value );">
|
||||
{{- $firstvariant := true }}
|
||||
{{- range $themevariants }}
|
||||
{{- $themevariant := . }}
|
||||
<option id="R-select-variant-{{ $themevariant.identifier }}" value="{{ $themevariant.identifier }}"{{- if $firstvariant }} selected{{ end }}>{{ $themevariant.name }}</option>
|
||||
{{- $firstvariant = false }}
|
||||
{{- end }}
|
||||
</select>
|
||||
</div>
|
||||
<div class="clear"></div>
|
||||
</div>
|
||||
<script>window.variants && variants.markSelectedVariant();</script>
|
||||
</li>
|
||||
<li class="footerVisitedLinks{{if $showvisitedlinks}} showVisitedLinks{{end}}">
|
||||
<div class="padding menu-control">
|
||||
<i class="fa-fw fas fa-history"></i>
|
||||
<span> </span>
|
||||
<div class="control-style">
|
||||
<button onclick="clearHistory();">{{ T "Clear-History" }}</button>
|
||||
</div>
|
||||
<div class="clear"></div>
|
||||
</div>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
<div id="R-footer" class="footerFooter{{if $showfooter}} showFooter{{end}}">
|
||||
{{- $footer }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</aside>
|
||||
{{- define "section-tree-nav" }}
|
||||
{{- $currentNode := .currentnode }}
|
||||
{{- $showvisitedlinks := .showvisitedlinks }}
|
||||
{{- $alwaysopen := .alwaysopen }}
|
||||
{{- $currentFileRelPermalink := .currentnode.RelPermalink }}
|
||||
{{- with .sect }}
|
||||
{{- $isSelf := eq .RelPermalink $currentFileRelPermalink }}
|
||||
{{- $isAncestor := and (not $isSelf) (.IsAncestor $currentNode) }}
|
||||
{{- $isActive := $isSelf }}
|
||||
{{- $pages := partial "pageHelper/pagesBy.html" (dict "page" . "hidden" true) }}
|
||||
{{- $relearnIsHiddenFrom := index ($currentNode.Scratch.Get "relearnIsHiddenFrom") .RelPermalink }}
|
||||
{{- $hidden := and $relearnIsHiddenFrom (not $.showhidden) (not $isSelf) (not $isAncestor) }}
|
||||
{{- if $hidden }}
|
||||
{{- else }}
|
||||
{{- $numberOfVisibleChildren := 0 }}
|
||||
{{- range $pages }}
|
||||
{{- $isSelfSub := eq .RelPermalink $currentFileRelPermalink }}
|
||||
{{- $isAncestorSub := and (not $isSelf) (.IsAncestor $currentNode) }}
|
||||
{{- $relearnIsSubHiddenFrom := index ($currentNode.Scratch.Get "relearnIsHiddenFrom") .RelPermalink }}
|
||||
{{- $subHidden := and $relearnIsSubHiddenFrom (not $.showhidden) (not $isSelfSub) (not $isAncestorSub) }}
|
||||
{{- $numberOfVisibleChildren = add $numberOfVisibleChildren (int (not $subHidden)) }}
|
||||
{{- end }}
|
||||
{{- safeHTML .Params.head }}
|
||||
{{- if $numberOfVisibleChildren }}
|
||||
{{- $title := or .Params.menuTitle .LinkTitle .Title }}
|
||||
{{- $url := partial "relLangPrettyUglyURL.hugo" (dict "to" .) }}
|
||||
{{- $isCollapsible := or (.Params.collapsibleMenu | default .Site.Params.collapsibleMenu) (not $url) }}
|
||||
{{- $currentAlwaysopen := .Params.alwaysopen | default $alwaysopen }}
|
||||
{{- $pageHash := md5 .Page }}
|
||||
{{- $isOpen := or $currentAlwaysopen $isSelf $isAncestor }}
|
||||
<li data-nav-id="{{ $url }}" class="{{if $isActive }}active {{end}}{{if (or $isSelf $isAncestor) }}parent {{end}}{{if $currentAlwaysopen}}alwaysopen{{end}}">{{ if $isCollapsible }}<input type="checkbox" id="R-section-{{ $pageHash }}" aria-controls="R-subsections-{{ $pageHash }}"{{ if $isOpen }} checked{{ end }}><label for="R-section-{{ $pageHash }}"><i class="fa-fw fas fa-chevron-down"></i><i class="fa-fw fas fa-chevron-right"></i><span class="a11y-only">{{ T "Submenu" $title }}</span></label>{{ end }}{{ if $url }}<a class="padding" href="{{ $url }}">{{ else }}<span class="padding">{{ end }}
|
||||
{{- partial "menu-pre.html" . }}{{ $title }}{{ partial "menu-post.html" . }}
|
||||
{{- if $url }}{{ if $showvisitedlinks }}<i class="fa-fw fas fa-check read-icon"></i>{{ end }}</a>{{ else }}</span>{{ end }}<ul id="R-subsections-{{ $pageHash }}" class="morespace collapsible-menu">
|
||||
{{- $defaultAlwaysopen := .Site.Params.alwaysopen | default true }}
|
||||
{{- range $pages }}
|
||||
{{- template "section-tree-nav" dict "sect" . "currentnode" $currentNode "showvisitedlinks" $showvisitedlinks "alwaysopen" $defaultAlwaysopen }}
|
||||
{{- end }}</ul></li>
|
||||
{{- else }}
|
||||
{{- $title := or .Params.menuTitle .LinkTitle .Title }}
|
||||
{{- $url := partial "relLangPrettyUglyURL.hugo" (dict "to" .) }}
|
||||
<li data-nav-id="{{ $url }}" class="{{if $isActive }}active{{end}}">{{ if $url }}<a class="padding" href="{{ $url }}">{{ else }}<span class="padding">{{ end }}
|
||||
{{- partial "menu-pre.html" . }}{{ $title }}{{ partial "menu-post.html" . }}
|
||||
{{- if $url }}{{ if $showvisitedlinks }}<i class="fa-fw fas fa-check read-icon"></i>{{ end }}</a>{{ else }}</span>{{ end }}</li>
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
20
themes/hugo-theme-relearn/layouts/partials/meta.html
Normal file
20
themes/hugo-theme-relearn/layouts/partials/meta.html
Normal file
@@ -0,0 +1,20 @@
|
||||
|
||||
<meta charset="utf-8">
|
||||
{{- $c:=""}}{{/* to avoid that user swiping to the left leaves a gap on the right side, we set minimum-scale, even if not advised to */}}
|
||||
<meta name="viewport" content="height=device-height, width=device-width, initial-scale=1.0, minimum-scale=1.0">
|
||||
{{- if (ne .Site.Params.disableGeneratorVersion true) }}
|
||||
{{- $gen := hugo.Generator }}
|
||||
{{- $gen = replaceRE "\\s*/>$" ">" $gen }}
|
||||
{{ $gen | safeHTML }}
|
||||
{{- $ver := partial "version.txt" }}
|
||||
{{- $ver := printf "<meta name=\"generator\" content=\"%s %s\">" "Relearn" $ver }}
|
||||
{{ $ver | safeHTML }}
|
||||
{{- end }}
|
||||
{{- if not (and .Title (or (ne (.Scratch.Get "relearnIsHiddenStem") true) (ne .Site.Params.disableSeoHiddenPages true) ) ) }}
|
||||
<meta name="robots" content="noindex, nofollow, noarchive, noimageindex">
|
||||
{{- end }}
|
||||
<meta name="description" content="{{ with .Description }}{{ . }}{{ else }}{{ with .Site.Params.description }}{{ . }}{{ end }}{{ end }}">
|
||||
{{- $authorName := partialCached "authorname.hugo" . }}
|
||||
<meta name="author" content="{{ $authorName }}">
|
||||
{{- partial "twitter_cards.html" . }}
|
||||
{{- partial "opengraph.html" . }}
|
||||
@@ -0,0 +1,57 @@
|
||||
{{- $page := .page }}
|
||||
{{- $outputFormat := .outputFormat }}
|
||||
{{- $page.Page.Store.Set (printf "%sIsNested" $outputFormat) true }}
|
||||
{{- with $page }}
|
||||
{{- $currentNode := . }}
|
||||
{{- $pages := partial "pageHelper/pagesBy.html" (dict "page" . "hidden" true) }}
|
||||
{{- template "section-print" dict "sect" . "currentnode" $currentNode "outputFormat" $outputFormat }}
|
||||
{{- if $pages }}
|
||||
<section>
|
||||
<h1 class="a11y-only">{{ T "Subsections" .Title }}</h1>
|
||||
{{- end }}
|
||||
{{- range $pages }}
|
||||
{{- template "section-tree-print" dict "sect" . "currentnode" $currentNode "outputFormat" $outputFormat }}
|
||||
{{- end }}
|
||||
{{- if $pages }}
|
||||
</section>
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{- define "section-tree-print" }}
|
||||
{{- $currentNode := .currentnode }}
|
||||
{{- $outputFormat := .outputFormat }}
|
||||
{{- $currentFileRelPermalink := .currentnode.RelPermalink }}
|
||||
{{- with .sect }}
|
||||
{{- $isSelf := eq .RelPermalink $currentFileRelPermalink }}
|
||||
{{- $isAncestor := and (not $isSelf) (.IsAncestor $currentNode) }}
|
||||
{{- $pages := partial "pageHelper/pagesBy.html" (dict "page" . "hidden" true) }}
|
||||
{{- $relearnIsHiddenFrom := index ($currentNode.Scratch.Get "relearnIsHiddenFrom") .RelPermalink }}
|
||||
{{- $hidden := and $relearnIsHiddenFrom (not $.showhidden) (not $isSelf) (not $isAncestor) }}
|
||||
{{- if $hidden }}
|
||||
{{- else }}
|
||||
{{- template "section-print" dict "sect" . "currentnode" $currentNode "outputFormat" $outputFormat }}
|
||||
{{- if $pages }}
|
||||
<section>
|
||||
<h1 class="a11y-only">{{ T "Subsections" .Title }}</h1>
|
||||
{{- end }}
|
||||
{{- range $pages }}
|
||||
{{- template "section-tree-print" dict "sect" . "currentnode" $currentNode "outputFormat" $outputFormat }}
|
||||
{{- end }}
|
||||
{{- if $pages }}
|
||||
</section>
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{- define "section-print" }}
|
||||
{{- $currentNode := .currentnode }}
|
||||
{{- $outputFormat := .outputFormat }}
|
||||
{{- with .sect }}
|
||||
{{- $page := . }}
|
||||
{{- partialCached "nested-content.hugo" (dict "page" $page "outputFormat" $outputFormat) $page.RelPermalink "outputFormat" $outputFormat }}
|
||||
{{- range $page.Site.Params.relearn.dependencies }}
|
||||
{{- $has := printf "has%s" .name }}
|
||||
{{- $nestedhas := printf "nestedHas%s" .name }}
|
||||
{{- $currentNode.Page.Store.Set $nestedhas (or ($currentNode.Page.Store.Get $nestedhas) ($page.Page.Store.Get $has)) }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
@@ -0,0 +1,13 @@
|
||||
{{- $page := .page }}
|
||||
{{- $outputFormat := .outputFormat }}
|
||||
{{- $content := "" }}
|
||||
{{- $url := partial "relLangPrettyUglyURL.hugo" (dict "to" $page) }}
|
||||
{{- if $url }}
|
||||
{{- $c:=""}}{{/* if we have a relative link in a print page, our print URL is one level to deep; so we are making it absolute to our page by prepending the page's permalink */}}
|
||||
{{- $link_prefix := strings.TrimRight "/" $page.RelPermalink }}
|
||||
{{- $content = partial "output-partial.hugo" (dict "base" "content" "page" $page "parameter" $page "outputFormat" $outputFormat) }}
|
||||
{{- $content = replaceRE "((?:src|href)\\s*=(?:\\s*[\"']\\s*)?)(\\.[^\"'\\s>]*|[\\w]+[^\"'\\s>:]*)([\"'\\s>])" (printf "${1}%s/${2}${3}" $link_prefix) $content }}
|
||||
{{- end }}
|
||||
{{- if $page.Title }}
|
||||
{{- partial "output-partial.hugo" (dict "base" "article" "page" $page "parameter" (dict "page" $page "content" $content "outputFormat" $outputFormat) "outputFormat" $outputFormat) }}
|
||||
{{- end }}
|
||||
121
themes/hugo-theme-relearn/layouts/partials/opengraph.html
Normal file
121
themes/hugo-theme-relearn/layouts/partials/opengraph.html
Normal file
@@ -0,0 +1,121 @@
|
||||
{{- /* based on Hugo 0.119.0 _internal/opengraph.html but with modified title */}}
|
||||
{{- $format := partial "get-format.hugo" . }}
|
||||
{{- $outputFormat := partial "output-format.hugo" (dict "page" . "format" $format) }}
|
||||
{{- $basename := "index" }}
|
||||
{{- if eq $outputFormat "searchpage" }}
|
||||
{{- $basename = partial "BaseName.hugo" $format.RelPermalink }}
|
||||
{{- end }}
|
||||
{{- $page := . }}
|
||||
{{- $title := .Title }}
|
||||
{{- if eq $outputFormat "searchpage" }}
|
||||
{{- $title = T "Search" }}
|
||||
{{- else if eq .Kind "taxonomy" }}
|
||||
{{- $title = default (default .Data.Plural (i18n .Data.Plural)) .Params.Title }}
|
||||
{{- else if eq .Kind "term" }}
|
||||
{{- $taxonomy_page := .Site.GetPage .Data.Plural }}
|
||||
{{- $title = default (default .Data.Singular (i18n .Data.Singular)) $taxonomy_page.Params.SingularTitle }}
|
||||
{{- $title = printf "%s %s %s" (default (humanize .Data.Term | strings.Title) .Title) (default "::" .Site.Params.titleSeparator) $title }}
|
||||
{{- end }}
|
||||
{{- if and $title .Site.Title (not (eq $title .Site.Title)) }}
|
||||
{{- $title = printf "%s %s %s" $title (default "::" .Site.Params.titleSeparator) .Site.Title }}
|
||||
{{- end }}
|
||||
<meta property="og:title" content="{{ $title }}">
|
||||
<meta property="og:description" content="{{ with .Description }}{{ . }}{{ else }}{{if .IsPage}}{{ .Summary }}{{ else }}{{ with .Site.Params.description }}{{ . }}{{ end }}{{ end }}{{ end }}">
|
||||
<meta property="og:type" content="{{ if .IsPage }}article{{ else }}website{{ end }}">
|
||||
<meta property="og:url" content="{{ partial "relLangPrettyUglyURL.hugo" (dict "to" . "abs" true "basename" $basename) }}">
|
||||
{{- with $.Params.images }}
|
||||
{{- range first 6 . }}
|
||||
<meta property="og:image" content="{{ . | absURL }}">
|
||||
{{- end }}
|
||||
{{- else }}
|
||||
{{- $images := $.Resources.ByType "image" }}
|
||||
{{- $featured := $images.GetMatch "*feature*" }}
|
||||
{{- if not $featured }}
|
||||
{{- $featured = $images.GetMatch "{*cover*,*thumbnail*}" }}
|
||||
{{- end }}
|
||||
{{- with $featured }}
|
||||
<meta property="og:image" content="{{ $featured.Permalink }}">
|
||||
{{- else }}
|
||||
{{- with $.Site.Params.images }}
|
||||
<meta property="og:image" content="{{ index . 0 | absURL }}">
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
|
||||
{{- if .IsPage }}
|
||||
{{- $iso8601 := "2006-01-02T15:04:05-07:00" }}
|
||||
{{- with .Parent }}
|
||||
{{- $page := . }}
|
||||
{{- $link := "<link href=\"%s\" rel=\"%s\" type=\"%s\" title=\"%s\">" }}
|
||||
{{- $title := .Title }}
|
||||
{{- if eq $outputFormat "searchpage" }}
|
||||
{{- $title = T "Search" }}
|
||||
{{- else if eq .Kind "taxonomy" }}
|
||||
{{- $title = default (default .Data.Plural (i18n .Data.Plural)) .Params.Title }}
|
||||
{{- else if eq .Kind "term" }}
|
||||
{{- $taxonomy_page := .Site.GetPage .Data.Plural }}
|
||||
{{- $title = default (default .Data.Singular (i18n .Data.Singular)) $taxonomy_page.Params.SingularTitle }}
|
||||
{{- $title = printf "%s %s %s" (default (humanize .Data.Term | strings.Title) .Title) (default "::" .Site.Params.titleSeparator) $title }}
|
||||
{{- end }}
|
||||
{{- if and $title .Site.Title (not (eq $title .Site.Title)) }}
|
||||
{{- $title = printf "%s %s %s" $title (default "::" .Site.Params.titleSeparator) .Site.Title }}
|
||||
{{- end }}
|
||||
<meta property="article:section" content="{{ $title }}">
|
||||
{{- end }}
|
||||
{{- with .PublishDate }}
|
||||
<meta property="article:published_time" {{ .Format $iso8601 | printf "content=%q" | safeHTMLAttr }}>
|
||||
{{- end }}
|
||||
{{- with .Lastmod }}
|
||||
<meta property="article:modified_time" {{ .Format $iso8601 | printf "content=%q" | safeHTMLAttr }}>
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
|
||||
{{- with .Params.audio }}
|
||||
<meta property="og:audio" content="{{ . }}">
|
||||
{{- end }}
|
||||
{{- with .Params.locale }}
|
||||
<meta property="og:locale" content="{{ . }}">
|
||||
{{- end }}
|
||||
{{- with .Site.Title }}
|
||||
<meta property="og:site_name" content="{{ . }}">
|
||||
{{- end }}
|
||||
{{- with .Params.videos }}
|
||||
{{- range . }}
|
||||
<meta property="og:video" content="{{ . | absURL }}">
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
|
||||
{{- /* If it is part of a series, link to related articles */}}
|
||||
{{- $permalink := .Permalink }}
|
||||
{{- $siteSeries := .Site.Taxonomies.series }}
|
||||
{{- if $siteSeries }}
|
||||
{{- with .Params.series }}
|
||||
{{- range $name := . }}
|
||||
{{- $series := index $siteSeries ($name | urlize) }}
|
||||
{{- range $page := first 6 $series.Pages }}
|
||||
{{- if ne $page.Permalink $permalink }}
|
||||
<meta property="og:see_also" content="{{ $page.Permalink }}">
|
||||
{{ end }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
|
||||
{{- /* Deprecate site.Social.facebook_admin in favor of site.Params.social.facebook_admin */}}
|
||||
{{- $facebookAdmin := "" }}
|
||||
{{- with site.Params.social.facebook_admin }}
|
||||
{{- $facebookAdmin = . }}
|
||||
{{- else }}
|
||||
{{- with site.Social.facebook_admin }}
|
||||
{{- $facebookAdmin = . }}
|
||||
{{- $hugoVersion := "0.120.0" }}
|
||||
{{- if ge hugo.Version $hugoVersion }}
|
||||
{{- warnf "The social key in site configuration is deprecated. Use params.social.facebook_admin instead." }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
|
||||
{{- /* Facebook Page Admin ID for Domain Insights */}}
|
||||
{{- with $facebookAdmin }}
|
||||
<meta property="fb:admins" content="{{ . }}">
|
||||
{{- end }}
|
||||
@@ -0,0 +1,13 @@
|
||||
{{- $page := . }}
|
||||
{{- $format := "" }}
|
||||
{{- if reflect.IsMap $page }}
|
||||
{{- $format = $page.format }}
|
||||
{{- $page = $page.page }}
|
||||
{{- else }}
|
||||
{{- $format = partial "get-format.hugo" $page }}
|
||||
{{- end }}
|
||||
{{- $ret := "default" }}
|
||||
{{- if $format }}
|
||||
{{ $ret = $format.Name | lower }}
|
||||
{{- end }}
|
||||
{{- return $ret }}
|
||||
@@ -0,0 +1,17 @@
|
||||
{{- $base := .base }}
|
||||
{{- $page := .page }}
|
||||
{{- $parameter := .parameter }}
|
||||
{{- $outputFormat := .outputFormat }}
|
||||
{{- if not $outputFormat }}
|
||||
{{- $outputFormat = partial "output-format.hugo" $page }}
|
||||
{{- end }}
|
||||
{{- $suffix := partialCached "output-suffix.hugo" $page $page.RelPermalink $outputFormat }}
|
||||
{{- $f := printf "/layouts/partials/%s.%s.%s" $base $outputFormat $suffix }}
|
||||
{{- if or (not $outputFormat) (not (partialCached "fileExists.hugo" $f $f)) }}
|
||||
{{- $f = printf "/layouts/partials/%s.%s" $base $suffix }}
|
||||
{{- if partialCached "fileExists.hugo" $f $f }}
|
||||
{{- partial (printf "%s.%s" $base $suffix) $parameter }}
|
||||
{{- end }}
|
||||
{{- else }}
|
||||
{{- partial (printf "%s.%s.%s" $base $outputFormat $suffix) $parameter }}
|
||||
{{- end }}
|
||||
@@ -0,0 +1,8 @@
|
||||
{{- $format := partial "get-format.hugo" . }}
|
||||
{{- $ret := "html" }}
|
||||
{{- if $format }}
|
||||
{{- range first 1 $format.MediaType.Suffixes }}
|
||||
{{- $ret = . }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{- return $ret }}
|
||||
54
themes/hugo-theme-relearn/layouts/partials/page-meta.hugo
Normal file
54
themes/hugo-theme-relearn/layouts/partials/page-meta.hugo
Normal file
@@ -0,0 +1,54 @@
|
||||
{{- $currentNode := . }}
|
||||
{{- $forceContent := $currentNode.WordCount }}
|
||||
{{- $currentNode.Scratch.Delete "relearnIsSelfFound" }}
|
||||
{{- $currentNode.Scratch.Delete "relearnPrevPage" }}
|
||||
{{- $currentNode.Scratch.Delete "relearnNextPage" }}
|
||||
{{- $currentNode.Scratch.Delete "relearnIsHiddenNode" }}{{/* the node itself is flagged as hidden */}}
|
||||
{{- $currentNode.Scratch.Delete "relearnIsHiddenStem" }}{{/* the node or one of its parents is flagged as hidden */}}
|
||||
{{- $currentNode.Scratch.Delete "relearnIsHiddenFrom" }}{{/* the node is hidden from the current page */}}
|
||||
{{- range $currentNode.Site.Params.relearn.dependencies }}
|
||||
{{- $has := printf "has%s" .name }}
|
||||
{{- $disable := printf "disable%s" .name }}
|
||||
{{- $wants := or (and (ne (index $currentNode.Params $disable) nil) (not (index $currentNode.Params $disable))) (and (ne (index $currentNode.Site.Params $disable) nil) (not (index $currentNode.Site.Params $disable))) }}
|
||||
{{- if $wants }}
|
||||
{{- $currentNode.Store.Set $has true }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{- template "relearn-structure" dict "node" .Site.Home "currentnode" $currentNode "hiddenstem" false "hiddencurrent" false }}
|
||||
{{- define "relearn-structure" }}
|
||||
{{- $currentNode := .currentnode }}
|
||||
{{- $isSelf := eq $currentNode .node }}
|
||||
{{- $isDescendant := and (not $isSelf) (.node.IsDescendant $currentNode) }}
|
||||
{{- $isAncestor := and (not $isSelf) (.node.IsAncestor $currentNode) }}
|
||||
{{- $isOther := and (not $isDescendant) (not $isSelf) (not $isAncestor) }}
|
||||
{{- $isChildren := eq $currentNode .node.Parent }}
|
||||
{{- if $isSelf }}
|
||||
{{- $currentNode.Scratch.Set "relearnIsSelfFound" true }}
|
||||
{{- end}}
|
||||
{{- $isSelfFound := eq ($currentNode.Scratch.Get "relearnIsSelfFound") true }}
|
||||
{{- $isPreSelf := and (not $isSelfFound) (not $isSelf) }}
|
||||
{{- $isPostSelf := and ($isSelfFound) (not $isSelf) }}
|
||||
|
||||
{{- $hidden_node := or (.node.Params.hidden) (eq .node.Title "") }}
|
||||
{{- $hidden_stem := or $hidden_node .hiddenstem }}
|
||||
{{- $hidden_current_stem := or $hidden_node .hiddencurrent }}
|
||||
{{- $hidden_from_current := or (and $hidden_node (not $isAncestor) (not $isSelf) ) (and .hiddencurrent (or $isPreSelf $isPostSelf $isDescendant) ) }}
|
||||
{{- if $isSelf }}
|
||||
{{- $currentNode.Scratch.Set "relearnIsHiddenNode" $hidden_node }}
|
||||
{{- $currentNode.Scratch.Set "relearnIsHiddenStem" $hidden_stem }}
|
||||
{{- end}}
|
||||
{{- $currentNode.Scratch.SetInMap "relearnIsHiddenFrom" .node.RelPermalink $hidden_current_stem }}
|
||||
|
||||
{{- if not $hidden_from_current }}
|
||||
{{- if and $isPreSelf .node.RelPermalink }}
|
||||
{{- $currentNode.Scratch.Set "relearnPrevPage" .node }}
|
||||
{{- else if and $isPostSelf .node.RelPermalink (eq ($currentNode.Scratch.Get "relearnNextPage") nil) }}
|
||||
{{- $currentNode.Scratch.Set "relearnNextPage" .node }}
|
||||
{{- end}}
|
||||
{{- end }}
|
||||
|
||||
{{- $pages := partial "pageHelper/pagesBy.html" (dict "page" .node "hidden" true) }}
|
||||
{{- range $pages }}
|
||||
{{- template "relearn-structure" dict "node" . "currentnode" $currentNode "hiddenstem" $hidden_stem "hiddencurrent" $hidden_from_current }}
|
||||
{{- end}}
|
||||
{{- end }}
|
||||
@@ -0,0 +1 @@
|
||||
{{- return (or (not .Title) .Params.hidden) }}
|
||||
@@ -0,0 +1,13 @@
|
||||
{{- $collection := .collection }}
|
||||
{{- $item := .item }}
|
||||
{{- $found := false }}
|
||||
{{- $result := "" }}
|
||||
{{- range $collection }}
|
||||
{{- if $found }}
|
||||
{{- $result = .Page.Page }}
|
||||
{{- break }}
|
||||
{{- else if eq $item .Page.Page }}
|
||||
{{- $found = true }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{- return $result }}
|
||||
@@ -0,0 +1,45 @@
|
||||
{{- $page := .page }}
|
||||
{{- /* default sort order for the theme is historically by weight */}}
|
||||
{{- $by := .by }}
|
||||
{{- if eq $by "auto" }}
|
||||
{{- $by = "" }}
|
||||
{{- end }}
|
||||
{{- $by = $by | default $page.Params.ordersectionsby | default $page.Site.Params.ordersectionsby | default "weight" }}
|
||||
{{- $hidden := .hidden }}
|
||||
|
||||
{{- $pages := slice }}
|
||||
|
||||
{{- if eq $by "weight" }}
|
||||
{{- $pages = $page.Pages.ByWeight }}
|
||||
{{- else if or (eq $by "name") (eq $by "title") }}
|
||||
{{- $pages = $page.Pages.ByTitle }}
|
||||
{{- else if eq $by "linktitle" }}
|
||||
{{- $pages = $page.Pages.ByLinkTitle }}
|
||||
{{- else if eq $by "modifieddate" }}
|
||||
{{- $pages = $page.Pages.Lastmod }}
|
||||
{{- else if eq $by "expirydate" }}
|
||||
{{- $pages = $page.Pages.ByExpiryDate }}
|
||||
{{- else if eq $by "publishdate" }}
|
||||
{{- $pages = $page.Pages.ByPublishDate }}
|
||||
{{- else if eq $by "date" }}
|
||||
{{- $pages = $page.Pages.ByDate }}
|
||||
{{- else if eq $by "length" }}
|
||||
{{- $pages = $page.Pages.ByLength }}
|
||||
{{- else if eq $by "default" }}
|
||||
{{- $pages = $page.Pages }}
|
||||
{{- else }}
|
||||
{{- warnf "%q: Unknown pages sort order '%s'" $page.File.Filename }}
|
||||
{{- $pages = $page.Pages }}
|
||||
{{- end }}
|
||||
|
||||
{{- if not $hidden }}
|
||||
{{- $nonhiddenpages := slice }}
|
||||
{{- range $page := $pages }}
|
||||
{{- if not (partial "pageHelper/isHidden.html" $page) }}
|
||||
{{- $nonhiddenpages := $nonhiddenpages | append $page }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{- $pages = $nonhiddenpages }}
|
||||
{{- end }}
|
||||
|
||||
{{- return $pages }}
|
||||
@@ -0,0 +1,12 @@
|
||||
{{- $collection := .collection }}
|
||||
{{- $item := .item }}
|
||||
{{- $found := "" }}
|
||||
{{- $result := "" }}
|
||||
{{- range $collection }}
|
||||
{{- if eq $item .Page.Page }}
|
||||
{{- $result = $found }}
|
||||
{{- break }}
|
||||
{{- end }}
|
||||
{{- $found = .Page.Page }}
|
||||
{{- end }}
|
||||
{{- return $result }}
|
||||
@@ -0,0 +1,15 @@
|
||||
{{- $pages := slice }}
|
||||
{{- range .Data.Terms }}
|
||||
{{- $count := 0 }}
|
||||
{{- range .Pages }}
|
||||
{{- $c:=""}}{{/* count pages of term */}}
|
||||
{{- if and .Title .RelPermalink (or (ne (.Scratch.Get "relearnIsHiddenStem") true) (ne .Site.Params.disableTagHiddenPages true) ) }}
|
||||
{{- $count = add $count 1 }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{- if $count }}
|
||||
{{- $pages = $pages| append (dict "Title" (default (humanize .Page.Data.Term | strings.Title) .Page.Title) "Page" .Page "Count" $count )}}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{- $pages = sort $pages ".Title" }}
|
||||
{{- return $pages }}
|
||||
@@ -0,0 +1,8 @@
|
||||
{{- $pages := slice }}
|
||||
{{- range .Pages }}
|
||||
{{- if and .Title .RelPermalink (or (ne (.Scratch.Get "relearnIsHiddenStem") true) (ne .Site.Params.disableTagHiddenPages true) ) }}
|
||||
{{- $pages = $pages | append (dict "Title" .Title "Page" . )}}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{- $pages = sort $pages ".Title" }}
|
||||
{{- return $pages }}
|
||||
11
themes/hugo-theme-relearn/layouts/partials/relBasePath.hugo
Normal file
11
themes/hugo-theme-relearn/layouts/partials/relBasePath.hugo
Normal file
@@ -0,0 +1,11 @@
|
||||
{{- /* generates an uphill path from the current page to the root of the site */}}
|
||||
{{- $subdir := strings.TrimSuffix (relLangURL "/") (relLangURL "") }}
|
||||
{{- $relBasePath := .RelPermalink }}
|
||||
{{- $relBasePath = replaceRE "/[^/]*$" "" $relBasePath }}
|
||||
{{- $relBasePath = strings.TrimPrefix $subdir $relBasePath }}
|
||||
{{- $relBasePath = replaceRE "/[^/]*" "/.." $relBasePath }}
|
||||
{{- $relBasePath = trim $relBasePath "/" }}
|
||||
{{- if not $relBasePath }}
|
||||
{{- $relBasePath = "." }}
|
||||
{{- end }}
|
||||
{{- return $relBasePath }}
|
||||
10
themes/hugo-theme-relearn/layouts/partials/relBaseUri.hugo
Normal file
10
themes/hugo-theme-relearn/layouts/partials/relBaseUri.hugo
Normal file
@@ -0,0 +1,10 @@
|
||||
{{- /* generates an uphill path from the current page to the root of the server */}}
|
||||
{{- $subdir := strings.TrimSuffix (relLangURL "/") (relLangURL "") }}
|
||||
{{- $relBaseUri := .RelPermalink }}
|
||||
{{- $relBaseUri = replaceRE "/[^/]*$" "" $relBaseUri }}
|
||||
{{- $relBaseUri = replaceRE "/[^/]*" "/.." $relBaseUri }}
|
||||
{{- $relBaseUri = trim $relBaseUri "/" }}
|
||||
{{- if not $relBaseUri }}
|
||||
{{- $relBaseUri = "." }}
|
||||
{{- end }}
|
||||
{{- return $relBaseUri }}
|
||||
@@ -0,0 +1,19 @@
|
||||
{{- $to := .to }}
|
||||
{{- $abs := .abs }}
|
||||
{{- $basename := .basename }}
|
||||
{{- $link := "" }}
|
||||
{{- if isset . "link" }}
|
||||
{{- $link = .link }}
|
||||
{{- else if not $to }}
|
||||
{{- else if $abs }}
|
||||
{{- $link = $to.Permalink }}
|
||||
{{- else }}
|
||||
{{- $link = $to.RelPermalink }}
|
||||
{{- end }}
|
||||
{{- if not $basename }}
|
||||
{{- $basename = "index" }}
|
||||
{{- end }}
|
||||
{{- if and (ne site.Params.disableExplicitIndexURLs true) (eq (substr $link -1) "/") }}
|
||||
{{- $link = printf "%s%s.html" $link $basename }}
|
||||
{{- end }}
|
||||
{{- $link }}
|
||||
48
themes/hugo-theme-relearn/layouts/partials/search.html
Normal file
48
themes/hugo-theme-relearn/layouts/partials/search.html
Normal file
@@ -0,0 +1,48 @@
|
||||
{{- $link := "" }}
|
||||
{{- if or (.Site.Home.OutputFormats.Get "json") (.Site.Home.OutputFormats.Get "search") }}
|
||||
{{- with .Site.Home.OutputFormats.Get "searchpage" }}
|
||||
{{- $link = partial "relLangPrettyUglyURL.hugo" (dict "to" .) }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{- $c:="" }} {{ if $link }}<form action="{{ $link }}" method="get">{{ end }}<div class="searchbox default-animation">
|
||||
{{ if $link }}<button class="search-detail" type="submit" title="{{ T "Search" }} (CTRL+ALT+f)">{{ end }}<i class="fas fa-search"{{ if not $link }} title="{{ T "Search" }} (CTRL+ALT+f)"{{ end }}></i>{{ if $link }}</button>{{ end }}
|
||||
<label class="a11y-only" for="R-search-by">{{ T "Search" }}</label>
|
||||
<input data-search-input id="R-search-by" name="search-by" class="search-by" type="search" placeholder="{{ T "Search-placeholder" }}">
|
||||
<button class="search-clear" type="button" data-search-clear="" title="{{ T "Clear-search" }}"><i class="fas fa-times" title="{{ T "Clear-search" }}"></i></button>
|
||||
</div>{{ if $link }}</form>{{ end }}
|
||||
{{- $assetBusting := not .Site.Params.disableAssetsBusting }}
|
||||
{{- $pageBaseLang := replaceRE "([a-z]+).*" "${1}" .Page.Language.LanguageCode }}
|
||||
{{- $contentlangs := (union (slice | append (.Site.Params.additionalContentLanguage | default slice)) (slice $pageBaseLang)) }}
|
||||
{{- $quotedcontentlangs := slice }}
|
||||
{{- $missingcontentlangs := slice }}
|
||||
{{- range $contentlangs }}
|
||||
{{- $f := printf "/static/js/lunr/lunr.%s.min.js" . }}
|
||||
{{- if partialCached "fileExists.hugo" $f $f }}
|
||||
{{- $quotedcontentlangs = $quotedcontentlangs | append (printf "'%s'" .) }}
|
||||
{{- else }}
|
||||
{{- $missingcontentlangs = $missingcontentlangs | append . }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{- $contentlangs = $contentlangs | complement $missingcontentlangs }}
|
||||
<script>
|
||||
var contentLangs=[{{ delimit $quotedcontentlangs ", " | safeJS }}];
|
||||
</script>
|
||||
<script src="{{"js/auto-complete.js" | relURL}}{{ if $assetBusting }}?{{ now.Unix }}{{ end }}" defer></script>
|
||||
<script src="{{"js/lunr/lunr.min.js" | relURL}}{{ if $assetBusting }}?{{ now.Unix }}{{ end }}" defer></script>
|
||||
<script src="{{"js/lunr/lunr.stemmer.support.min.js" | relURL}}{{ if $assetBusting }}?{{ now.Unix }}{{ end }}" defer></script>
|
||||
<script src="{{"js/lunr/lunr.multi.min.js" | relURL}}{{ if $assetBusting }}?{{ now.Unix }}{{ end }}" defer></script>
|
||||
{{- $tinyseg := false }}
|
||||
{{- $wordcut := false }}
|
||||
{{- range $contentlangs }}
|
||||
{{- if and (not $tinyseg) (or (eq . "ja")) }}
|
||||
{{- $tinyseg = true }}
|
||||
<script src="{{"js/lunr/tinyseg.js" | relURL}}{{ if $assetBusting }}?{{ now.Unix }}{{ end }}" defer></script>
|
||||
{{- end }}
|
||||
{{- if and (not $wordcut) (or (eq . "hi") (eq . "th")) }}
|
||||
{{- $wordcut = true }}
|
||||
<script src="{{"js/lunr/wordcut.js" | relURL}}{{ if $assetBusting }}?{{ now.Unix }}{{ end }}" defer></script>
|
||||
{{- end }}
|
||||
{{- $file := (printf "js/lunr/lunr.%s.min.js" .) }}
|
||||
<script src="{{ $file | relURL}}{{ if $assetBusting }}?{{ now.Unix }}{{ end }}" defer></script>
|
||||
{{- end }}
|
||||
<script src="{{ "js/search.js" | relURL }}{{ if $assetBusting }}?{{ now.Unix }}{{ end }}" defer></script>
|
||||
@@ -0,0 +1,94 @@
|
||||
{{- $page := .page }}
|
||||
{{- if and (not $page) .context }}
|
||||
{{- $page = .context }}
|
||||
{{- warnf "%q: DEPRECATED parameter 'context' for shortcode 'attachments' found, use 'page' instead; see https://mcshelby.github.io/hugo-theme-relearn/basics/migration#5180" $page.File.Filename }}
|
||||
{{- end }}
|
||||
{{ warnf "%q: DEPRECATED shortcode `attachments` found, use `resources` instead; see https://mcshelby.github.io/hugo-theme-relearn/shortcodes/attachments#migration" $page.File.Filename }}
|
||||
{{- $color := .color | default "" }}
|
||||
{{- $content := .content }}
|
||||
{{- $style := .style | default "default" }}
|
||||
{{- if and (not $color) (eq (len $color) 0) }}
|
||||
{{- $style = .style | default "transparent" }}
|
||||
{{- end }}
|
||||
{{- $title := .title }}
|
||||
{{- if not $title }}
|
||||
{{- if eq $style "info" }}{{ $title = $style | T }}{{ end }}
|
||||
{{- if eq $style "warning" }}{{ $title = $style | T }}{{ end }}
|
||||
{{- if eq $style "note" }}{{ $title = $style | T }}{{ end }}
|
||||
{{- if eq $style "tip" }}{{ $title = $style | T }}{{ end }}
|
||||
{{- end }}
|
||||
{{- $title = trim ($title | default ("Attachments-label" | T)) " " }}
|
||||
{{- $icon := .icon | default "" }}
|
||||
{{- if and (not $icon) (eq (len $icon) 0) }}
|
||||
{{- $icon = "paperclip" }}
|
||||
{{- if eq $style "info" }}{{ $icon = default "info-circle" }}{{ end }}
|
||||
{{- if eq $style "warning" }}{{ $icon = default "exclamation-triangle" }}{{ end }}
|
||||
{{- if eq $style "note" }}{{ $icon = default "exclamation-circle" }}{{ end }}
|
||||
{{- if eq $style "tip" }}{{ $icon = default "lightbulb" }}{{ end }}
|
||||
{{- end }}
|
||||
{{- $icon = trim $icon " " }}
|
||||
{{- if and $icon (not (findRE ".*?\\bfa-\\w.*?" $icon)) }}
|
||||
{{- $icon = printf "fa-fw fas fa-%s" $icon }}
|
||||
{{- end }}
|
||||
{{- $sort := .sort | default "asc" }}
|
||||
{{- $pattern := .pattern | default "" }}
|
||||
{{- $defaultUrlPrefix := strings.TrimRight "/" $page.RelPermalink }}
|
||||
{{- if .IsTranslated -}}
|
||||
{{- $defaultLanguage := (index $page.Site.Home.AllTranslations 0).Language.Lang }}
|
||||
{{- $defaultLanguagePage := index (where $page.AllTranslations "Language.Lang" $defaultLanguage) 0 }}
|
||||
{{- $defaultUrlPrefix = strings.TrimRight "/" $defaultLanguagePage.RelPermalink }}
|
||||
{{- end }}
|
||||
{{- $urlPrefix := strings.TrimRight "/" $page.RelPermalink }}
|
||||
{{- with $page }}
|
||||
{{- if ne .BundleType "leaf" }}
|
||||
{{- $hugoVersion := "0.112.0" }}
|
||||
{{- if ge hugo.Version $hugoVersion }}
|
||||
{{- warnf "%q: UNSUPPORTED usage of 'attachments' shortcode found while using Hugo >= 0.112.0, use a leaf bundle instead; see https://mcshelby.github.io/hugo-theme-relearn/shortcodes/attachments/index.html#single-language" $page.File.Filename }}
|
||||
{{- else }}
|
||||
{{- warnf "%q: DEPRECATED usage of 'attachments' shortcode found which will not be compatible while using Hugo >= 0.112.0, use a leaf bundle instead; see https://mcshelby.github.io/hugo-theme-relearn/shortcodes/attachments/index.html#single-language" $page.File.Filename }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
<div class="box attachments cstyle {{ $style }}"{{ if $color }} style="--VARIABLE-BOX-color: {{ $color }};"{{ end }}>
|
||||
<div class="box-label">{{ if $icon }}<i class="{{ $icon }}"></i>{{ end }}{{ if and $icon $title }} {{ end }}{{ $title | .RenderString }}</div>
|
||||
<ul class="box-content attachments-files">
|
||||
{{- $fileDir := "" }}
|
||||
{{- $hugoVersion := "0.112.0" }}
|
||||
{{- if ge hugo.Version $hugoVersion }}
|
||||
{{- $fileDir = path.Dir (strings.TrimPrefix (path.Clean hugo.WorkingDir) (path.Clean .File.Filename)) }}
|
||||
{{- else }}
|
||||
{{- $fileDir = printf "%s/%s" (path.Clean (.Language.ContentDir | default "content")) (path.Clean .File.Dir) }}
|
||||
{{- end }}
|
||||
{{- $fileDir = printf "%s/" (path.Clean (strings.TrimPrefix "/" $fileDir)) }}
|
||||
{{- $fileLink := $fileDir }}
|
||||
{{- $fileLink = strings.TrimPrefix "content/" $fileLink }}
|
||||
{{- $filesName := printf "%s.files" .File.BaseFileName }}
|
||||
{{- if and (eq .File.BaseFileName "index") (fileExists (printf "%sfiles" $fileDir)) }}
|
||||
{{- $c := "" }}{{/* backward compat to < 5.9.0 behavior */}}
|
||||
{{- $filesName = "files" }}
|
||||
{{- end }}
|
||||
{{- $dir := printf "%s%s" $fileDir $filesName }}
|
||||
{{- if fileExists $dir }}
|
||||
{{- range sort (readDir $dir) "Name" $sort }}
|
||||
{{- if findRE $pattern .Name}}
|
||||
{{- $size := .Size }}
|
||||
{{- $unit := "Byte-symbol" }}
|
||||
{{- if ge $size 1024 }}
|
||||
{{- $size = div $size 1024 }}
|
||||
{{- $unit = "Kilobyte-symbol" }}
|
||||
{{- end }}
|
||||
{{- if ge $size 1024 }}
|
||||
{{- $size = div $size 1024 }}
|
||||
{{- $unit = "Megabyte-symbol" }}
|
||||
{{- end }}
|
||||
{{- $unitsymbol := $unit | T }}
|
||||
{{- $link := (printf "%s%s/%s" $fileLink $filesName .Name) | relLangURL }}
|
||||
{{- $c := "" }}{{/* Hugo stores the attachments always in the default language subdirectory */}}
|
||||
{{- $link = replace $link $urlPrefix $defaultUrlPrefix 1 }}
|
||||
<li><a href="{{ $link }}">{{.Name}}</a> ({{$size}} {{$unitsymbol}})</li>
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
</ul>
|
||||
{{- $content }}
|
||||
</div>
|
||||
{{- end }}
|
||||
@@ -0,0 +1,30 @@
|
||||
{{- $page := .page }}
|
||||
{{- if and (not $page) .context }}
|
||||
{{- $page = .context }}
|
||||
{{- warnf "%q: DEPRECATED parameter 'context' for shortcode 'badge' found, use 'page' instead; see https://mcshelby.github.io/hugo-theme-relearn/basics/migration#5180" $page.File.Filename }}
|
||||
{{- end }}
|
||||
{{- $color := .color | default "" }}
|
||||
{{- $content := .content }}
|
||||
{{- $style := .style | default "default" }}
|
||||
{{- $title := .title }}
|
||||
{{- if not $title }}
|
||||
{{- if eq $style "info" }}{{ $title = $style | T }}{{ end }}
|
||||
{{- if eq $style "warning" }}{{ $title = $style | T }}{{ end }}
|
||||
{{- if eq $style "note" }}{{ $title = $style | T }}{{ end }}
|
||||
{{- if eq $style "tip" }}{{ $title = $style | T }}{{ end }}
|
||||
{{- end }}
|
||||
{{- $title = trim $title " " }}
|
||||
{{- $icon := .icon | default "" }}
|
||||
{{- if and (not $icon) (eq (len $icon) 0) }}
|
||||
{{- if eq $style "info" }}{{ $icon = default "info-circle" }}{{ end }}
|
||||
{{- if eq $style "warning" }}{{ $icon = default "exclamation-triangle" }}{{ end }}
|
||||
{{- if eq $style "note" }}{{ $icon = default "exclamation-circle" }}{{ end }}
|
||||
{{- if eq $style "tip" }}{{ $icon = default "lightbulb" }}{{ end }}
|
||||
{{- end }}
|
||||
{{- $icon = trim $icon " " }}
|
||||
{{- if and $icon (not (findRE ".*?\\bfa-\\w.*?" $icon)) }}
|
||||
{{- $icon = printf "fa-fw fas fa-%s" $icon }}
|
||||
{{- end }}
|
||||
{{- with $page -}}
|
||||
<span class="badge cstyle {{ $style }}{{ if or $icon $title }} badge-with-title{{ end }}">{{ if or $icon $title }}<span class="badge-title">{{ if $icon }}<i class="{{ $icon }}"></i>{{ end }}{{ if and $icon $title }} {{ end }}{{ if $title }}{{ $title | .RenderString }}{{ end }}</span>{{ end }}<span class="badge-content"{{ if $color }} style="background-color: {{ $color }};"{{ end }}>{{ $content }}</span></span>
|
||||
{{- end }}
|
||||
@@ -0,0 +1,75 @@
|
||||
{{- $page := .page }}
|
||||
{{- if and (not $page) .context }}
|
||||
{{- $page = .context }}
|
||||
{{- warnf "%q: DEPRECATED parameter 'context' for shortcode 'button' found, use 'page' instead; see https://mcshelby.github.io/hugo-theme-relearn/basics/migration#5180" $page.File.Filename }}
|
||||
{{- end }}
|
||||
{{- $color := .color | default "" }}
|
||||
{{- $content := .content }}
|
||||
{{- $href := (trim .href " ") | default "" }}
|
||||
{{- $style := .style | default "default" }}
|
||||
{{- if and (not $color) (eq (len $color) 0) }}
|
||||
{{- $style = .style | default "transparent" }}
|
||||
{{- end }}
|
||||
{{- $target := .target | default "" }}
|
||||
{{- $type := .type | default "" }}
|
||||
{{- $isButton := false }}
|
||||
{{- $isLink := false }}
|
||||
{{- if or $type (strings.HasPrefix $href "javascript:") }}
|
||||
{{- $isButton = true }}
|
||||
{{- $href = substr $href (len "javascript:") }}
|
||||
{{- if not $type }}
|
||||
{{- $type = "button" }}
|
||||
{{- end }}
|
||||
{{- else if not $href }}
|
||||
{{- else if and (eq (len $target) 0) (or (strings.HasPrefix $href "http://") (strings.HasPrefix $href "https://") ) }}
|
||||
{{- $isLink = true }}
|
||||
{{- $target = "_blank" }}
|
||||
{{- if isset $page.Site.Params "externallinktarget" }}
|
||||
{{- $target = $page.Site.Params.externalLinkTarget }}
|
||||
{{- end }}
|
||||
{{- else }}
|
||||
{{- $isLink = true }}
|
||||
{{- end }}
|
||||
{{- $title := .title | default ($content) }}
|
||||
{{- if not $title }}
|
||||
{{- if eq $style "info" }}{{ $title = $style | T }}{{ end }}
|
||||
{{- if eq $style "warning" }}{{ $title = $style | T }}{{ end }}
|
||||
{{- if eq $style "note" }}{{ $title = $style | T }}{{ end }}
|
||||
{{- if eq $style "tip" }}{{ $title = $style | T }}{{ end }}
|
||||
{{- end }}
|
||||
{{- $title = trim $title " " }}
|
||||
{{- $icon := .icon | default "" }}
|
||||
{{- if and (not $icon) (eq (len $icon) 0) }}
|
||||
{{- if eq $style "info" }}{{ $icon = default "info-circle" }}{{ end }}
|
||||
{{- if eq $style "warning" }}{{ $icon = default "exclamation-triangle" }}{{ end }}
|
||||
{{- if eq $style "note" }}{{ $icon = default "exclamation-circle" }}{{ end }}
|
||||
{{- if eq $style "tip" }}{{ $icon = default "lightbulb" }}{{ end }}
|
||||
{{- end }}
|
||||
{{- $icon = trim $icon " " }}
|
||||
{{- if and $icon (not (findRE ".*?\\bfa-\\w.*?" $icon)) }}
|
||||
{{- $icon = printf "fa-fw fas fa-%s" $icon }}
|
||||
{{- end }}
|
||||
{{- $iconposition := .iconposition | default "left" }}
|
||||
{{- with $page -}}
|
||||
<span class="btn cstyle {{ if or $isButton $isLink }}interactive {{ end }}{{ $style }}"{{ if $color }} style="--VARIABLE-BOX-color: {{ $color }};"{{ end }}>
|
||||
{{- if $isButton -}}
|
||||
<button onclick="{{ $href | safeJS }}"{{ if gt (len $type) 0 }} type="{{ $type }}"{{ end }}>
|
||||
{{- else if $isLink -}}
|
||||
<a href="{{ $href }}"{{ if gt (len $target) 0 }} target="{{ $target }}"{{ end }}>
|
||||
{{- else -}}
|
||||
<span>
|
||||
{{- end }}
|
||||
{{- if and $icon (eq $iconposition "left") }}<i class="{{ $icon }}"></i>{{ end }}
|
||||
{{- if and $icon (eq $iconposition "left") $title }} {{ end }}
|
||||
{{- if $title }}<span class="title">{{- $title | safeHTML }}</span>{{ end }}
|
||||
{{- if and $icon (eq $iconposition "right") $title }} {{ end }}
|
||||
{{- if and $icon (eq $iconposition "right") }}<i class="{{ $icon }}"></i>{{ end }}
|
||||
{{- if $isButton -}}
|
||||
</button>
|
||||
{{- else if $isLink -}}
|
||||
</a>
|
||||
{{- else -}}
|
||||
</span>
|
||||
{{- end -}}
|
||||
</span>
|
||||
{{- end }}
|
||||
@@ -0,0 +1,90 @@
|
||||
{{- $page := .page }}
|
||||
{{- if and (not $page) .context }}
|
||||
{{- $page = .context }}
|
||||
{{- warnf "%q: DEPRECATED parameter 'context' for shortcode 'children' found, use 'page' instead; see https://mcshelby.github.io/hugo-theme-relearn/basics/migration#5180" $page.File.Filename }}
|
||||
{{- end }}
|
||||
{{- $showhidden := .showhidden | default false }}
|
||||
{{- if eq (printf "%T" $showhidden) "string" }}
|
||||
{{- $showhidden = (eq $showhidden "true") }}
|
||||
{{- end }}
|
||||
{{- $style := .style | default "li" }}
|
||||
{{- $depth := .depth | default 1 }}
|
||||
{{- $withDescription := .description | default false }}
|
||||
{{- if eq (printf "%T" $withDescription) "string" }}
|
||||
{{- $withDescription = (eq $withDescription "true") }}
|
||||
{{- end }}
|
||||
{{- $sortTerm := .sort | lower }}
|
||||
{{- $containerstyle := .containerstyle | default "ul" }}
|
||||
{{- if( and (not (eq $style "li") ) (eq $containerstyle "ul" ) ) }}
|
||||
{{- $containerstyle = "div" }}
|
||||
{{- end }}
|
||||
|
||||
{{- with $page }}
|
||||
{{ (printf "<%s class=\"children children-%s children-sort-%s\">" $containerstyle $style $sortTerm)|safeHTML }}
|
||||
{{- $pages := partial "pageHelper/pagesBy.html" (dict "page" . "hidden" true) }}
|
||||
{{- template "childs" dict "menu" $pages "containerstyle" $containerstyle "style" $style "showhidden" $showhidden "count" 1 "depth" $depth "pages" .Site.Pages "description" $withDescription "sortTerm" $sortTerm "page" . }}
|
||||
{{ (printf "</%s>" $containerstyle)|safeHTML }}
|
||||
{{- end }}
|
||||
|
||||
{{- define "childs" }}
|
||||
{{ $page := .page }}
|
||||
{{- range .menu }}
|
||||
{{- $hidden := and (or (.Params.hidden) (eq .Title "")) (not $.showhidden) }}
|
||||
{{- if not $hidden }}
|
||||
{{- if not .IsHome }}
|
||||
{{- if hasPrefix $.style "h" }}
|
||||
{{- $num := sub ( int (trim $.style "h") ) 1 }}
|
||||
{{- $numn := add $num $.count }}
|
||||
{{ (printf "<h%d>" $numn)|safeHTML }}{{ if .RelPermalink }}<a href="{{ partial "relLangPrettyUglyURL.hugo" (dict "to" .) }}">{{ .Title }}</a>{{ else }}<span>{{ .Title }}</span>{{ end }}{{ (printf "</h%d>" $numn)|safeHTML }}
|
||||
{{- if $.description }}
|
||||
{{- if .Description -}}
|
||||
<p>{{ .Description }}</p>
|
||||
{{- else -}}
|
||||
<p>{{ .Summary }}</p>
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
|
||||
{{- else if eq $.style "li" }}
|
||||
{{ (printf "<%s>" $.style)|safeHTML }}{{ if .RelPermalink }}<a href="{{ partial "relLangPrettyUglyURL.hugo" (dict "to" .) }}">{{ .Title }}</a>{{ else }}<span>{{ .Title }}</span>{{ end }}
|
||||
{{- if $.description }}
|
||||
{{- if .Description -}}
|
||||
<p>{{ .Description }}</p>
|
||||
{{- else -}}
|
||||
<p>{{ .Summary }}</p>
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
|
||||
{{- else }}
|
||||
{{ (printf "<%s>" $.style)|safeHTML }}{{ if .RelPermalink }}<a href="{{ partial "relLangPrettyUglyURL.hugo" (dict "to" .) }}">{{ .Title }}</a>{{ else }}<span>{{ .Title }}</span>{{ end }}{{ (printf "</%s>" $.style)|safeHTML }}
|
||||
{{- if $.description }}
|
||||
{{- if .Description -}}
|
||||
<p>{{ .Description }}</p>
|
||||
{{- else -}}
|
||||
<p>{{ .Summary }}</p>
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{- if lt $.count $.depth }}
|
||||
|
||||
{{- if eq $.style "li" }}
|
||||
{{- (printf "<%s>" $.containerstyle)|safeHTML }}
|
||||
{{- end }}
|
||||
|
||||
{{- $pages := partial "pageHelper/pagesBy.html" (dict "page" . "hidden" true) }}
|
||||
{{- template "childs" dict "menu" $pages "containerstyle" $.containerstyle "style" $.style "showhidden" $.showhidden "count" (add $.count 1) "depth" $.depth "pages" $.pages "description" $.description "sortTerm" $.sortTerm "page" $page }}
|
||||
|
||||
{{- if eq $.style "li" }}
|
||||
{{- (printf "</%s>" $.containerstyle)|safeHTML }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
|
||||
{{- if not .IsHome }}
|
||||
{{- if eq $.style "li" }}
|
||||
{{- (printf "</%s>" $.style)|safeHTML -}}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
@@ -0,0 +1,26 @@
|
||||
{{- $page := .page }}
|
||||
{{- if and (not $page) .context }}
|
||||
{{- $page = .context }}
|
||||
{{- warnf "%q: DEPRECATED parameter 'context' for shortcode 'expand' found, use 'page' instead; see https://mcshelby.github.io/hugo-theme-relearn/basics/migration#5180" $page.File.Filename }}
|
||||
{{- end }}
|
||||
{{- $content := .content }}
|
||||
{{- $title := .title | default (T "Expand-title") }}
|
||||
{{- $title = trim $title " " }}
|
||||
{{- $expanded := .open | default false }}
|
||||
{{- if eq (printf "%T" $expanded) "string" }}
|
||||
{{- $expanded = (eq $expanded "true") }}
|
||||
{{- end }}
|
||||
{{- $id := cond (or (eq .id nil) (eq .id "")) (partial "make-random-md5.hugo" $page) .id }}
|
||||
{{- with $page }}
|
||||
<div class="expand">
|
||||
<input type="checkbox" id="R-expand-{{ $id }}" aria-controls="R-expandcontent-{{ $id }}" {{ if $expanded }} checked{{ end }}>
|
||||
<label class="expand-label" for="R-expand-{{ $id }}" >
|
||||
<i class="fa-fw fas fa-chevron-down"></i>
|
||||
<i class="fa-fw fas fa-chevron-right"></i>
|
||||
{{ $title | .RenderString }}
|
||||
</label>
|
||||
<div id="R-expandcontent-{{ $id }}" class="expand-content">
|
||||
{{ if ne "<" (substr (strings.TrimLeft " \n\r\t" $content) 0 1) }}<p>{{ end }}<!-- we add a DOM element here if there is none to make collapsing marings work -->
|
||||
{{ $content | safeHTML }}</div><!-- no line break allowed here because of awkward behavior of Hugo 110 or this theme when tag shortcode is called standalone outside of tags shortcode ? -->
|
||||
</div>
|
||||
{{- end }}
|
||||
@@ -0,0 +1,109 @@
|
||||
{{- $page := .page }}
|
||||
{{- if and (not $page) .context }}
|
||||
{{- $page = .context }}
|
||||
{{- warnf "%q: DEPRECATED parameter 'context' for shortcode 'highlight' found, use 'page' instead; see https://mcshelby.github.io/hugo-theme-relearn/basics/migration#5180" $page.File.Filename }}
|
||||
{{- end }}
|
||||
{{- $attributes := dict }}
|
||||
{{- $otherAttributes := dict }}
|
||||
{{- $content := "" }}
|
||||
{{- $options := dict }}
|
||||
{{- $otherOptions := dict }}
|
||||
{{- $type := "" }}
|
||||
{{- range $k, $v := . }}
|
||||
{{- if eq $k "context" }}
|
||||
{{- else if eq $k "page" }}
|
||||
{{- else if eq $k "attributes" }}
|
||||
{{- $attributes = $v }}
|
||||
{{- else if eq $k "content" }}
|
||||
{{- $content = trim $v "\n\r" }}
|
||||
{{- else if eq $k "options" }}
|
||||
{{- if eq (printf "%T" $v) "string" }}
|
||||
{{- range (split $v ",") }}
|
||||
{{- $pair := split . "=" }}
|
||||
{{- $options = $options | merge (dict (index $pair 0) (index $pair 1)) }}
|
||||
{{- end }}
|
||||
{{- else }}
|
||||
{{- $options = $v }}
|
||||
{{- end }}
|
||||
{{- else if eq $k "type" }}
|
||||
{{- $type = $v }}
|
||||
{{- else if eq $k "title" }}
|
||||
{{- $otherAttributes = $otherAttributes | merge (dict $k $v) }}
|
||||
{{- else if eq $k "wrap" }}
|
||||
{{- $otherAttributes = $otherAttributes | merge (dict $k $v) }}
|
||||
{{- else }}
|
||||
{{- $otherOptions = $otherOptions | merge (dict $k $v) }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
|
||||
{{- /* separate attributes from options */}}
|
||||
{{- $hl_inline := false }}
|
||||
{{- if and (isset $page.Params "markup") (isset $page.Params.markup "highlight") (isset $page.Params.markup.highlight "hl_inline") }}
|
||||
{{- $hl_inline = $page.Params.markup.highlight.hl_inline }}
|
||||
{{- end }}
|
||||
{{- $options = $options | merge $otherOptions }}
|
||||
{{- $otherOptions := dict }}
|
||||
{{- range $k, $v := $options }}
|
||||
{{- if eq $k "hl_inline" }}
|
||||
{{- $hl_inline = $v }}
|
||||
{{- $otherOptions = (dict $k $v) | merge $otherOptions }}
|
||||
{{- else if eq $k "title" }}
|
||||
{{- $otherAttributes = (dict $k $v) | merge $otherAttributes }}
|
||||
{{- else if eq $k "wrap" }}
|
||||
{{- $otherAttributes = (dict $k $v) | merge $otherAttributes }}
|
||||
{{- else }}
|
||||
{{- $otherOptions = (dict $k $v) | merge $otherOptions }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{- $options = $otherOptions }}
|
||||
|
||||
{{- /* separate shortcode attributes from rest */}}
|
||||
{{- $title := "" }}
|
||||
{{- $wrap := true }}
|
||||
{{- if isset $page.Site.Params "highlightwrap" }}
|
||||
{{- $wrap = $page.Site.Params.highlightWrap }}
|
||||
{{- end }}
|
||||
{{- if isset $page.Params "highlightwrap" }}
|
||||
{{- $wrap = $page.Params.highlightWrap }}
|
||||
{{- end }}
|
||||
{{- $attributes = $attributes | merge $otherAttributes }}
|
||||
{{- $otherAttributes := dict }}
|
||||
{{- range $k, $v := $attributes }}
|
||||
{{- if eq $k "title" }}
|
||||
{{- $title = $v }}
|
||||
{{- else if eq $k "wrap" }}
|
||||
{{- $wrap = $v }}
|
||||
{{- else }}
|
||||
{{- $otherAttributes = (dict $k $v) | merge $otherAttributes }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{- $attributes = $otherAttributes }}
|
||||
{{- if eq (printf "%T" $wrap) "string" }}
|
||||
{{- $wrap = (eq $wrap "true") }}
|
||||
{{- end }}
|
||||
|
||||
{{- /* enrich attributes */}}
|
||||
{{- $attributes = merge $attributes (dict "class" (delimit (append (index $attributes "class" | default slice) "highlight" slice) " ")) }}
|
||||
{{- if $wrap }}
|
||||
{{- $attributes = merge $options (dict "class" (delimit (append (index $attributes "class" | default slice) "wrap-code" slice) " ")) }}
|
||||
{{- end }}
|
||||
|
||||
{{- /* print da shtuff */}}
|
||||
{{- $div := slice }}
|
||||
{{- range $k, $v := $attributes }}
|
||||
{{- if $v }}
|
||||
{{- $div = $div | append (printf "%s=%q" $k $v | safeHTMLAttr) }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{- $content = highlight $content $type $options }}
|
||||
{{- $content = replaceRE "^([\\s\\n\\r]*)(<pre\\s+?[\\s\\S]*)$" "${1}<div class=\"highlight\">${2}</div>" $content }}
|
||||
{{- $content = replaceRE "(class=\")([^\"]*)\"" (printf "%s" (delimit $div " ")) $content 1 }}
|
||||
{{- if and $title (not $hl_inline) }}
|
||||
{{- partial "shortcodes/tab.html" (dict
|
||||
"page" $page
|
||||
"title" $title
|
||||
"content" $content
|
||||
)}}
|
||||
{{- else }}
|
||||
{{- $content | safeHTML }}
|
||||
{{- end }}
|
||||
@@ -0,0 +1,15 @@
|
||||
{{- $page := .page }}
|
||||
{{- if and (not $page) .context }}
|
||||
{{- $page = .context }}
|
||||
{{- warnf "%q: DEPRECATED parameter 'context' for shortcode 'icon' found, use 'page' instead; see https://mcshelby.github.io/hugo-theme-relearn/basics/migration#5180" $page.File.Filename }}
|
||||
{{- end }}
|
||||
{{- $icon := .icon | default "" }}
|
||||
{{- $icon = trim $icon " " }}
|
||||
{{- if and $icon (not (findRE ".*?\\bfa-\\w.*?" $icon)) }}
|
||||
{{- $icon = printf "fa-fw fas fa-%s" $icon }}
|
||||
{{- end }}
|
||||
{{- with $page }}
|
||||
{{- if $icon -}}
|
||||
<i class="{{ $icon }}"></i>
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
104
themes/hugo-theme-relearn/layouts/partials/shortcodes/image.html
Normal file
104
themes/hugo-theme-relearn/layouts/partials/shortcodes/image.html
Normal file
@@ -0,0 +1,104 @@
|
||||
{{- $page := .page }}
|
||||
{{- if and (not $page) .context }}
|
||||
{{- $page = .context }}
|
||||
{{- warnf "%q: DEPRECATED parameter 'context' for shortcode 'image' found, use 'page' instead; see https://mcshelby.github.io/hugo-theme-relearn/basics/migration#5180" $page.File.Filename }}
|
||||
{{- end }}
|
||||
{{- $url := .url }}
|
||||
{{- $title := .title }}
|
||||
{{- $alt := .alt }}
|
||||
{{- $effects := dict "border" false "lazy" true "lightbox" true "shadow" false }}
|
||||
{{- if $page.Site.Params.imageeffects }}
|
||||
{{- $effects = merge $effects $page.Site.Params.imageeffects }}
|
||||
{{- end }}
|
||||
{{- if $page.Params.imageEffects }}
|
||||
{{- $effects = merge $effects $page.Params.imageEffects }}
|
||||
{{- end }}
|
||||
{{- $height := "auto" }}
|
||||
{{- $width := "auto" }}
|
||||
{{- $dest_url := urls.Parse $url }}
|
||||
{{- $dest_path := $dest_url.Path }}
|
||||
{{- $image := "" }}
|
||||
{{- if not $dest_url.IsAbs }}
|
||||
{{- with or
|
||||
($page.Resources.Get $dest_url.Path)
|
||||
(resources.Get $dest_url.Path)
|
||||
}}
|
||||
{{- $image = . }}
|
||||
{{- end }}
|
||||
{{- with $image }}
|
||||
{{- $url = $image.RelPermalink }}
|
||||
{{- with $dest_url.RawQuery }}
|
||||
{{- $url = printf "%s?%s" $url . }}
|
||||
{{- end }}
|
||||
{{- with $dest_url.Fragment }}
|
||||
{{- $url = printf "%s#%s" $url . }}
|
||||
{{- end }}
|
||||
{{- else }}
|
||||
{{- if eq $page.Site.Params.image.errorlevel "warning" }}
|
||||
{{- warnf "%q: image '%s' is not a resource but linked anyways" $page.File.Filename .url }}
|
||||
{{- else if eq $page.Site.Params.image.errorlevel "error" }}
|
||||
{{- errorf "%q: image '%s' is not a resource" $page.File.Filename .url }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{- if $dest_url.RawQuery }}
|
||||
{{- if $dest_url.Query.Has "classes" }}
|
||||
{{- $classes := slice | append (split ($dest_url.Query.Get "classes") ",") }}
|
||||
{{- range $classes }}
|
||||
{{- $k := . }}
|
||||
{{- $v := true }}
|
||||
{{- if strings.HasPrefix $k "no" }}
|
||||
{{- $k := strings.TrimPrefix "no" $k }}
|
||||
{{- $v := false }}
|
||||
{{- end }}
|
||||
{{- $effects = merge $effects (dict $k $v) }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{- if $dest_url.Query.Has "featherlight" }}
|
||||
{{- warnf "%q: DEPRECATED usage of 'featherlight' image CSS class found, use 'lightbox' instead; see https://mcshelby.github.io/hugo-theme-relearn/basics/migration#5110" $page.File.Filename }}
|
||||
{{- $effects = merge $effects (dict "lightbox" (ne ($dest_url.Query.Get "featherlight") "false")) }}
|
||||
{{- end }}
|
||||
{{- range $k, $v := $effects }}
|
||||
{{- if $dest_url.Query.Has $k }}
|
||||
{{- $effects = merge $effects (dict $k (ne ($dest_url.Query.Get $k) "false")) }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{- with $dest_url.Query.Get "height" }}
|
||||
{{- $height = . }}
|
||||
{{- end }}
|
||||
{{- with $dest_url.Query.Get "width" }}
|
||||
{{- $width = . }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{- $classes := slice }}
|
||||
{{- range $k, $v := $effects }}
|
||||
{{- $c := printf "%s%s" (cond $v "" "no") $k }}
|
||||
{{- $classes = $classes | append $c }}
|
||||
{{- end }}
|
||||
{{- $id := cond (or (eq .id nil) (eq .id "")) (partial "make-random-md5.hugo" $page) .id }}
|
||||
{{- $attributes := merge .attributes (dict "alt" $alt "src" $url "title" $title) }}
|
||||
{{- if $effects.lazy }}
|
||||
{{- $attributes = merge $attributes (dict "loading" "lazy") }}
|
||||
{{- end }}
|
||||
{{- if $effects.lightbox -}}
|
||||
<a href="#R-image-{{ $id }}" class="lightbox-link">
|
||||
{{- end }}
|
||||
{{- $attributes_figure := merge $attributes (dict "class" (delimit (append (index $attributes "class" | default slice) "figure-image" $classes) " ")) }}
|
||||
{{- $attributes_figure = merge $attributes_figure (dict "style" (delimit (slice (index $attributes "style") (printf "height: %s; width: %s;" $height $width)) " ")) -}}
|
||||
<img
|
||||
{{- range $k, $v := $attributes_figure }}
|
||||
{{- if $v }}
|
||||
{{- printf " %s=%q" $k $v | safeHTMLAttr }}
|
||||
{{- end }}
|
||||
{{- end }}>
|
||||
{{- if $effects.lightbox -}}
|
||||
</a>
|
||||
<a href="javascript:history.back();" class="lightbox-back" id="R-image-{{ $id }}">
|
||||
{{- $attributes_lightbox := merge $attributes (dict "class" (delimit (append (index $attributes "class" | default slice) "lightbox-image" $classes) " ")) -}}
|
||||
<img
|
||||
{{- range $k, $v := $attributes_lightbox }}
|
||||
{{- if $v }}
|
||||
{{- printf " %s=%q" $k $v | safeHTMLAttr }}
|
||||
{{- end }}
|
||||
{{- end }}></a>
|
||||
{{- end }}
|
||||
@@ -0,0 +1,19 @@
|
||||
{{- $page := .page }}
|
||||
{{- if and (not $page) .context }}
|
||||
{{- $page = .context }}
|
||||
{{- warnf "%q: DEPRECATED parameter 'context' for shortcode 'include' found, use 'page' instead; see https://mcshelby.github.io/hugo-theme-relearn/basics/migration#5180" $page.File.Filename }}
|
||||
{{- end }}
|
||||
{{- $file := .file }}
|
||||
{{- $hideFirstHeading := .hidefirstheading | default false }}
|
||||
{{- if eq (printf "%T" $hideFirstHeading) "string" }}
|
||||
{{- $hideFirstHeading = (eq $hideFirstHeading "true") }}
|
||||
{{- end }}
|
||||
{{- if and (gt (len (trim $file " ")) 0) (fileExists $file) }}
|
||||
{{- if $hideFirstHeading }}<div class="include hide-first-heading">
|
||||
|
||||
{{ end }}
|
||||
{{- with $page }}
|
||||
{{- $file | readFile | safeHTML }}
|
||||
{{- end }}
|
||||
{{- if $hideFirstHeading }}</div>{{ end }}
|
||||
{{- end }}
|
||||
@@ -0,0 +1,82 @@
|
||||
{{- $page := .page }}
|
||||
{{- if and (not $page) .context }}
|
||||
{{- $page = .context }}
|
||||
{{- warnf "%q: DEPRECATED parameter 'context' for shortcode 'link' found, use 'page' instead; see https://mcshelby.github.io/hugo-theme-relearn/basics/migration#5180" $page.File.Filename }}
|
||||
{{- end }}
|
||||
{{- $url := .url }}
|
||||
{{- if strings.HasPrefix $url "HAHAHUGOSHORTCODE" }}
|
||||
{{- warnf "%q: WARNING you must call the ref / relref shortcode with '%% %%' instead of '< >' to work correctly for the anchor target attribute" $page.File.Filename }}
|
||||
{{- end }}
|
||||
{{- $attributes := dict }}
|
||||
{{- $title := .title | default "" }}
|
||||
{{- $title = trim $title " " }}
|
||||
{{- $attributes = $attributes | merge (dict "title" $title) }}
|
||||
{{- $content := .content }}
|
||||
{{- $target := .target | default "" }}
|
||||
{{- $u := urls.Parse $url }}
|
||||
{{- $href := $u.String }}
|
||||
{{- $path := $u.Path }}
|
||||
{{- if $u.IsAbs }}
|
||||
{{- $target = "_blank" }}
|
||||
{{- if isset $page.Site.Params "externallinktarget" }}
|
||||
{{- $target = $page.Site.Params.externalLinkTarget }}
|
||||
{{- end }}
|
||||
{{- $attributes = $attributes | merge (dict "target" $target) }}
|
||||
{{- else }}
|
||||
{{- $linkPage := "" }}
|
||||
{{- if $path }}
|
||||
{{- with or
|
||||
($page.Page.GetPage $path)
|
||||
($page.Page.Resources.Get $path)
|
||||
(resources.Get $path)
|
||||
}}
|
||||
{{- $linkPage = . }}
|
||||
{{- else }}
|
||||
{{- /* is it a link into another translation? */}}
|
||||
{{- if strings.HasPrefix $path "/" }}
|
||||
{{- range $page.AllTranslations }}
|
||||
{{- $lang := .Language.Lang }}
|
||||
{{- $prefix := printf "/%s" $lang }}
|
||||
{{- $suffix := strings.TrimPrefix $prefix $path | default "/" }}
|
||||
{{- /* with the second check we check if the prefix was finished;
|
||||
eg. /pir/index.html vs. /pirate/index.html, were the latter is
|
||||
an external address outside of this site */}}
|
||||
{{- if and (strings.HasPrefix $path $prefix) (strings.HasPrefix $suffix "/") }}
|
||||
{{- with or
|
||||
(.GetPage $suffix)
|
||||
(.Resources.Get $suffix)
|
||||
(resources.Get $suffix)
|
||||
}}
|
||||
{{- $linkPage = . }}
|
||||
{{- break }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{- else }}
|
||||
{{- $linkPage = $page.Page }}
|
||||
{{- end }}
|
||||
{{- with $linkPage }}
|
||||
{{- $href = partial "relLangPrettyUglyURL.hugo" (dict "to" .) }}
|
||||
{{- with $u.RawQuery }}
|
||||
{{- $href = printf "%s?%s" $href . }}
|
||||
{{- end }}
|
||||
{{- with $u.Fragment }}
|
||||
{{- $href = printf "%s#%s" $href . }}
|
||||
{{- end }}
|
||||
{{- else }}
|
||||
{{- if eq $page.Site.Params.link.errorlevel "warning" }}
|
||||
{{- warnf "%q: link '%s' is not a page but linked anyways" $page.File.Filename $url }}
|
||||
{{- else if eq $page.Site.Params.link.errorlevel "error" }}
|
||||
{{- errorf "%q: link '%s' is not a page" $page.File.Filename $url }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{- $attributes = $attributes | merge (dict "href" $href) -}}
|
||||
<a
|
||||
{{- range $k, $v := $attributes }}
|
||||
{{- if $v }}
|
||||
{{- printf " %s=%q" $k $v | safeHTMLAttr }}
|
||||
{{- end }}
|
||||
{{- end }}>{{ $content | safeHTML }}</a>
|
||||
@@ -0,0 +1,32 @@
|
||||
{{- $page := .page }}
|
||||
{{- if and (not $page) .context }}
|
||||
{{- $page = .context }}
|
||||
{{- warnf "%q: DEPRECATED parameter 'context' for shortcode 'math' found, use 'page' instead; see https://mcshelby.github.io/hugo-theme-relearn/basics/migration#5180" $page.File.Filename }}
|
||||
{{- end }}
|
||||
{{- $content := .content }}
|
||||
{{- $align := .align | default "center" }}
|
||||
|
||||
{{- /* separate shortcode attributes from rest */}}
|
||||
{{- $attributes := .attributes | default dict }}
|
||||
{{- $otherAttributes := dict }}
|
||||
{{- range $k, $v := $attributes }}
|
||||
{{- if eq $k "align" }}
|
||||
{{- else }}
|
||||
{{- $otherAttributes = (dict $k $v) | merge $otherAttributes }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{- $attributes = $otherAttributes }}
|
||||
|
||||
{{- /* enrich attributes */}}
|
||||
{{- $attributes = merge $attributes (dict "class" (delimit (append (index $attributes "class" | default slice) "math" slice) " ")) }}
|
||||
{{- $attributes = merge $attributes (dict "class" (delimit (append (index $attributes "class" | default slice) (printf "align-%s" $align) slice) " ")) }}
|
||||
|
||||
{{- with $page }}
|
||||
<span
|
||||
{{- range $k, $v := $attributes }}
|
||||
{{- if $v }}
|
||||
{{- printf " %s=%q" $k $v | safeHTMLAttr }}
|
||||
{{- end }}
|
||||
{{- end }}>{{ $content | safeHTML }}</span>
|
||||
{{- .Store.Set "hasMathJax" true }}
|
||||
{{- end }}
|
||||
@@ -0,0 +1,47 @@
|
||||
{{- $page := .page }}
|
||||
{{- if and (not $page) .context }}
|
||||
{{- $page = .context }}
|
||||
{{- warnf "%q: DEPRECATED parameter 'context' for shortcode 'mermaid' found, use 'page' instead; see https://mcshelby.github.io/hugo-theme-relearn/basics/migration#5180" $page.File.Filename }}
|
||||
{{- end }}
|
||||
{{- $content := .content }}
|
||||
{{- $align := .align | default "center" }}
|
||||
{{- $zoom := $page.Site.Params.mermaidZoom | default false }}
|
||||
{{- with $page.Params.mermaidZoom }}
|
||||
{{- $zoom = . }}
|
||||
{{- if eq (printf "%T" .) "string" }}
|
||||
{{- $zoom = (eq . "true") }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{- with .zoom }}
|
||||
{{- $zoom = . }}
|
||||
{{- if eq (printf "%T" .) "string" }}
|
||||
{{- $zoom = (eq . "true") }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
|
||||
{{- /* separate shortcode attributes from rest */}}
|
||||
{{- $attributes := .attributes | default dict }}
|
||||
{{- $otherAttributes := dict }}
|
||||
{{- range $k, $v := $attributes }}
|
||||
{{- if eq $k "align" }}
|
||||
{{- else if eq $k "zoom" }}
|
||||
{{- else }}
|
||||
{{- $otherAttributes = (dict $k $v) | merge $otherAttributes }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{- $attributes = $otherAttributes }}
|
||||
|
||||
{{- /* enrich attributes */}}
|
||||
{{- $attributes = merge $attributes (dict "class" (delimit (append (index $attributes "class" | default slice) "mermaid" slice) " ")) }}
|
||||
{{- $attributes = merge $attributes (dict "class" (delimit (append (index $attributes "class" | default slice) (printf "align-%s" $align) slice) " ")) }}
|
||||
{{- $attributes = merge $attributes (dict "class" (delimit (append (index $attributes "class" | default slice) (printf "%s" (cond $zoom "zoomable" "")) slice) " ")) }}
|
||||
|
||||
{{- with $page }}
|
||||
<pre
|
||||
{{- range $k, $v := $attributes }}
|
||||
{{- if $v }}
|
||||
{{- printf " %s=%q" $k $v | safeHTMLAttr }}
|
||||
{{- end }}
|
||||
{{- end }}>{{ replaceRE "'" "'" ( replaceRE """ "\"" ( $content | safeHTML ) ) }}</pre>
|
||||
{{- .Store.Set "hasMermaid" true }}
|
||||
{{- end }}
|
||||
@@ -0,0 +1,35 @@
|
||||
{{- $page := .page }}
|
||||
{{- if and (not $page) .context }}
|
||||
{{- $page = .context }}
|
||||
{{- warnf "%q: DEPRECATED parameter 'context' for shortcode 'notice' found, use 'page' instead; see https://mcshelby.github.io/hugo-theme-relearn/basics/migration#5180" $page.File.Filename }}
|
||||
{{- end }}
|
||||
{{- $color := .color | default "" }}
|
||||
{{- $content := .content }}
|
||||
{{- $style := .style | default "default" }}
|
||||
{{- $title := .title }}
|
||||
{{- if not $title }}
|
||||
{{- if eq $style "info" }}{{ $title = $style | T }}{{ end }}
|
||||
{{- if eq $style "warning" }}{{ $title = $style | T }}{{ end }}
|
||||
{{- if eq $style "note" }}{{ $title = $style | T }}{{ end }}
|
||||
{{- if eq $style "tip" }}{{ $title = $style | T }}{{ end }}
|
||||
{{- end }}
|
||||
{{- $title = trim $title " " }}
|
||||
{{- $icon := .icon | default "" }}
|
||||
{{- if and (not $icon) (eq (len $icon) 0) }}
|
||||
{{- if eq $style "info" }}{{ $icon = default "info-circle" }}{{ end }}
|
||||
{{- if eq $style "warning" }}{{ $icon = default "exclamation-triangle" }}{{ end }}
|
||||
{{- if eq $style "note" }}{{ $icon = default "exclamation-circle" }}{{ end }}
|
||||
{{- if eq $style "tip" }}{{ $icon = default "lightbulb" }}{{ end }}
|
||||
{{- end }}
|
||||
{{- $icon = trim $icon " " }}
|
||||
{{- if and $icon (not (findRE ".*?\\bfa-\\w.*?" $icon)) }}
|
||||
{{- $icon = printf "fa-fw fas fa-%s" $icon }}
|
||||
{{- end }}
|
||||
{{- with $page }}
|
||||
<div class="box notices cstyle {{ $style }}"{{ if $color }} style="--VARIABLE-BOX-color: {{ $color }};"{{ end }}>
|
||||
<div class="box-label">{{ if $icon }}<i class="{{ $icon }}"></i>{{ end }}{{ if and $icon $title }} {{ end }}{{ $title | .RenderString }}</div>
|
||||
<div class="box-content">
|
||||
{{ if ne "<" (substr (strings.TrimLeft " \n\r\t" $content) 0 1) }}<p>{{ end }}<!-- we add a DOM element here if there is none to make collapsing marings work -->
|
||||
{{ $content | safeHTML }}</div><!-- no line break allowed here because of awkward behavior of Hugo 110 or this theme when tag shortcode is called standalone outside of tags shortcode ? -->
|
||||
</div>
|
||||
{{- end }}
|
||||
@@ -0,0 +1,25 @@
|
||||
{{- $page := .page }}
|
||||
{{- if and (not $page) .context }}
|
||||
{{- $page = .context }}
|
||||
{{- warnf "%q: DEPRECATED parameter 'context' for shortcode 'openapi' found, use 'page' instead; see https://mcshelby.github.io/hugo-theme-relearn/basics/migration#5180" $page.File.Filename }}
|
||||
{{- end }}
|
||||
{{- $src := .src }}
|
||||
{{- $spec := "" }}
|
||||
{{- $id := cond (or (eq .id nil) (eq .id "")) (partial "make-random-md5.hugo" $page) .id }}
|
||||
{{- with $page }}
|
||||
{{- with or
|
||||
(.Resources.Get $src)
|
||||
(resources.Get $src)
|
||||
}}
|
||||
{{- $spec = .Content }}
|
||||
{{- end }}
|
||||
<div class="sc-openapi-wrapper is-loading helper-loading-container">
|
||||
<div
|
||||
class="sc-openapi-container"
|
||||
id="R-openapi-{{ $id }}"
|
||||
data-openapi-url="{{ $src }}"
|
||||
data-openapi-spec="{{ $spec | safeHTMLAttr }}"
|
||||
></div>
|
||||
</div>
|
||||
{{- .Store.Set "hasOpenApi" true }}
|
||||
{{- end }}
|
||||
@@ -0,0 +1,60 @@
|
||||
{{- $page := .page }}
|
||||
{{- if and (not $page) .context }}
|
||||
{{- $page = .context }}
|
||||
{{- warnf "%q: DEPRECATED parameter 'context' for shortcode 'resources' found, use 'page' instead; see https://mcshelby.github.io/hugo-theme-relearn/basics/migration#5180" $page.File.Filename }}
|
||||
{{- end }}
|
||||
{{- $color := .color | default "" }}
|
||||
{{- $content := .content }}
|
||||
{{- $style := .style | default "default" }}
|
||||
{{- if and (not $color) (eq (len $color) 0) }}
|
||||
{{- $style = .style | default "transparent" }}
|
||||
{{- end }}
|
||||
{{- $title := .title }}
|
||||
{{- if not $title }}
|
||||
{{- if eq $style "info" }}{{ $title = $style | T }}{{ end }}
|
||||
{{- if eq $style "warning" }}{{ $title = $style | T }}{{ end }}
|
||||
{{- if eq $style "note" }}{{ $title = $style | T }}{{ end }}
|
||||
{{- if eq $style "tip" }}{{ $title = $style | T }}{{ end }}
|
||||
{{- end }}
|
||||
{{- $title = trim ($title | default ("Attachments-label" | T)) " " }}
|
||||
{{- $icon := .icon | default "" }}
|
||||
{{- if and (not $icon) (eq (len $icon) 0) }}
|
||||
{{- $icon = "paperclip" }}
|
||||
{{- if eq $style "info" }}{{ $icon = default "info-circle" }}{{ end }}
|
||||
{{- if eq $style "warning" }}{{ $icon = default "exclamation-triangle" }}{{ end }}
|
||||
{{- if eq $style "note" }}{{ $icon = default "exclamation-circle" }}{{ end }}
|
||||
{{- if eq $style "tip" }}{{ $icon = default "lightbulb" }}{{ end }}
|
||||
{{- end }}
|
||||
{{- $icon = trim $icon " " }}
|
||||
{{- if and $icon (not (findRE ".*?\\bfa-\\w.*?" $icon)) }}
|
||||
{{- $icon = printf "fa-fw fas fa-%s" $icon }}
|
||||
{{- end }}
|
||||
{{- $sort := .sort | default "asc" }}
|
||||
{{- $pattern := .pattern | default "" }}
|
||||
{{- with $page }}
|
||||
{{- if eq .BundleType "" }}
|
||||
{{- warnf "%q: UNSUPPORTED usage of 'resources' shortcode found, use a page bundle instead" $page.File.Filename }}
|
||||
{{- end }}
|
||||
<div class="box attachments cstyle {{ $style }}"{{ if $color }} style="--VARIABLE-BOX-color: {{ $color }};"{{ end }}>
|
||||
<div class="box-label">{{ if $icon }}<i class="{{ $icon }}"></i>{{ end }}{{ if and $icon $title }} {{ end }}{{ $title | .RenderString }}</div>
|
||||
<ul class="box-content attachments-files">
|
||||
{{- range sort .Resources "Name" $sort }}
|
||||
{{- if findRE $pattern .Name }}
|
||||
{{- $size := len .Content }}
|
||||
{{- $unit := "Byte-symbol" }}
|
||||
{{- if ge $size 1024 }}
|
||||
{{- $size = div $size 1024 }}
|
||||
{{- $unit = "Kilobyte-symbol" }}
|
||||
{{- end }}
|
||||
{{- if ge $size 1024 }}
|
||||
{{- $size = div $size 1024 }}
|
||||
{{- $unit = "Megabyte-symbol" }}
|
||||
{{- end }}
|
||||
{{- $unitsymbol := $unit | T }}
|
||||
<li><a href="{{ .RelPermalink }}">{{.Name}}</a> ({{$size}} {{$unitsymbol}})</li>
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
</ul>
|
||||
{{- $content }}
|
||||
</div>
|
||||
{{- end }}
|
||||
@@ -0,0 +1,17 @@
|
||||
{{- $page := .page }}
|
||||
{{- if and (not $page) .context }}
|
||||
{{- $page = .context }}
|
||||
{{- warnf "%q: DEPRECATED parameter 'context' for shortcode 'siteparam' found, use 'page' instead; see https://mcshelby.github.io/hugo-theme-relearn/basics/migration#5180" $page.File.Filename }}
|
||||
{{- end }}
|
||||
{{- $paramNames := split .name "." }}
|
||||
{{- with $page }}
|
||||
{{- $params := .Site.Params }}
|
||||
{{- range $paramName := $paramNames }}
|
||||
{{- with $params }}
|
||||
{{- $params = index . (lower $paramName) }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{- with $params }}
|
||||
{{- . }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
@@ -0,0 +1,11 @@
|
||||
{{- $page := .page }}
|
||||
{{- if and (not $page) .context }}
|
||||
{{- $page = .context }}
|
||||
{{- warnf "%q: DEPRECATED parameter 'context' for shortcode 'swagger' found, use 'page' instead; see https://mcshelby.github.io/hugo-theme-relearn/basics/migration#5180" $page.File.Filename }}
|
||||
{{- end }}
|
||||
{{ warnf "%q: DEPRECATED shortcode `swagger` found, use `openapi` instead; see https://mcshelby.github.io/hugo-theme-relearn/basics/migration#5130" $page.File.Filename }}
|
||||
{{- partial "shortcodes/openapi.html" (dict
|
||||
"page" $page
|
||||
"src" .src
|
||||
"id" .id
|
||||
) }}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user