mirror of
https://github.com/adityatelange/hugo-PaperMod.git
synced 2024-12-24 05:55:53 -05:00
Fix Spacing in overall repo
This commit is contained in:
parent
dae7f2b8a1
commit
196b82645e
@ -1,3 +1,3 @@
|
||||
{{ define "main" }}
|
||||
{{- define "main" }}
|
||||
<div class="not-found">404</div>
|
||||
{{ end }}{{/* end main */}}
|
||||
{{- end }}{{/* end main */ -}}
|
||||
|
@ -20,7 +20,7 @@
|
||||
<div class="archive-month">
|
||||
<h3 class="archive-month-header">{{- .Key }}<sup class="archive-count"> {{ len .Pages }}</sup></h3>
|
||||
<div class="archive-posts">
|
||||
{{- range .Pages }}
|
||||
{{- range .Pages }}
|
||||
{{- if eq .Kind "page" }}
|
||||
<div class="archive-entry">
|
||||
<h3 class="archive-entry-title">
|
||||
@ -40,4 +40,4 @@
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
|
||||
{{- end }}{{/* end main */}}
|
||||
{{- end }}{{/* end main */}}
|
||||
|
@ -13,12 +13,11 @@
|
||||
{{- print " dark" }}
|
||||
{{- end -}}
|
||||
" id="top">
|
||||
{{- partialCached "header.html" . .Page}}
|
||||
{{- partialCached "header.html" . .Page -}}
|
||||
<main class="main">
|
||||
{{- block "main" . }}
|
||||
{{- end }}
|
||||
{{- block "main" . }}{{ end }}
|
||||
</main>
|
||||
{{- partialCached "footer.html" . .Type .Layout .Params }}
|
||||
{{ partialCached "footer.html" . .Type .Layout .Params -}}
|
||||
</body>
|
||||
|
||||
</html>
|
||||
|
@ -20,15 +20,15 @@
|
||||
|
||||
{{- if .IsHome }}
|
||||
{{- $pages = where site.RegularPages "Type" "in" site.Params.mainSections }}
|
||||
{{- end}}
|
||||
{{- end }}
|
||||
|
||||
{{ $paginator := .Paginate $pages }}
|
||||
{{- $paginator := .Paginate $pages }}
|
||||
|
||||
{{- if and .IsHome .Site.Params.homeInfoParams (eq $paginator.PageNumber 1) }}
|
||||
{{- partial "home_info.html" . }}
|
||||
{{- end }}
|
||||
|
||||
{{ $term := .Data.Term}}
|
||||
{{- $term := .Data.Term }}
|
||||
{{- range $index, $page := $paginator.Pages }}
|
||||
|
||||
{{- $class := "post-entry" }}
|
||||
@ -41,17 +41,17 @@
|
||||
{{- end }}
|
||||
|
||||
<article class="{{ $class }}">
|
||||
{{- $isHidden := (.Site.Params.cover.hidden | default .Site.Params.cover.hiddenInList)}}
|
||||
{{- $isHidden := (.Site.Params.cover.hidden | default .Site.Params.cover.hiddenInList) }}
|
||||
{{- partial "cover.html" (dict "cxt" . "IsHome" true "isHidden" $isHidden) }}
|
||||
<header class="entry-header">
|
||||
<h2>
|
||||
{{ .Title }}
|
||||
{{- if .Draft }}<div class="entry-isdraft"><sup> [draft]</sup></div>{{- end }}
|
||||
{{- .Title }}
|
||||
{{- if .Draft }}<div class="entry-isdraft"><sup> [draft]</sup></div>{{ end -}}
|
||||
</h2>
|
||||
</header>
|
||||
{{- if (ne (.Param "hideSummary") true)}}
|
||||
{{- if (ne (.Param "hideSummary") true) }}
|
||||
<section class="entry-content">
|
||||
<p>{{ .Summary | plainify | htmlUnescape }}{{- if .Truncated }}...{{- end -}}</p>
|
||||
<p>{{ .Summary | plainify | htmlUnescape }}{{ if .Truncated }}...{{ end }}</p>
|
||||
</section>
|
||||
{{- end }}
|
||||
{{- if not (.Param "hideMeta") }}
|
||||
@ -75,5 +75,7 @@
|
||||
</nav>
|
||||
</footer>
|
||||
{{- end }}
|
||||
{{end}}{{/* end profileMode */}}
|
||||
|
||||
{{- end }}{{/* end profileMode */}}
|
||||
|
||||
{{- end }}{{- /* end main */ -}}
|
||||
|
@ -17,11 +17,11 @@
|
||||
<div class="post-meta">
|
||||
{{- partial "translation_list.html" . -}}
|
||||
</div>
|
||||
{{- end}}
|
||||
{{- end }}
|
||||
</header>
|
||||
|
||||
<div id="searchbox">
|
||||
<input id="searchInput" autofocus placeholder="{{.Title}} ↵" aria-label="search" type="search">
|
||||
<input id="searchInput" autofocus placeholder="{{ .Title }} ↵" aria-label="search" type="search">
|
||||
<ul id="searchResults" aria-label="search results"></ul>
|
||||
</div>
|
||||
|
||||
|
@ -2,7 +2,7 @@
|
||||
|
||||
<article class="post-single">
|
||||
<header class="post-header">
|
||||
{{- partial "breadcrumbs.html" . }}
|
||||
{{ partial "breadcrumbs.html" . }}
|
||||
<h1 class="post-title">
|
||||
{{ .Title }}
|
||||
{{- if .Draft }}<div class="entry-isdraft"><sup> [draft]</sup></div>{{- end }}
|
||||
@ -14,13 +14,13 @@
|
||||
{{- end }}
|
||||
{{- if not (.Param "hideMeta") }}
|
||||
<div class="post-meta">
|
||||
{{- partial "post_meta.html" . -}}
|
||||
{{- partial "post_meta.html" . -}}
|
||||
{{- partial "translation_list.html" . -}}
|
||||
{{- partial "edit_post.html" . -}}
|
||||
</div>
|
||||
{{- end}}
|
||||
{{- end }}
|
||||
</header>
|
||||
{{- $isHidden := .Params.cover.hidden | default .Site.Params.cover.hiddenInSingle | default .Site.Params.cover.hidden}}
|
||||
{{- $isHidden := .Params.cover.hidden | default .Site.Params.cover.hiddenInSingle | default .Site.Params.cover.hidden }}
|
||||
{{- partial "cover.html" (dict "cxt" . "IsHome" false "isHidden" $isHidden) }}
|
||||
{{- if (.Param "ShowToc") }}
|
||||
{{- partial "toc.html" . }}
|
||||
@ -41,24 +41,24 @@
|
||||
{{- if and (gt (len $pages) 1) (in $pages . ) }}
|
||||
<nav class="paginav">
|
||||
{{- with $pages.Next . }}
|
||||
<a class="prev" href="{{.Permalink}}">
|
||||
<a class="prev" href="{{ .Permalink }}">
|
||||
<span class="title">« {{ i18n "prev_page" }}</span>
|
||||
<br>
|
||||
<span>{{- .Name -}}</span>
|
||||
</a>
|
||||
{{- end}}
|
||||
{{- end }}
|
||||
{{- with $pages.Prev . }}
|
||||
<a class="next" href="{{.Permalink}}">
|
||||
<a class="next" href="{{ .Permalink }}">
|
||||
<span class="title">{{ i18n "next_page" }} »</span>
|
||||
<br>
|
||||
<span>{{- .Name -}}</span>
|
||||
</a>
|
||||
{{- end}}
|
||||
{{- end }}
|
||||
</nav>
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{- if (and .Site.Params.ShowShareButtons (ne .Params.disableShare true) ) }}
|
||||
{{- partial "share_icons.html" . }}
|
||||
{{- if (and .Site.Params.ShowShareButtons (ne .Params.disableShare true)) }}
|
||||
{{- partial "share_icons.html" . -}}
|
||||
{{- end }}
|
||||
</footer>
|
||||
|
||||
@ -67,4 +67,4 @@
|
||||
{{- end }}
|
||||
</article>
|
||||
|
||||
{{- end }}{{/* end main */}}
|
||||
{{- end }}{{/* end main */}}
|
||||
|
@ -1,4 +1,4 @@
|
||||
{{ define "main" }}
|
||||
{{- define "main" }}
|
||||
|
||||
{{- if .Title }}
|
||||
<header class="page-header">
|
||||
@ -24,4 +24,4 @@
|
||||
{{- end }}
|
||||
</ul>
|
||||
|
||||
{{ end }}{{/* end main */}}
|
||||
{{- end }}{{/* end main */ -}}
|
||||
|
@ -1,2 +1,2 @@
|
||||
<!-- formats .Content headings by adding an anchor -->
|
||||
{{- /* formats .Content headings by adding an anchor */ -}}
|
||||
{{ . | replaceRE "(<h[1-6] id=\"([^\"]+)\".+)(</h[1-6]+>)" "${1}<a hidden class=\"anchor\" aria-hidden=\"true\" href=\"#${2}\">#</a>${3}" | safeHTML }}
|
||||
|
@ -1,7 +1,7 @@
|
||||
{{- if or .Params.author .Site.Params.author }}
|
||||
{{- $author := (.Params.author | default .Site.Params.author)}}
|
||||
{{- $author := (.Params.author | default .Site.Params.author) }}
|
||||
{{- $author_type := (printf "%T" $author) }}
|
||||
{{- if (or (eq $author_type "[]string") (eq $author_type "[]interface {}") ) }}
|
||||
{{- if (or (eq $author_type "[]string") (eq $author_type "[]interface {}")) }}
|
||||
{{- (delimit $author ", " ) }}
|
||||
{{- else }}
|
||||
{{- $author }}
|
||||
|
@ -1,9 +1,9 @@
|
||||
{{- if (.Param "ShowBreadCrumbs")}}
|
||||
{{- if (.Param "ShowBreadCrumbs") -}}
|
||||
<div class="breadcrumbs">
|
||||
{{- $url := replace .Parent.Permalink ( printf "%s" .Site.BaseURL) "" }}
|
||||
{{- $lang_url := strings.TrimPrefix ( printf "%s/" .Lang) $url }}
|
||||
{{- $url := replace .Parent.Permalink (printf "%s" .Site.BaseURL) "" }}
|
||||
{{- $lang_url := strings.TrimPrefix (printf "%s/" .Lang) $url -}}
|
||||
|
||||
<a href="{{ "" | absLangURL }}">{{ i18n "home" | default "Home"}}</a>
|
||||
<a href="{{ "" | absLangURL }}">{{ i18n "home" | default "Home" }}</a>
|
||||
{{- $scratch := newScratch }}
|
||||
{{- range $index, $element := split $lang_url "/" }}
|
||||
|
||||
@ -14,6 +14,6 @@
|
||||
{{- print " » " | safeHTML -}}<a href="{{ $bc_pg.Permalink }}">{{ $bc_pg.Name }}</a>
|
||||
{{- end }}
|
||||
|
||||
{{- end }}
|
||||
{{- end -}}
|
||||
</div>
|
||||
{{- end }}
|
||||
{{- end -}}
|
||||
|
@ -1,5 +1,3 @@
|
||||
<!-- Comments area start -->
|
||||
<!--
|
||||
to add comments read => https://gohugo.io/content-management/comments/
|
||||
-->
|
||||
<!-- Comments area end -->
|
||||
{{- /* Comments area start */ -}}
|
||||
{{- /* to add comments read => https://gohugo.io/content-management/comments/ */ -}}
|
||||
{{- /* Comments area end */ -}}
|
||||
|
@ -32,4 +32,4 @@
|
||||
{{- end }}
|
||||
</figure>
|
||||
{{- end }}{{/* End image */}}
|
||||
{{- end -}}{{/* End context */}}
|
||||
{{- end -}}{{/* End context */ -}}
|
||||
|
@ -1,7 +1,8 @@
|
||||
{{- if or .Params.editPost.URL .Site.Params.editPost.URL -}}
|
||||
{{- $fileUrlPath := path.Join .File.Path }}
|
||||
{{- if or .Params.author $.Site.Params.author (.Param "ShowReadingTime") (not .Date.IsZero) .IsTranslated }}| {{- end -}}
|
||||
|
||||
{{- if or .Params.author $.Site.Params.author (.Param "ShowReadingTime") (not .Date.IsZero) .IsTranslated }} | {{- end -}}
|
||||
<a href="{{ .Params.editPost.URL | default .Site.Params.editPost.URL }}{{ if .Params.editPost.appendFilePath | default ( .Site.Params.editPost.appendFilePath | default false ) }}/{{ $fileUrlPath }}{{ end }}" rel="noopener noreferrer" target="_blank">
|
||||
{{- .Params.editPost.Text | default (.Site.Params.editPost.Text | default (i18n "edit_post" | default "Edit") ) -}}
|
||||
{{- .Params.editPost.Text | default (.Site.Params.editPost.Text | default (i18n "edit_post" | default "Edit")) -}}
|
||||
</a>
|
||||
{{- end }}
|
||||
|
@ -1,5 +1,3 @@
|
||||
<!-- Footer custom content area start -->
|
||||
<!--
|
||||
Insert any custom code web-analytics, resources, etc. here
|
||||
-->
|
||||
<!-- Footer custom content area end -->
|
||||
{{- /* Footer custom content area start */ -}}
|
||||
{{- /* Insert any custom code web-analytics, resources, etc. here */ -}}
|
||||
{{- /* Footer custom content area end */ -}}
|
||||
|
@ -1,5 +1,4 @@
|
||||
<!-- Head custom content area start -->
|
||||
<!--
|
||||
Insert any custom code (web-analytics, resources, etc.) - it will appear in the <head></head> section of every page. Can be overwritten by partial with the same name in the global layouts.
|
||||
-->
|
||||
<!-- Head custom content area end -->
|
||||
{{- /* Head custom content area start */ -}}
|
||||
{{- /* Insert any custom code (web-analytics, resources, etc.) - it will appear in the <head></head> section of every page. */ -}}
|
||||
{{- /* Can be overwritten by partial with the same name in the global layouts. */ -}}
|
||||
{{- /* Head custom content area end */ -}}
|
||||
|
@ -9,6 +9,7 @@
|
||||
<span>·</span>
|
||||
<span>Theme <a href="https://git.io/hugopapermod" rel="noopener" target="_blank">PaperMod</a></span>
|
||||
</footer>
|
||||
|
||||
{{- if (not .Site.Params.disableScrollToTop) }}
|
||||
<a href="#top" aria-label="go to top" title="Go to Top (Alt + G)">
|
||||
<button class="top-link" id="top-link" type="button" accesskey="g">
|
||||
@ -18,18 +19,21 @@
|
||||
</button>
|
||||
</a>
|
||||
{{- end }}
|
||||
|
||||
{{- partial "extend_footer.html" . -}}
|
||||
|
||||
{{- $isHLJSdisabled := (.Site.Params.assets.disableHLJS | default .Params.disableHLJS ) }}
|
||||
{{- if (and (eq .Kind "page") (ne .Layout "archives") (ne .Layout "search") (not $isHLJSdisabled)) }}
|
||||
{{- if not .Site.Params.assets.disableFingerprinting }}
|
||||
{{- $highlight := slice (resources.Get "js/highlight.min.js") | resources.Concat "assets/js/highlight.js" | minify | fingerprint }}
|
||||
<script defer src="{{ $highlight.RelPermalink }}" integrity="{{ $highlight.Data.Integrity }}"
|
||||
onload="hljs.initHighlightingOnLoad();"></script>
|
||||
{{- else}}
|
||||
{{- else }}
|
||||
{{- $highlight := slice (resources.Get "js/highlight.min.js") | resources.Concat "assets/js/highlight.js" | minify }}
|
||||
<script defer src="{{ $highlight.RelPermalink }}" onload="hljs.initHighlightingOnLoad();"></script>
|
||||
{{- end}}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
|
||||
<script>
|
||||
window.onload = function () {
|
||||
if (localStorage.getItem("menu-scroll-position")) {
|
||||
|
@ -4,11 +4,13 @@
|
||||
{{- if hugo.IsProduction | or (eq .Site.Params.env "production") }}
|
||||
<meta name="robots" content="index, follow">
|
||||
{{- else }}
|
||||
<meta name=" robots" content="noindex, nofollow">
|
||||
{{- end -}}
|
||||
<!-- Title -->
|
||||
<title>{{ if .IsHome }}{{else}}{{ if .Title }}{{ .Title }} | {{ end }}{{end}}{{ .Site.Title }}</title>
|
||||
<!-- Meta -->
|
||||
<meta name="robots" content="noindex, nofollow">
|
||||
{{- end }}
|
||||
|
||||
{{- /* Title */}}
|
||||
<title>{{ if .IsHome }}{{ else }}{{ if .Title }}{{ .Title }} | {{ end }}{{ end }}{{ .Site.Title }}</title>
|
||||
|
||||
{{- /* Meta */}}
|
||||
<meta name="keywords" content="{{ if .Params.keywords -}}
|
||||
{{- range $i, $e := .Params.keywords }}{{ if $i }}, {{ end }}{{ $e }}{{ end }} {{- else }}
|
||||
{{- range $i, $e := .Params.tags }}{{ if $i }}, {{ end }}{{ $e }}{{ end }} {{- end -}}" />
|
||||
@ -19,14 +21,15 @@
|
||||
<link rel="canonical" href="{{ if .Params.canonicalURL -}} {{ trim .Params.canonicalURL " " }} {{- else -}} {{ .Permalink }} {{- end }}" />
|
||||
{{- if .Site.Params.analytics.google.SiteVerificationTag }}
|
||||
<meta name="google-site-verification" content="{{ .Site.Params.analytics.google.SiteVerificationTag }}" />
|
||||
{{- end}}
|
||||
{{- end }}
|
||||
{{- if .Site.Params.analytics.yandex.SiteVerificationTag }}
|
||||
<meta name="yandex-verification" content="{{ .Site.Params.analytics.yandex.SiteVerificationTag }}" />
|
||||
{{- end}}
|
||||
{{- end }}
|
||||
{{- if .Site.Params.analytics.bing.SiteVerificationTag }}
|
||||
<meta name="msvalidate.01" content="{{ .Site.Params.analytics.bing.SiteVerificationTag }}" />
|
||||
{{- end}}
|
||||
<!-- Styles -->
|
||||
{{- end }}
|
||||
|
||||
{{- /* Styles */}}
|
||||
{{- $theme_vars := (resources.Get "css/core/theme-vars.css") }}
|
||||
{{- $reset := (resources.Get "css/core/reset.css") }}
|
||||
{{- $media := (resources.Get "css/core/zmedia.css") }}
|
||||
@ -39,18 +42,19 @@
|
||||
{{- /* order is important */}}
|
||||
{{- $core := (slice $theme_vars $reset $common $hljs $media) | resources.Concat "assets/css/core.css" }}
|
||||
{{- $extended := (resources.Match "css/extended/*.css") | resources.Concat "assets/css/extended.css" }}
|
||||
{{- /* bundle all required css */}}
|
||||
{{- /* Add extended css after theme style */ -}}
|
||||
|
||||
{{- /* bundle all required css */}}
|
||||
{{- /* Add extended css after theme style */ -}}
|
||||
{{- $stylesheet := (slice $core $extended) | resources.Concat "assets/css/stylesheet.css" | minify }}
|
||||
|
||||
{{- if not .Site.Params.assets.disableFingerprinting }}
|
||||
{{- $stylesheet := $stylesheet | fingerprint -}}
|
||||
<link href="{{ $stylesheet.RelPermalink }}" integrity="{{ $stylesheet.Data.Integrity }}" rel="preload stylesheet"
|
||||
as="style">
|
||||
{{- else}}
|
||||
{{- $stylesheet := $stylesheet | fingerprint }}
|
||||
<link href="{{ $stylesheet.RelPermalink }}" integrity="{{ $stylesheet.Data.Integrity }}" rel="preload stylesheet" as="style">
|
||||
{{- else }}
|
||||
<link href="{{ $stylesheet.RelPermalink }}" rel="preload stylesheet" as="style">
|
||||
{{- end}}
|
||||
<!-- Search -->
|
||||
{{- end }}
|
||||
|
||||
{{- /* Search */}}
|
||||
{{- if (eq .Layout `search`) -}}
|
||||
<link rel="preload" as="fetch" href="../index.json" crossOrigin="anonymous">
|
||||
{{- $fastsearch := resources.Get "js/fastsearch.js" | resources.ExecuteAsTemplate "js/fastsearch.js" .Site.Params.fuseOpts }}
|
||||
@ -58,38 +62,38 @@
|
||||
{{- if not .Site.Params.assets.disableFingerprinting }}
|
||||
{{- $search := (slice $fusejs $fastsearch ) | resources.Concat "assets/js/search.js" | minify | fingerprint }}
|
||||
<script defer src="{{ $search.RelPermalink }}" onload="loadSearch();" integrity="{{ $search.Data.Integrity }}"></script>
|
||||
{{- else}}
|
||||
{{ $search := (slice $fusejs $fastsearch ) | resources.Concat "assets/js/search.js" | minify }}
|
||||
{{- else }}
|
||||
{{- $search := (slice $fusejs $fastsearch ) | resources.Concat "assets/js/search.js" | minify }}
|
||||
<script defer src="{{ $search.RelPermalink }}" onload="loadSearch();"></script>
|
||||
{{- end}}
|
||||
{{- end }}
|
||||
{{- end -}}
|
||||
|
||||
<!-- Favicons -->
|
||||
<link rel="icon" href="{{- .Site.Params.assets.favicon | default "favicon.ico" | absURL -}}">
|
||||
<link rel="icon" type="image/png" sizes="16x16" href="
|
||||
{{- .Site.Params.assets.favicon16x16 | default "favicon-16x16.png" | absURL -}}">
|
||||
<link rel="icon" type="image/png" sizes="32x32" href="
|
||||
{{- .Site.Params.assets.favicon32x32 | default "favicon-32x32.png" | absURL -}}">
|
||||
<link rel="apple-touch-icon" href="
|
||||
{{- .Site.Params.assets.apple_touch_icon | default "apple-touch-icon.png" | absURL -}}">
|
||||
<link rel="mask-icon" href="{{- .Site.Params.assets.safari_pinned_tab | default "safari-pinned-tab.svg" | absURL -}}">
|
||||
{{- /* Favicons */}}
|
||||
<link rel="icon" href="{{ .Site.Params.assets.favicon | default "favicon.ico" | absURL }}">
|
||||
<link rel="icon" type="image/png" sizes="16x16" href="{{ .Site.Params.assets.favicon16x16 | default "favicon-16x16.png" | absURL }}">
|
||||
<link rel="icon" type="image/png" sizes="32x32" href="{{ .Site.Params.assets.favicon32x32 | default "favicon-32x32.png" | absURL }}">
|
||||
<link rel="apple-touch-icon" href="{{ .Site.Params.assets.apple_touch_icon | default "apple-touch-icon.png" | absURL }}">
|
||||
<link rel="mask-icon" href="{{ .Site.Params.assets.safari_pinned_tab | default "safari-pinned-tab.svg" | absURL }}">
|
||||
<meta name="theme-color" content="#2e2e33">
|
||||
<meta name="msapplication-TileColor" content="#2e2e33">
|
||||
<!-- Generator -->
|
||||
{{- hugo.Generator }}
|
||||
<!-- RSS -->
|
||||
{{- range .AlternativeOutputFormats -}}
|
||||
|
||||
{{- /* Generator */}}
|
||||
{{ hugo.Generator }}
|
||||
|
||||
{{- /* RSS */}}
|
||||
{{ range .AlternativeOutputFormats -}}
|
||||
<link rel="{{ .Rel }}" type="{{ .MediaType.Type }}" href="{{ .Permalink | safeURL }}">
|
||||
{{ end -}}
|
||||
{{- range .AllTranslations -}}
|
||||
<link rel="alternate" hreflang="{{- .Lang -}}" href="{{- .Permalink -}}" />
|
||||
<link rel="alternate" hreflang="{{ .Lang }}" href="{{ .Permalink }}" />
|
||||
{{ end }}
|
||||
{{- partial "extend_head.html" . -}}
|
||||
<!-- Misc -->
|
||||
|
||||
{{- /* Misc */}}
|
||||
{{- if hugo.IsProduction | or (eq .Site.Params.env "production") }}
|
||||
{{- template "_internal/google_analytics_async.html" . }}
|
||||
{{- template "_internal/google_news.html" . }}
|
||||
{{- template "partials/templates/opengraph.html" . }}
|
||||
{{- template "partials/templates/twitter_cards.html" . }}
|
||||
{{- template "partials/templates/schema_json.html" . }}
|
||||
{{- end }}
|
||||
{{- end -}}
|
||||
|
@ -1,6 +1,6 @@
|
||||
{{- /* theme-toggle is enabled */}}
|
||||
{{- /* theme-toggle is enabled */}}
|
||||
{{- if (not .Site.Params.disableThemeToggle) }}
|
||||
{{- /* theme is light */}}
|
||||
{{- /* theme is light */}}
|
||||
{{- if (eq .Site.Params.defaultTheme "light") }}
|
||||
<script>
|
||||
if (localStorage.getItem("pref-theme") === "dark") {
|
||||
@ -8,7 +8,7 @@
|
||||
}
|
||||
|
||||
</script>
|
||||
{{- /* theme is dark */}}
|
||||
{{- /* theme is dark */}}
|
||||
{{- else if (eq .Site.Params.defaultTheme "dark") }}
|
||||
<script>
|
||||
if (localStorage.getItem("pref-theme") === "light") {
|
||||
@ -17,7 +17,7 @@
|
||||
|
||||
</script>
|
||||
{{- else }}
|
||||
{{- /* theme is auto */}}
|
||||
{{- /* theme is auto */}}
|
||||
<script>
|
||||
if (localStorage.getItem("pref-theme") === "dark") {
|
||||
document.body.classList.add('dark');
|
||||
@ -29,7 +29,7 @@
|
||||
|
||||
</script>
|
||||
{{- end }}
|
||||
{{- /* theme-toggle is disabled and theme is auto */}}
|
||||
{{- /* theme-toggle is disabled and theme is auto */}}
|
||||
{{- else if (and (ne .Site.Params.defaultTheme "light") (ne .Site.Params.defaultTheme "dark"))}}
|
||||
<script>
|
||||
if (window.matchMedia('(prefers-color-scheme: dark)').matches) {
|
||||
@ -73,10 +73,11 @@
|
||||
border-color: var(--theme);
|
||||
}
|
||||
}
|
||||
|
||||
</style>
|
||||
{{- end }}
|
||||
|
||||
</noscript>
|
||||
|
||||
<header class="header">
|
||||
<nav class="nav">
|
||||
<div class="logo">
|
||||
@ -85,7 +86,7 @@
|
||||
<a href="{{ "" | absLangURL }}" accesskey="h" title="{{ $label_text }} (Alt + H)">
|
||||
{{- if .Site.Params.label.icon }}
|
||||
<img src="{{- .Site.Params.label.icon -}}" alt="logo" aria-label="logo"
|
||||
height="{{- .Site.Params.label.iconHeight | default "30px" -}}">
|
||||
height="{{- .Site.Params.label.iconHeight | default " 30px" -}}">
|
||||
{{- end -}}
|
||||
{{- $label_text -}}
|
||||
</a>
|
||||
@ -112,11 +113,11 @@
|
||||
<line x1="18.36" y1="5.64" x2="19.78" y2="4.22"></line>
|
||||
</svg>
|
||||
</button>
|
||||
{{- end}}
|
||||
{{ $lang := .Lang}}
|
||||
{{ $separator := or $label_text (not .Site.Params.disableThemeToggle)}}
|
||||
{{- with $.Site.Home.AllTranslations }}
|
||||
{{- end }}
|
||||
|
||||
{{- $lang := .Lang}}
|
||||
{{- $separator := or $label_text (not .Site.Params.disableThemeToggle)}}
|
||||
{{- with $.Site.Home.AllTranslations }}
|
||||
<ul class="lang-switch">
|
||||
{{- if $separator }}<li>|</li>{{ end }}
|
||||
{{- range . -}}
|
||||
@ -141,7 +142,7 @@
|
||||
<ul id="menu" onscroll="menu_on_scroll()">
|
||||
{{- range .Site.Menus.main }}
|
||||
{{- $menu_item_url := (cond (strings.HasSuffix .URL "/") .URL (printf "%s/" .URL) ) | absLangURL }}
|
||||
{{- $page_url:= $currentPage.Permalink | absLangURL }}
|
||||
{{- $page_url:= $currentPage.Permalink | absLangURL }}
|
||||
{{- $is_search := eq ($.Site.GetPage .KeyName).Layout `search` }}
|
||||
<li>
|
||||
<a href="{{ .URL | absLangURL }}" title="{{ .Title | default .Name }} {{- cond $is_search (" (Alt + /)" | safeHTMLAttr) ("" | safeHTMLAttr ) }}"
|
||||
@ -151,7 +152,7 @@
|
||||
</span>
|
||||
</a>
|
||||
</li>
|
||||
{{- end -}}
|
||||
{{- end }}
|
||||
</ul>
|
||||
</nav>
|
||||
</header>
|
||||
|
@ -1,13 +1,13 @@
|
||||
{{- with $.Site.Params.homeInfoParams }}
|
||||
<article class="first-entry home-info">
|
||||
<header class="entry-header">
|
||||
<h1>{{- .Title | markdownify }}</h1>
|
||||
<h1>{{ .Title | markdownify }}</h1>
|
||||
</header>
|
||||
<section class="entry-content">
|
||||
<p>{{- .Content | markdownify }}</p>
|
||||
<p>{{ .Content | markdownify }}</p>
|
||||
</section>
|
||||
<footer class="entry-footer">
|
||||
{{- partial "social_icons.html" $.Site.Params.socialIcons -}}
|
||||
{{ partial "social_icons.html" $.Site.Params.socialIcons }}
|
||||
</footer>
|
||||
</article>
|
||||
{{- end}}
|
||||
{{- end -}}
|
||||
|
@ -1,19 +1,21 @@
|
||||
<div class="profile">
|
||||
{{- with .Site.Params.profileMode }}
|
||||
<div class="profile_inner">
|
||||
{{- if .imageUrl}}<img src="{{ .imageUrl}}" alt="{{ .imageTitle | default "profile image" }}"
|
||||
height="{{- .imageHeight | default 150 -}}" width="{{- .imageWidth | default 150 -}}" />{{- end}}
|
||||
<h1>{{- .title | default $.Site.Title | markdownify -}}</h1>
|
||||
<span>{{- .subtitle | markdownify -}}</span>
|
||||
{{- if .imageUrl -}}
|
||||
<img src="{{ .imageUrl }}" alt="{{ .imageTitle | default "profile image" }}"
|
||||
height="{{ .imageHeight | default 150 }}" width="{{ .imageWidth | default 150 }}" />
|
||||
{{- end }}
|
||||
<h1>{{ .title | default $.Site.Title | markdownify }}</h1>
|
||||
<span>{{ .subtitle | markdownify }}</span>
|
||||
{{- partial "social_icons.html" $.Site.Params.socialIcons -}}
|
||||
|
||||
{{- with .buttons }}
|
||||
<div class="buttons">
|
||||
{{- range . -}}
|
||||
{{- range . }}
|
||||
<a class="button" href="{{ trim .url " " }}" rel="noopener" title="{{ .name | humanize }}">
|
||||
<span class="button-inner">{{ .name }}</span>
|
||||
</a>
|
||||
{{- end -}}
|
||||
{{- end }}
|
||||
</div>
|
||||
{{- end }}
|
||||
</div>
|
||||
|
@ -1,17 +1,17 @@
|
||||
{{- $scratch := newScratch}}
|
||||
{{- $scratch := newScratch }}
|
||||
|
||||
{{- if not .Date.IsZero -}}
|
||||
{{- $scratch.Add "meta" (slice (.Date.Format (default "January 2, 2006" .Site.Params.DateFormat))) }}
|
||||
{{- end -}}
|
||||
{{- end }}
|
||||
|
||||
{{- if (.Param "ShowReadingTime") -}}
|
||||
{{- $scratch.Add "meta" (slice (i18n "read_time" .ReadingTime | default (printf "%s min" .ReadingTime))) }}
|
||||
{{- end -}}
|
||||
|
||||
{{ with (partial "author.html" . ) }}
|
||||
{{ $scratch.Add "meta" (slice .)}}
|
||||
{{end}}
|
||||
|
||||
{{- with ($scratch.Get "meta")}}
|
||||
{{- delimit . " · "}}
|
||||
{{- end }}
|
||||
|
||||
{{- with (partial "author.html" .) }}
|
||||
{{- $scratch.Add "meta" (slice .) }}
|
||||
{{- end }}
|
||||
|
||||
{{- with ($scratch.Get "meta") }}
|
||||
{{- delimit . " · " -}}
|
||||
{{- end -}}
|
||||
|
@ -1,13 +1,13 @@
|
||||
{{- $pageurl := .Permalink }}
|
||||
{{- $title := .Title }}
|
||||
|
||||
{{ $.Scratch.Set "tags" ""}}
|
||||
{{- $.Scratch.Set "tags" ""}}
|
||||
|
||||
{{- with .Params.Tags }}
|
||||
{{ $hashtags := newScratch}}
|
||||
{{ range . }}{{ $hashtags.Add "tags" (slice (replaceRE "(\\s)" "" . ))}}{{end}}
|
||||
{{ $.Scratch.Set "tags" (delimit ($hashtags.Get "tags") ",") }}
|
||||
{{- end }}
|
||||
{{- range . }}{{ $hashtags.Add "tags" (slice (replaceRE "(\\s)" "" . ))}}{{end}}
|
||||
{{- $.Scratch.Set "tags" (delimit ($hashtags.Get "tags") ",") }}
|
||||
{{- end -}}
|
||||
|
||||
<div class="share-buttons">
|
||||
<a target="_blank" rel="noopener noreferrer" aria-label="share {{ $title | plainify }} on twitter"
|
||||
|
@ -1,6 +1,7 @@
|
||||
<div class="social-icons">
|
||||
{{- range . -}}
|
||||
<a href="{{ trim .url " " }}" target="_blank" rel="noopener noreferrer me"
|
||||
title="{{ .name | humanize }}">{{ partial "svg.html" . }}</a>
|
||||
{{- end -}}
|
||||
{{- range . }}
|
||||
<a href="{{ trim .url " " }}" target="_blank" rel="noopener noreferrer me" title="{{ .name | humanize }}">
|
||||
{{ partial "svg.html" . }}
|
||||
</a>
|
||||
{{- end }}
|
||||
</div>
|
||||
|
@ -1,4 +1,4 @@
|
||||
{{ $icon_name := ( trim .name " " | lower )}}
|
||||
{{- $icon_name := ( trim .name " " | lower )}}
|
||||
{{- if (eq $icon_name "123rf") -}}
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"
|
||||
stroke-linecap="round" stroke-linejoin="round">
|
||||
|
@ -114,6 +114,6 @@
|
||||
}
|
||||
}
|
||||
</script>
|
||||
{{ end }}{{/* .IsPage end */}}
|
||||
{{- end }}{{/* .IsPage end */}}
|
||||
|
||||
{{ end }}
|
||||
{{- end -}}
|
||||
|
@ -7,7 +7,7 @@
|
||||
{{- $headers := findRE "<h[1-6].*?>(.|\n])+?</h[1-6]>" .Content -}}
|
||||
{{- $has_headers := ge (len $headers) 1 -}}
|
||||
{{- if $has_headers -}}
|
||||
|
||||
|
||||
{{- $largest := 6 -}}
|
||||
{{- range $headers -}}
|
||||
{{- $headerLevel := index (findRE "[1-6]" . 1) 0 -}}
|
||||
@ -16,9 +16,9 @@
|
||||
{{- $largest = $headerLevel -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
|
||||
|
||||
{{- $firstHeaderLevel := len (seq (index (findRE "[1-6]" (index $headers 0) 1) 0)) -}}
|
||||
|
||||
|
||||
{{- $.Scratch.Set "bareul" slice -}}
|
||||
<ul>
|
||||
{{- range seq (sub $firstHeaderLevel $largest) -}}
|
||||
@ -28,14 +28,14 @@
|
||||
{{- range $i, $header := $headers -}}
|
||||
{{- $headerLevel := index (findRE "[1-6]" . 1) 0 -}}
|
||||
{{- $headerLevel := len (seq $headerLevel) -}}
|
||||
|
||||
|
||||
{{/* get id="xyz" */}}
|
||||
{{- $id := index (findRE "(id=\"(.*?)\")" $header 9) 0 }}
|
||||
|
||||
|
||||
{{- /* strip id="" to leave xyz, no way to get regex capturing groups in hugo */ -}}
|
||||
{{- $cleanedID := replace (replace $id "id=\"" "") "\"" "" }}
|
||||
{{- $header := replaceRE "<h[1-6].*?>((.|\n])+?)</h[1-6]>" "$1" $header -}}
|
||||
|
||||
|
||||
{{- if ne $i 0 -}}
|
||||
{{- $prevHeaderLevel := index (findRE "[1-6]" (index $headers (sub $i 1)) 1) 0 -}}
|
||||
{{- $prevHeaderLevel := len (seq $prevHeaderLevel) -}}
|
||||
@ -66,28 +66,28 @@
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
{{- end }}
|
||||
<li>
|
||||
<a href="#{{- $cleanedID -}}" aria-label="{{- $header | plainify -}}">{{- $header | safeHTML -}}</a>
|
||||
{{- else -}}
|
||||
{{- else }}
|
||||
<li>
|
||||
<a href="#{{- $cleanedID -}}" aria-label="{{- $header | plainify -}}">{{- $header | safeHTML -}}</a>
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
<!-- {{- $firstHeaderLevel := len (seq (index (findRE "[1-6]" (index $headers 0) 1) 0)) -}} -->
|
||||
{{- $firstHeaderLevel := $largest }}
|
||||
{{- $lastHeaderLevel := len (seq (index (findRE "[1-6]" (index $headers (sub (len $headers) 1)) 1) 0)) -}}
|
||||
{{- $lastHeaderLevel := len (seq (index (findRE "[1-6]" (index $headers (sub (len $headers) 1)) 1) 0)) }}
|
||||
</li>
|
||||
{{- range seq (sub $lastHeaderLevel $firstHeaderLevel) -}}
|
||||
{{- if in ($.Scratch.Get "bareul") (add . $firstHeaderLevel) -}}
|
||||
{{- if in ($.Scratch.Get "bareul") (add . $firstHeaderLevel) }}
|
||||
</ul>
|
||||
{{- else -}}
|
||||
{{- else }}
|
||||
</ul>
|
||||
</li>
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
{{- end }}
|
||||
</ul>
|
||||
{{- end -}}
|
||||
{{- end }}
|
||||
</div>
|
||||
</details>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -1,9 +1,9 @@
|
||||
{{- if .IsTranslated -}}
|
||||
{{- if (ne .Layout "search")}}
|
||||
{{- if (ne .Layout "search") }}
|
||||
{{- if or .Params.author $.Site.Params.author (.Param "ShowReadingTime") (not .Date.IsZero) }} | {{- end -}}
|
||||
{{- end }}
|
||||
<ul class="i18n_list">
|
||||
{{- i18n "translations" | default "Translations"}}:
|
||||
{{- i18n "translations" | default "Translations" }}:
|
||||
{{- range .Translations }}
|
||||
<li>
|
||||
<a href="{{ .Permalink }}">
|
||||
@ -16,4 +16,4 @@
|
||||
</li>
|
||||
{{- end }}
|
||||
</ul>
|
||||
{{- end }}
|
||||
{{- end -}}
|
||||
|
Loading…
Reference in New Issue
Block a user