- {{- with .Site.Params.profileMode }}
+ {{- with site.Params.profileMode }}
diff --git a/layouts/partials/post_canonical.html b/layouts/partials/post_canonical.html
new file mode 100644
index 00000000..d3df859a
--- /dev/null
+++ b/layouts/partials/post_canonical.html
@@ -0,0 +1,9 @@
+{{ if and (.Params.canonicalURL) (.Params.ShowCanonicalLink ) -}}
+{{ $url := urls.Parse .Params.canonicalURL }}
+
+{{- if or .Params.author site.Params.author (.Param "ShowReadingTime") (not .Date.IsZero) .IsTranslated (or .Params.editPost.URL site.Params.editPost.URL) }} | {{- end -}}
+
+{{- end }}
diff --git a/layouts/partials/post_lastmod.html b/layouts/partials/post_lastmod.html
new file mode 100644
index 00000000..750ff217
--- /dev/null
+++ b/layouts/partials/post_lastmod.html
@@ -0,0 +1,6 @@
+{{ $date := .Date.Format "02.01.2006" }}
+{{ $lastmod := .Lastmod.Format "02.01.2006" }}
+
+{{- if ne $lastmod $date -}}
+
+{{- end }}
\ No newline at end of file
diff --git a/layouts/partials/post_meta.html b/layouts/partials/post_meta.html
index e0dbef40..b0c0417e 100644
--- a/layouts/partials/post_meta.html
+++ b/layouts/partials/post_meta.html
@@ -1,17 +1,23 @@
-{{- $scratch := newScratch}}
+{{- $scratch := newScratch }}
{{- if not .Date.IsZero -}}
-{{- $scratch.Add "meta" (slice (.Date.Format (default "January 2, 2006" .Site.Params.DateFormat))) }}
-{{- end -}}
-
-{{- if $.Site.Params.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 . " · "}}
+{{- $scratch.Add "meta" (slice (printf "
" (.Date) (.Date | time.Format (default "January 2, 2006" site.Params.DateFormat)))) }}
{{- end }}
+
+{{- if (.Param "ShowReadingTime") -}}
+{{- $scratch.Add "meta" (slice (i18n "read_time" .ReadingTime | default (printf "%d min" .ReadingTime))) }}
+{{- end }}
+
+{{- if (.Param "ShowWordCount") -}}
+{{- $scratch.Add "meta" (slice (i18n "words" .WordCount | default (printf "%d words" .WordCount))) }}
+{{- end }}
+
+{{- if not (.Param "hideAuthor") -}}
+{{- with (partial "author.html" .) }}
+{{- $scratch.Add "meta" (slice .) }}
+{{- end }}
+{{- end }}
+
+{{- with ($scratch.Get "meta") }}
+{{- delimit . " · " | safeHTML -}}
+{{- end -}}
diff --git a/layouts/partials/post_nav_links.html b/layouts/partials/post_nav_links.html
new file mode 100644
index 00000000..b6a0a987
--- /dev/null
+++ b/layouts/partials/post_nav_links.html
@@ -0,0 +1,19 @@
+{{- $pages := .CurrentSection.RegularPages.ByTitle }}
+{{- if and (gt (len $pages) 1) (in $pages . ) }}
+
+{{- end }}
diff --git a/layouts/partials/script.html b/layouts/partials/script.html
new file mode 100644
index 00000000..819cf49c
--- /dev/null
+++ b/layouts/partials/script.html
@@ -0,0 +1,27 @@
+{{- /* Search */}}
+{{- if (eq .Layout `search`) -}}
+
+{{- $fastsearch := resources.Get "js/fastsearch.js" | js.Build (dict "params" (dict "fuseOpts" site.Params.fuseOpts)) | resources.Minify }}
+{{- $fusejs := resources.Get "js/fuse.basic.min.js" }}
+{{- $license_js := resources.Get "js/license.js" }}
+{{- if not site.Params.assets.disableFingerprinting }}
+{{- $search := (slice $fusejs $license_js $fastsearch ) | resources.Concat "assets/js/search.js" | fingerprint }}
+
+{{- else }}
+{{- $search := (slice $fusejs $fastsearch ) | resources.Concat "assets/js/search.js" }}
+
+{{- end }}
+{{- end -}}
+
+{{- /* PaperMod.js */}}
+{{- $scrollToTop := (not site.Params.disableScrollToTop | default .Params.disableScrollToTop ) }}
+{{- $themeToggle := (not site.Params.disableThemeToggle | default .Params.disableThemeToggle ) }}
+{{- $showCodeCopyButtons := (site.Params.ShowCodeCopyButtons | default .Params.ShowCodeCopyButtons ) }}
+{{- $papermod := resources.Get "js/papermod.js" | js.Build (dict "params" (dict "scrollToTop" $scrollToTop "themeToggle" $themeToggle "showCodeCopyButtons" $showCodeCopyButtons)) | resources.Minify }}
+{{- if not site.Params.assets.disableFingerprinting }}
+{{- $papermod_js := (slice $papermod) | resources.Concat "assets/js/papermod.js" | fingerprint }}
+
+{{- else }}
+{{- $papermod_js := (slice $papermod) | resources.Concat "assets/js/papermod.js" }}
+
+{{- end }}
\ No newline at end of file
diff --git a/layouts/partials/share_icons.html b/layouts/partials/share_icons.html
index e1d40a77..910ba7f1 100644
--- a/layouts/partials/share_icons.html
+++ b/layouts/partials/share_icons.html
@@ -1,55 +1,95 @@
{{- $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 }}
+{{- $hashtags := newScratch}}
+{{- range . }}{{ $hashtags.Add "tags" (slice (replaceRE "(\\s)" "" . ))}}{{end}}
+{{- $.Scratch.Set "tags" (delimit ($hashtags.Get "tags") ",") }}
+{{- end -}}
-
+{{- $custom := false }}
+{{- $ShareButtons := (.Param "ShareButtons")}}
+{{- with $ShareButtons }}{{ $custom = true }}{{ end }}
+
+
diff --git a/layouts/partials/social_icons.html b/layouts/partials/social_icons.html
index 5729fe52..2b385172 100644
--- a/layouts/partials/social_icons.html
+++ b/layouts/partials/social_icons.html
@@ -1,6 +1,8 @@
-
- {{- range . -}}
-
{{ partial "svg.html" . }}
- {{- end -}}
+
diff --git a/layouts/partials/svg.html b/layouts/partials/svg.html
index 03de65a2..54e09c0e 100644
--- a/layouts/partials/svg.html
+++ b/layouts/partials/svg.html
@@ -1,4 +1,4 @@
-{{ $icon_name := ( trim .name " " | lower )}}
+{{- $icon_name := ( trim .name " " | lower )}}
{{- if (eq $icon_name "123rf") -}}
@@ -14,6 +14,21 @@
+{{- else if (eq $icon_name "anilist") -}}
+
+
+
+{{- else if (eq $icon_name "applemusic") -}}
+
+
+
+{{- else if (eq $icon_name "applepodcasts") -}}
+
+
+
{{- else if (eq $icon_name "behance") -}}
@@ -21,6 +36,24 @@
style="font-variation-settings:normal"
d="M1.774 18.063V5.466h5.51c1.978 0 3.116 1.326 3.055 2.806-.043 1.049-.711 2.988-2.643 2.988h-5.93H7.73c1.224 0 3.532 1.13 3.532 3.532 0 2.4-1.873 3.27-3.318 3.27zm12.57-4.459h7.89s.012-4.18-4.167-4.18c-5.237 0-5.277 9.11-.3 9.11 3.06 0 3.935-1.806 3.935-1.806M15.526 5.823h4.987" />
+{{- else if (eq $icon_name "bilibili") -}}
+
+
+
+
+
+
+
+{{- else if (eq $icon_name "bitcoin") -}}
+
+
+
+{{- else if (eq $icon_name "bugcrowd") -}}
+
+
+
{{- else if (eq $icon_name "buymeacoffee") -}}
+{{- else if (eq $icon_name "codeberg") -}}
+
+
+
{{- else if (eq $icon_name "codepen") -}}
@@ -68,6 +105,11 @@
+{{- else if (eq $icon_name "codeforces") -}}
+
+
+
{{- else if (eq $icon_name "cryptohack") -}}
+{{- else if (eq $icon_name "ctftime") -}}
+
+
+
+
+
+
+{{- else if (eq $icon_name "cv") -}}
+
+
+
+
+
+
{{- else if (eq $icon_name "dev") -}}
+{{- else if (eq $icon_name "deviantart") -}}
+
+
+
+{{- else if (eq $icon_name "deezer") -}}
+
+
+
{{- else if (eq $icon_name "discogs") -}}
{{- else if (eq $icon_name "discord") -}}
-
+
-
+ d="M107.7,8.07A105.15,105.15,0,0,0,81.47,0a72.06,72.06,0,0,0-3.36,6.83A97.68,97.68,0,0,0,49,6.83,72.37,72.37,0,0,0,45.64,0,105.89,105.89,0,0,0,19.39,8.09C2.79,32.65-1.71,56.6.54,80.21h0A105.73,105.73,0,0,0,32.71,96.36,77.7,77.7,0,0,0,39.6,85.25a68.42,68.42,0,0,1-10.85-5.18c.91-.66,1.8-1.34,2.66-2a75.57,75.57,0,0,0,64.32,0c.87.71,1.76,1.39,2.66,2a68.68,68.68,0,0,1-10.87,5.19,77,77,0,0,0,6.89,11.1A105.25,105.25,0,0,0,126.6,80.22h0C129.24,52.84,122.09,29.11,107.7,8.07ZM42.45,65.69C36.18,65.69,31,60,31,53s5-12.74,11.43-12.74S54,46,53.89,53,48.84,65.69,42.45,65.69Zm42.24,0C78.41,65.69,73.25,60,73.25,53s5-12.74,11.44-12.74S96.23,46,96.12,53,91.08,65.69,84.69,65.69Z" />
+
+{{- else if (eq $icon_name "douban") -}}
+
+
+
+
{{- else if (eq $icon_name "dreamstime") -}}
{{- else if (eq $icon_name "email") -}}
-
@@ -123,6 +203,15 @@
stroke-linecap="round" stroke-linejoin="round">
+{{- else if (eq $icon_name "firefish") -}}
+
+
+
+{{- else if (eq $icon_name "flickr") -}}
+
+
+
{{- else if (eq $icon_name "freepik") -}}
@@ -135,6 +224,11 @@
+{{- else if (eq $icon_name "gitea") -}}
+
+
+
{{- else if (eq $icon_name "github") -}}
@@ -149,6 +243,45 @@
d="M22.65 14.39L12 22.13 1.35 14.39a.84.84 0 0 1-.3-.94l1.22-3.78 2.44-7.51A.42.42 0 0 1 4.82 2a.43.43 0 0 1 .58 0 .42.42 0 0 1 .11.18l2.44 7.49h8.1l2.44-7.51A.42.42 0 0 1 18.6 2a.43.43 0 0 1 .58 0 .42.42 0 0 1 .11.18l2.44 7.51L23 13.45a.84.84 0 0 1-.35.94z">
+{{- else if (eq $icon_name "goodreads") -}}
+
+
+
+{{- else if (eq $icon_name "googleplaystore") -}}
+
+
+
+{{- else if (eq $icon_name "googlepodcasts") -}}
+
+
+
+{{- else if (eq $icon_name "googlescholar") -}}
+
+
+
+{{- else if (eq $icon_name "gurushots") -}}
+
+
+
+
+
+
+
+
+
+
+
+
+{{- else if (eq $icon_name "hackerone") -}}
+
+
+
{{- else if (eq $icon_name "hackerrank") -}}
@@ -163,10 +296,10 @@
{{- else if (eq $icon_name "hackthebox") -}}
+ preserveAspectRatio="xMidYMid meet" viewBox="0 0 24 24" fill="currentColor" stroke="none">
+ d="M11.9959.0008a1.1187 1.1187 0 00-.057.002.8993.8993 0 00-.2358.0498.9067.9067 0 00-.1652.079L1.9357 5.675a.889.889 0 00-.4444.7699c0 .006.0004.0128.0006.0192-.0002.007 0 .014 0 .0212V17.556a.889.889 0 00.469.7837l9.5983 5.5416c.018.0102.036.0197.054.0287v.002a.8568.8568 0 00.083.0348c0 .001.01.003.012.004.028.01.056.0177.085.0245.01.001.011.003.016.004.028.006.057.0112.086.0146 0 .0005.01.0009.014.001.03.003.061.005.091.005s.061-.002.091-.005c0-.0005.01-.0009.014-.001a.6831.6831 0 00.086-.0146c.01-.001.011-.002.016-.004a.9404.9404 0 00.085-.0245c0-.001.01-.003.012-.004a.8818.8818 0 00.083-.0347v-.002a1.086 1.086 0 00.054-.0287l9.5986-5.5416a.889.889 0 00.4689-.7837V6.4786c0-.009-.0006-.0172-.0008-.0258h.0003v-.008a.8886.8886 0 00-.3117-.6755c-.01-.008-.019-.0162-.029-.0241 0-.002-.01-.005-.01-.007a.8988.8988 0 00-.1074-.0705L12.4533.1267a.8872.8872 0 00-.4646-.1266zm.01 2.2523c.072 0 .1443.0187.209.056l6.5366 3.774c.2789.161.2789.5633 0 .7243l-6.5367 3.774a.4182.4182 0 01-.4182 0L5.26 6.8074c-.2788-.1609-.2789-.5633 0-.7243l6.5368-3.774a.4193.4193 0 01.209-.056zm-8.0801 6.458a.4145.4145 0 01.215.0565l6.524 3.7666a.417.417 0 01.2086.3612v7.5326c0 .3212-.3477.522-.626.3613l-6.5237-3.7666a.4172.4172 0 01-.2086-.3613V9.1288c0-.2408.1955-.414.4107-.4177zm16.1599 0c.215.004.4107.1768.4107.4177v7.5325c0 .149-.08.2868-.2087.3614l-6.5239 3.7666c-.278.1606-.6258-.0401-.6258-.3614v-7.5325c0-.149.08-.2867.2086-.3613l6.5238-3.7666a.415.415 0 01.2152-.0565z">
@@ -177,6 +310,20 @@
+{{- else if (eq $icon_name "intigriti") -}}
+
+
+
+{{- else if (eq $icon_name "itchio") -}}
+
+
+
+{{- else if (eq $icon_name "kaggle") -}}
+
+
+
{{- else if (eq $icon_name "kakaotalk") -}}
@@ -201,11 +348,38 @@
+{{- else if (eq $icon_name "komoot") -}}
+
+
+
{{- else if (eq $icon_name "lastfm") -}}
+{{- else if (eq $icon_name "leetcode") -}}
+
+
+
+{{- else if (eq $icon_name "letterboxd") -}}
+
+
+
+{{- else if (eq $icon_name "liberapay") -}}
+
+
+
+
+
+
+{{- else if (eq $icon_name "lichess" ) -}}
+
+
+
{{- else if (eq $icon_name "linkedin") -}}
@@ -223,6 +397,11 @@
d="M17.832 8.633v5h-1.978V8.78c0-1.023-.43-1.542-1.29-1.542-.95 0-1.427.616-1.427 1.834v2.655H11.17V9.072c0-1.218-.476-1.834-1.427-1.834-.86 0-1.29.52-1.29 1.542v4.852H6.475V8.633c0-1.022.26-1.834.782-2.434.538-.6 1.243-.909 2.118-.909 1.012 0 1.779.39 2.286 1.169l.492.827.493-.827c.507-.78 1.274-1.169 2.286-1.169.875 0 1.58.308 2.118.909.522.6.782 1.412.782 2.434"
fill="currentColor" stroke="none" />
+{{- else if (eq $icon_name "matrix") -}}
+
+
+
{{- else if (eq $icon_name "medium") -}}
@@ -231,11 +410,31 @@
d="M0 380 l0 -380 380 0 380 0 0 380 0 380 -380 0 -380 0 0 -380z m334 85 c30 -63 57 -115 59 -115 2 0 16 30 31 68 15 37 37 88 49 115 l20 47 76 0 76 -1 -27 -20 -28 -21 0 -151 c0 -150 0 -151 27 -179 l27 -28 -109 0 -109 0 27 28 c26 27 27 32 26 143 0 131 3 134 -71 -58 -24 -62 -48 -113 -53 -113 -6 0 -17 16 -24 35 -7 19 -36 83 -64 142 l-52 108 -3 -98 c-3 -97 -2 -99 28 -133 16 -19 30 -39 30 -44 0 -6 -31 -10 -70 -10 -45 0 -70 4 -70 11 0 6 14 27 30 46 30 33 30 35 30 151 0 116 0 118 -31 155 l-30 37 75 0 76 0 54 -115z" />
+{{- else if (eq $icon_name "microblog") -}}
+
+
+
+
+
+
{{- else if (eq $icon_name "mixcloud") -}}
+{{- else if (eq $icon_name "monero") -}}
+
+
+
+{{- else if (eq $icon_name "neteasecloudmusic") -}}
+
+
+
{{- else if (eq $icon_name "nuget") -}}
@@ -248,6 +447,30 @@
+{{- else if (eq $icon_name "orcid") -}}
+
+
+
+{{- else if (eq $icon_name "osu!") -}}
+
+
+
+
+
+
+{{- else if (eq $icon_name "overcast") -}}
+
+
+
+{{- else if (eq $icon_name "patreon") -}}
+
+
+
{{- else if (eq $icon_name "paypal") -}}
@@ -255,6 +478,46 @@
d="M7.144 19.532l1.049-5.751c.11-.606.691-1.002 1.304-.948 2.155.192 6.877.1 8.818-4.002 2.554-5.397-.59-7.769-6.295-7.769H7.43a1.97 1.97 0 0 0-1.944 1.655L2.77 19.507a.857.857 0 0 0 .846.994h2.368a1.18 1.18 0 0 0 1.161-.969zM7.967 22.522a.74.74 0 0 0 .666.416h2.313c.492 0 .923-.351 1.003-.837l.759-4.601c.095-.523.597-.866 1.127-.819 1.86.166 5.567-.118 6.85-3.821.554-1.6.705-2.954.408-4.018"
style="font-variation-settings:normal" stroke="currentColor" stroke-linejoin="miter" />
+{{- else if (eq $icon_name "peertube") -}}
+
+
+
+{{- else if or (eq $icon_name "pgpkey") (eq $icon_name "key") -}}
+
+
+
+
+{{- else if (eq $icon_name "phone") -}}
+
+
+
+
+
+{{- else if (eq $icon_name "pocketcasts") -}}
+
+
+
+{{- else if (eq $icon_name "polywork") -}}
+
+
+
+{{- else if (eq $icon_name "printables") -}}
+
+
+
+{{- else if (eq $icon_name "pixelfed") -}}
+
+
+
+{{- else if (eq $icon_name "pleroma") -}}
+
+
+
{{- else if (eq $icon_name "qq") -}}
@@ -267,6 +530,18 @@
+{{- else if (eq $icon_name "researchgate") -}}
+
+
+
+{{- else if (eq $icon_name "rootme") -}}
+
+
+
+
{{- else if (eq $icon_name "rss") -}}
@@ -274,6 +549,17 @@
+{{- else if (eq $icon_name "serverfault") -}}
+
+
+
+{{- else if (eq $icon_name "sessionmessenger") -}}
+
+
+
+
{{- else if (eq $icon_name "soundcloud") -}}
+{{- else if (eq $icon_name "sketchfab") -}}
+
+
+
{{- else if (eq $icon_name "slack") -}}
@@ -295,27 +585,21 @@
-{{- else if (eq $icon_name "sourcerer") -}}
-
-
-
-
-
-
-
-
-
-
-
+{{- else if (eq $icon_name "snapchat") -}}
+
+
+
+{{- else if (eq $icon_name "sourcehut") -}}
+
+
+
+
+{{- else if (eq $icon_name "spotify") -}}
+
+
{{- else if (eq $icon_name "stackoverflow") -}}
+ d="M-24.6 20.8c-1.4-.8-2.7-1.5-4.1-2.3-2.4-1.5-3.6-3.6-3.3-6.5.3-3 2.8-5.2 5.8-5.3h11c2.6 0 4.6 2.2 4.7 4.7 0 2.6-2 4.8-4.6 4.9h-2.8v.2c.2.2.5.3.7.5 1.2.7 2.4 1.3 3.6 2 2.5 1.5 3.7 4.5 2.9 7.2-.8 2.7-3.1 4.3-6.1 4.4h-10.6c-2.4 0-4.3-1.9-4.6-4.3-.3-2.3 1.2-4.5 3.5-5.1.6-.1 1.2-.1 1.7-.2h2.1c.1 0 .1-.1.1-.2zm4.3-3.8c-.1.3-.2.3-.2.4v3.9c0 1.1-.1 1.2-1.2 1.2h-5.1c-.4 0-.9 0-1.3.1-1.6.4-2.5 1.9-2.4 3.6.2 1.6 1.6 2.9 3.3 2.9h10.5c2.1 0 3.8-1.2 4.5-3.1.7-1.8.2-4.1-1.5-5.3-2.1-1.3-4.3-2.4-6.6-3.7zm-1.7 3.4v-4c0-1.4.1-1.5 1.4-1.5h5.3c1.5 0 2.7-1 3.1-2.4.6-2.2-1-4.2-3.4-4.3h-10.1c-2.4 0-4.3 1.3-4.9 3.4-.6 2.1.4 4.4 2.5 5.5 1.7 1 3.5 1.9 5.2 2.9.4.2.6.3.9.4z" />
+
+
+
+
+
+
+
+{{- else if (eq $icon_name "strava") -}}
+
+
+
+
+{{- else if (eq $icon_name "substack") -}}
+
+
{{- else if (eq $icon_name "telegram") -}}
+{{- else if (eq $icon_name "thingiverse") -}}
+
+
+
+{{- else if (eq $icon_name "threads") -}}
+
+
+
+{{- else if (eq $icon_name "threema") -}}
+
+
+
+{{- else if (eq $icon_name "tidal") -}}
+
+
+
+{{- else if (eq $icon_name "tiktok") -}}
+
+
+
+{{- else if (eq $icon_name "tryhackme") -}}
+
+
+
+{{- else if (eq $icon_name "tumblr") -}}
+
+
+
{{- else if (eq $icon_name "twitch") -}}
@@ -346,6 +683,61 @@
d="M23 3a10.9 10.9 0 0 1-3.14 1.53 4.48 4.48 0 0 0-7.86 3v1A10.66 10.66 0 0 1 3 4s-4 9 5 13a11.64 11.64 0 0 1-7 2c9 5 20 0 20-11.5a4.5 4.5 0 0 0-.08-.83A7.72 7.72 0 0 0 23 3z">
+{{- else if (eq $icon_name "unsplash") -}}
+
+
+
+
+{{- else if (eq $icon_name "vimeo") -}}
+
+
+
+{{- else if or (eq $icon_name "vk") (eq $icon_name "vkontakte") -}}
+
+
+
+{{- else if (eq $icon_name "wechat") -}}
+
+
+
+
+{{- else if (eq $icon_name "wordpress") -}}
+
+
+
+{{- else if (eq $icon_name "x") -}}
+
+
+
+
+{{- else if (eq $icon_name "xda") -}}
+
+
+
+{{- else if (eq $icon_name "xing") -}}
+
+
+
+
+{{- else if (eq $icon_name "xmpp") -}}
+
+
+
+
+{{- else if (eq $icon_name "ycombinator") -}}
+
+
+
{{- else if (eq $icon_name "youtube") -}}
@@ -354,6 +746,11 @@
+{{- else if (eq $icon_name "zhihu") -}}
+
+
+
{{- else if $icon_name -}}
diff --git a/layouts/partials/templates/opengraph.html b/layouts/partials/templates/opengraph.html
index c0a647df..38fbd246 100644
--- a/layouts/partials/templates/opengraph.html
+++ b/layouts/partials/templates/opengraph.html
@@ -1,5 +1,5 @@
-
+
{{- if .Params.cover.image -}}
@@ -9,57 +9,59 @@
{{- end}}
{{- else }}
-{{ with $.Params.images }}{{ range first 6 . -}}
-
-{{ end }}{{ else -}}
+
+{{- with $.Params.images -}}
+{{- range first 6 . }} {{ end -}}
+{{- else -}}
{{- $images := $.Resources.ByType "image" -}}
{{- $featured := $images.GetMatch "*feature*" -}}
{{- if not $featured }}{{ $featured = $images.GetMatch "{*cover*,*thumbnail*}" }}{{ end -}}
{{- with $featured -}}
-{{ else -}}
-{{- with $.Site.Params.images -}}
-
-{{ end }}{{ end }}{{ end }}
+{{- else -}}
+{{- with site.Params.images }} {{ end -}}
+{{- end -}}
+{{- end -}}
{{- end }}
-{{- $iso8601 := "2006-01-02T15:04:05-07:00" -}}
{{- if .IsPage }}
-{{- if not .PublishDate.IsZero }}
-{{ else if not .Date.IsZero }}
-{{ end }}
-{{- if not .Lastmod.IsZero }} {{ end }}
-{{- else }}
-{{- if not .Date.IsZero }}
-{{- end }}
-{{- end }}{{/* .IsPage */}}
+{{- $iso8601 := "2006-01-02T15:04:05-07:00" -}}
+
+{{ with .PublishDate }} {{ end }}
+{{ with .Lastmod }} {{ end }}
+{{- end -}}
{{- with .Params.audio }} {{ end }}
{{- with .Params.locale }} {{ end }}
-{{- with .Site.Params.title }} {{ end }}
-{{- with .Params.videos }}
-{{- range . }}
+{{- with site.Params.title }} {{ end }}
+{{- with .Params.videos }}{{- range . }}
{{ end }}{{ end }}
{{- /* If it is part of a series, link to related articles */}}
{{- $permalink := .Permalink }}
-{{- $siteSeries := .Site.Taxonomies.series }}{{ with .Params.series }}
-{{- range $name := . }}
+{{- $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 }} {{ end }}
{{- end }}
{{ end }}{{ end }}
+{{- end }}
-{{- if .IsPage }}
-{{- range .Site.Authors }}{{ with .Social.facebook }}
- {{ end }}{{ with .Site.Social.facebook }}
- {{ end }}
-
-{{- with .Params.tags }}{{ range first 6 . }}
- {{ end }}{{ end }}
-{{- end }}{{ end }}
+{{- /* Deprecate site.Social.facebook_admin in favor of site.Params.social.facebook_admin */}}
+{{- $facebookAdmin := "" }}
+{{- with site.Params.social }}
+ {{- if reflect.IsMap . }}
+ {{- $facebookAdmin = .facebook_admin }}
+ {{- end }}
+{{- else }}
+ {{- with site.Social.facebook_admin }}
+ {{- $facebookAdmin = . }}
+ {{- warnf "The social key in site configuration is deprecated. Use params.social.facebook_admin instead." }}
+ {{- end }}
+{{- end }}
{{- /* Facebook Page Admin ID for Domain Insights */}}
-{{- with .Site.Social.facebook_admin }} {{ end }}
+{{ with $facebookAdmin }} {{ end }}
diff --git a/layouts/partials/templates/schema_json.html b/layouts/partials/templates/schema_json.html
index 5cf407ec..435cba51 100644
--- a/layouts/partials/templates/schema_json.html
+++ b/layouts/partials/templates/schema_json.html
@@ -2,28 +2,67 @@
-{{- else if .IsPage }}
+{{- else if (or .IsPage .IsSection) }}
+{{/* BreadcrumbList */}}
+{{- $url := replace .Parent.Permalink ( printf "%s" site.BaseURL) "" }}
+{{- $lang_url := strings.TrimPrefix ( printf "%s/" .Lang) $url }}
+{{- $bc_list := (split $lang_url "/")}}
+
+{{- $scratch := newScratch }}
+
+{{- if .IsPage }}
-{{ end }}
+{{- end }}{{/* .IsPage end */}}
+
+{{- end -}}
diff --git a/layouts/partials/templates/twitter_cards.html b/layouts/partials/templates/twitter_cards.html
index de86c781..0e7760aa 100644
--- a/layouts/partials/templates/twitter_cards.html
+++ b/layouts/partials/templates/twitter_cards.html
@@ -17,7 +17,7 @@
{{- else -}}
-{{- with $.Site.Params.images -}}
+{{- with site.Params.images -}}
{{ else -}}
@@ -27,12 +27,24 @@
{{- end }}
{{- end }}
-
-{{ with .Site.Social.twitter -}}
-
-{{ end -}}
-{{ range .Site.Authors }}
-{{ with .twitter -}}
-
-{{ end -}}
-{{ end -}}
\ No newline at end of file
+
+{{- /* Deprecate site.Social.twitter in favor of site.Params.social.twitter */}}
+{{- $twitterSite := "" }}
+{{- with site.Params.social }}
+ {{- if reflect.IsMap . }}
+ {{- $twitterSite = .twitter }}
+ {{- end }}
+{{- else }}
+ {{- with site.Social.twitter }}
+ {{- $twitterSite = . }}
+ {{- warnf "The social key in site configuration is deprecated. Use params.social.twitter instead." }}
+ {{- end }}
+{{- end }}
+
+{{- with $twitterSite }}
+ {{- $content := . }}
+ {{- if not (strings.HasPrefix . "@") }}
+ {{- $content = printf "@%v" $twitterSite }}
+ {{- end }}
+
+{{- end }}
diff --git a/layouts/partials/toc.html b/layouts/partials/toc.html
index c873bdbc..ef3daee5 100644
--- a/layouts/partials/toc.html
+++ b/layouts/partials/toc.html
@@ -1,84 +1,97 @@
{{- $headers := findRE "(.|\n])+? " .Content -}}
{{- $has_headers := ge (len $headers) 1 -}}
{{- if $has_headers -}}
+
+
+
+ {{- i18n "toc" | default "Table of Contents" }}
+
-{{- $largest := 6 -}}
-{{- range $headers -}}
-{{- $headerLevel := index (findRE "[1-6]" . 1) 0 -}}
-{{- $headerLevel := len (seq $headerLevel) -}}
-{{- if lt $headerLevel $largest -}}
-{{- $largest = $headerLevel -}}
-{{- end -}}
-{{- end -}}
-
-{{- $firstHeaderLevel := len (seq (index (findRE "[1-6]" (index $headers 0) 1) 0)) -}}
-
-{{- $.Scratch.Set "bareul" slice -}}
-
- {{- range seq (sub $firstHeaderLevel $largest) -}}
-
- {{- $.Scratch.Add "bareul" (sub (add $largest .) 1) -}}
- {{- end -}}
- {{- 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 "((.|\n])+?) " "$1" $header -}}
-
- {{- if ne $i 0 -}}
- {{- $prevHeaderLevel := index (findRE "[1-6]" (index $headers (sub $i 1)) 1) 0 -}}
- {{- $prevHeaderLevel := len (seq $prevHeaderLevel) -}}
- {{- if gt $headerLevel $prevHeaderLevel -}}
- {{- range seq $prevHeaderLevel (sub $headerLevel 1) -}}
-
- {{/* the first should not be recorded */}}
- {{- if ne $prevHeaderLevel . -}}
- {{- $.Scratch.Add "bareul" . -}}
+
+ {{- if (.Param "UseHugoToc") }}
+ {{- .TableOfContents -}}
+ {{- else }}
+ {{- $largest := 6 -}}
+ {{- range $headers -}}
+ {{- $headerLevel := index (findRE "[1-6]" . 1) 0 -}}
+ {{- $headerLevel := len (seq $headerLevel) -}}
+ {{- if lt $headerLevel $largest -}}
+ {{- $largest = $headerLevel -}}
{{- end -}}
{{- end -}}
- {{- else -}}
+
+ {{- $firstHeaderLevel := len (seq (index (findRE "[1-6]" (index $headers 0) 1) 0)) -}}
+
+ {{- $.Scratch.Set "bareul" slice -}}
+
+ {{- range seq (sub $firstHeaderLevel $largest) -}}
+
+ {{- $.Scratch.Add "bareul" (sub (add $largest .) 1) -}}
+ {{- end -}}
+ {{- 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 "((.|\n])+?) " "$1" $header -}}
+
+ {{- if ne $i 0 -}}
+ {{- $prevHeaderLevel := index (findRE "[1-6]" (index $headers (sub $i 1)) 1) 0 -}}
+ {{- $prevHeaderLevel := len (seq $prevHeaderLevel) -}}
+ {{- if gt $headerLevel $prevHeaderLevel -}}
+ {{- range seq $prevHeaderLevel (sub $headerLevel 1) -}}
+
+ {{/* the first should not be recorded */}}
+ {{- if ne $prevHeaderLevel . -}}
+ {{- $.Scratch.Add "bareul" . -}}
+ {{- end -}}
+ {{- end -}}
+ {{- else -}}
+
+ {{- if lt $headerLevel $prevHeaderLevel -}}
+ {{- range seq (sub $prevHeaderLevel 1) -1 $headerLevel -}}
+ {{- if in ($.Scratch.Get "bareul") . -}}
+
+ {{/* manually do pop item */}}
+ {{- $tmp := $.Scratch.Get "bareul" -}}
+ {{- $.Scratch.Delete "bareul" -}}
+ {{- $.Scratch.Set "bareul" slice}}
+ {{- range seq (sub (len $tmp) 1) -}}
+ {{- $.Scratch.Add "bareul" (index $tmp (sub . 1)) -}}
+ {{- end -}}
+ {{- else -}}
+
+
+ {{- end -}}
+ {{- end -}}
+ {{- end -}}
+ {{- end }}
+
+ {{- $header | plainify | safeHTML -}}
+ {{- else }}
+
+ {{- $header | plainify | safeHTML -}}
+ {{- end -}}
+ {{- end -}}
+
+ {{- $firstHeaderLevel := $largest }}
+ {{- $lastHeaderLevel := len (seq (index (findRE "[1-6]" (index $headers (sub (len $headers) 1)) 1) 0)) }}
+
+ {{- range seq (sub $lastHeaderLevel $firstHeaderLevel) -}}
+ {{- if in ($.Scratch.Get "bareul") (add . $firstHeaderLevel) }}
+
+ {{- else }}
+
- {{- if lt $headerLevel $prevHeaderLevel -}}
- {{- range seq (sub $prevHeaderLevel 1) -1 $headerLevel -}}
- {{- if in ($.Scratch.Get "bareul") . -}}
-
- {{/* manually do pop item */}}
- {{- $tmp := $.Scratch.Get "bareul" -}}
- {{- $.Scratch.Delete "bareul" -}}
- {{- $.Scratch.Set "bareul" slice}}
- {{- range seq (sub (len $tmp) 1) -}}
- {{- $.Scratch.Add "bareul" (index $tmp (sub . 1)) -}}
- {{- end -}}
- {{- else -}}
-
-
- {{- end -}}
- {{- end -}}
- {{- end -}}
- {{- end -}}
-
- {{- $header | safeHTML -}}
- {{- else -}}
-
- {{- $header | safeHTML -}}
- {{- end -}}
- {{- end -}}
-
- {{- $firstHeaderLevel := $largest }}
- {{- $lastHeaderLevel := len (seq (index (findRE "[1-6]" (index $headers (sub (len $headers) 1)) 1) 0)) -}}
-
- {{- range seq (sub $lastHeaderLevel $firstHeaderLevel) -}}
- {{- if in ($.Scratch.Get "bareul") (add . $firstHeaderLevel) -}}
-
-{{- else -}}
-
-
-{{- end -}}
-{{- end -}}
-
-{{- end -}}
+ {{- end -}}
+ {{- end }}
+
+ {{- end }}
+
+
+
+{{- end }}
diff --git a/layouts/partials/translation_list.html b/layouts/partials/translation_list.html
new file mode 100644
index 00000000..00282519
--- /dev/null
+++ b/layouts/partials/translation_list.html
@@ -0,0 +1,19 @@
+{{- if .IsTranslated -}}
+{{- if (ne .Layout "search") }}
+{{- if or .Params.author site.Params.author (.Param "ShowReadingTime") (not .Date.IsZero) }} | {{- end -}}
+{{- end }}
+{{- i18n "translations" | default "Translations" }}:
+
+{{- end -}}
diff --git a/layouts/robots.txt b/layouts/robots.txt
index da3e7e0d..f26f508d 100644
--- a/layouts/robots.txt
+++ b/layouts/robots.txt
@@ -1,5 +1,5 @@
User-agent: *
-{{- if hugo.IsProduction | or (eq .Site.Params.env "production") }}
+{{- if hugo.IsProduction | or (eq site.Params.env "production") }}
Disallow:
{{- else }}
Disallow: /
diff --git a/layouts/shortcodes/blockquote.html b/layouts/shortcodes/blockquote.html
deleted file mode 100644
index 14bb107a..00000000
--- a/layouts/shortcodes/blockquote.html
+++ /dev/null
@@ -1,72 +0,0 @@
-
-
-
-
-
-{{ $.Scratch.Set "bl_author" false }}
-{{ $.Scratch.Set "bl_source" false }}
-{{ $.Scratch.Set "bl_link" false }}
-{{ $.Scratch.Set "bl_title" false }}
-
-{{ if .IsNamedParams }}
- {{ $.Scratch.Set "bl_author" (.Get "author") }}
- {{ $.Scratch.Set "bl_source" (.Get "source") }}
- {{ $.Scratch.Set "bl_link" (.Get "link") }}
- {{ $.Scratch.Set "bl_title" (.Get "title") }}
-{{ else }}
-
-{{ end }}
-
-
-
-{{ with $.Scratch.Get "bl_title" }}
-
-{{ else }}
- {{ with $.Scratch.Get "bl_link" }}
- {{ range last 1 (split ($.Scratch.Get "bl_link" ) "://") }}
- {{ $.Scratch.Set "title_without_protocol" . }}
- {{ end }}
- {{ range last 1 (split ($.Scratch.Get "title_without_protocol" ) "www.") }}
- {{ $.Scratch.Set "title_without_protocol" . }}
- {{ end }}
- {{ $.Scratch.Set "bl_title" ($.Scratch.Get "title_without_protocol") }}
-
-
- {{ if (gt (len ($.Scratch.Get "title_without_protocol") ) 32) }}
- {{ $title := (slicestr ($.Scratch.Get "title_without_protocol") 0 32) }}
- {{ $split_by_fw_slash := split $title "/" }}
- {{ $count := (sub (len $split_by_fw_slash) 1) }}
-
- {{ $.Scratch.Set "tempstring" "" }}
- {{ range first $count $split_by_fw_slash }}
- {{ $.Scratch.Set "tempstring" ( . | printf "%s%s/" ($.Scratch.Get "tempstring") | printf "%s" ) }}
- {{ end }}
- {{ $.Scratch.Set "bl_title" ( printf "%s..." ($.Scratch.Get "tempstring") | printf "%s" ) }}
- {{ end }}
- {{ end }}
-{{ end }}
-
-
- {{ .Inner | markdownify }}
-
- {{ with $.Scratch.Get "bl_author" }}{{ . }}{{ end }}
- {{ with $.Scratch.Get "bl_source" }}
- {{ . }}
- {{ else }}
- {{ with $.Scratch.Get "bl_link" }}
-
- {{ $.Scratch.Get "bl_title" }}
-
- {{ else }}
- {{ with $.Scratch.Get "bl_title" }}
-
- {{ $.Scratch.Get "bl_title" }}
-
- {{ end }}
- {{ end }}
- {{ end }}
-
-
diff --git a/layouts/shortcodes/collapse.html b/layouts/shortcodes/collapse.html
index b92ad018..17d8d3bc 100644
--- a/layouts/shortcodes/collapse.html
+++ b/layouts/shortcodes/collapse.html
@@ -1,12 +1,8 @@
-{{ if .Get "content" }}
{{ if .Get "summary" }}
{{ else }}
{{ warnf "missing value for param 'summary': %s" .Position }}
{{ end }}
-{{ else }}
-{{ errorf "missing value for param 'content': %s" .Position }}
-{{ end }}
{{ .Get "summary" | markdownify }}
- {{ .Get "content" | markdownify }}
+ {{ .Inner | markdownify }}
diff --git a/layouts/shortcodes/figure.html b/layouts/shortcodes/figure.html
index 71aebb15..8c93effe 100644
--- a/layouts/shortcodes/figure.html
+++ b/layouts/shortcodes/figure.html
@@ -1,8 +1,11 @@
-
+
{{- if .Get "link" -}}
{{- end }}
-
diff --git a/layouts/shortcodes/ltr.html b/layouts/shortcodes/ltr.html
new file mode 100644
index 00000000..4ad7682b
--- /dev/null
+++ b/layouts/shortcodes/ltr.html
@@ -0,0 +1,15 @@
+{{ $.Scratch.Set "md" false }}
+
+{{ if .IsNamedParams }}
+{{ $.Scratch.Set "md" (.Get "md") }}
+{{ else }}
+{{ $.Scratch.Set "md" (.Get 0) }}
+{{ end }}
+
+
+ {{ if eq ($.Scratch.Get "md") false }}
+ {{ .Inner }}
+ {{ else }}
+ {{ .Inner | markdownify }}
+ {{ end }}
+
diff --git a/layouts/shortcodes/rawhtml.html b/layouts/shortcodes/rawhtml.html
index 520ec178..8addb568 100644
--- a/layouts/shortcodes/rawhtml.html
+++ b/layouts/shortcodes/rawhtml.html
@@ -1,2 +1,2 @@
-{{.Inner}}
\ No newline at end of file
+{{- .Inner -}}
diff --git a/layouts/shortcodes/rtl.html b/layouts/shortcodes/rtl.html
new file mode 100644
index 00000000..a69b8ce8
--- /dev/null
+++ b/layouts/shortcodes/rtl.html
@@ -0,0 +1,15 @@
+{{ $.Scratch.Set "md" false }}
+
+{{ if .IsNamedParams }}
+{{ $.Scratch.Set "md" (.Get "md") }}
+{{ else }}
+{{ $.Scratch.Set "md" (.Get 0) }}
+{{ end }}
+
+
+ {{ if eq ($.Scratch.Get "md") false }}
+ {{ .Inner }}
+ {{ else }}
+ {{ .Inner | markdownify }}
+ {{ end }}
+
diff --git a/layouts/shortcodes/youtube.html b/layouts/shortcodes/youtube.html
new file mode 100644
index 00000000..9bd35575
--- /dev/null
+++ b/layouts/shortcodes/youtube.html
@@ -0,0 +1,4 @@
+{{- $id := .Get "id" | default (.Get 0) -}}
+
+
+
\ No newline at end of file
diff --git a/theme.toml b/theme.toml
index e1c6705f..412509dc 100644
--- a/theme.toml
+++ b/theme.toml
@@ -1,11 +1,11 @@
# theme.toml template for a Hugo theme
# See https://github.com/gohugoio/hugoThemes#themetoml for an example
-name = "PaperMod"
+name = "WonderMod"
license = "MIT"
-licenselink = "https://github.com/adityatelange/hugo-PaperMod/blob/master/LICENSE"
+licenselink = "https://github.com/Wonderfall/hugo-WonderMod/blob/master/LICENSE"
description = "A fast, clean, responsive Hugo theme"
-homepage = "https://adityatelange.github.io/hugo-PaperMod/"
+homepage = "https://github.com/Wonderfall/hugo-WonderMod"
tags = [
"responsive",
"simple",
@@ -37,15 +37,15 @@ features = [
"scroll-to-top",
"search"
]
-min_version = "0.74.0"
+min_version = "0.112.4"
[author]
- name = "Aditya Telange"
- homepage = "https://github.com/adityatelange/"
+ name = "Wonderfall"
+ homepage = "https://github.com/Wonderfall"
# If porting an existing theme
[original]
- name = "Paper"
- author = "nanxiaobei"
- homepage = "https://github.com/nanxiaobei"
- repo = "https://github.com/nanxiaobei/hugo-paper/"
+ name = "PaperMod"
+ author = "Aditya Telange"
+ homepage = "https://github.com/adityatelange"
+ repo = "https://github.com/adityatelange/hugo-PaperMod"