mirror of
https://github.com/naoufalzerai/zerai.xyz.git
synced 2025-12-24 22:43:58 +00:00
change theme again :D
This commit is contained in:
34
themes/notepadium/layouts/partials/article-author.html
Normal file
34
themes/notepadium/layouts/partials/article-author.html
Normal file
@@ -0,0 +1,34 @@
|
||||
{{- $profile := .Params.profile -}}
|
||||
{{- if not $profile -}}
|
||||
{{- $profile = site.Params.profile -}}
|
||||
{{- end -}}
|
||||
|
||||
{{- with $profile -}}
|
||||
{{- if eq .enable true -}}
|
||||
<section class="article author">
|
||||
{{- with .avatar -}}<img class="avatar" src="{{- . | relURL -}}" alt>{{- end -}}
|
||||
|
||||
{{- with .name -}}<p class="name">{{- . -}}</p>{{- end -}}
|
||||
|
||||
{{- with .bio -}}<div class="bio">{{- . | markdownify -}}</div>{{- end -}}
|
||||
|
||||
<div class="details">
|
||||
{{- with .github -}}
|
||||
<a class="item" href="https://github.com/{{- . | safeHTML -}}" target="_blank" rel="noopener noreferrer"><span class="iconfont icon-github"></span> {{- . -}}</a>
|
||||
{{- end -}}
|
||||
|
||||
{{- with .docker -}}
|
||||
<a class="item" href="https://hub.docker.com/u/{{- . | safeHTML -}}" target="_blank" rel="noopener noreferrer"><span class="iconfont icon-docker"></span> {{- . -}}</a>
|
||||
{{- end -}}
|
||||
|
||||
{{- with .twitter -}}
|
||||
<a class="item" href="https://twitter.com/{{- . | safeHTML -}}" target="_blank" rel="noopener noreferrer"><span class="iconfont icon-twitter"></span> @{{- . -}}</a>
|
||||
{{- end -}}
|
||||
|
||||
{{- with .email -}}
|
||||
<a class="item" href="mailto:{{- . | safeHTML -}}" target="_blank" rel="noopener noreferrer"><span class="iconfont icon-email"></span> {{- . -}}</a>
|
||||
{{- end -}}
|
||||
</div>
|
||||
</section>
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
@@ -0,0 +1,12 @@
|
||||
{{- if and (not (eq .Params.single true)) (or .PrevInSection .NextInSection) -}}
|
||||
<section class="article navigation">
|
||||
{{- with .NextInSection -}}
|
||||
{{- $title := .Title | safeHTML -}}
|
||||
{{- if $title -}}<p><a class="link" href="{{- .RelPermalink -}}"><span class="iconfont icon-article"></span>{{- $title -}}</a></p>{{- end -}}
|
||||
{{- end -}}
|
||||
{{- with .PrevInSection -}}
|
||||
{{- $title := .Title | safeHTML -}}
|
||||
{{- if $title -}}<p><a class="link" href="{{- .RelPermalink -}}"><span class="iconfont icon-article"></span>{{- .Title | safeHTML -}}</a></p>{{- end -}}
|
||||
{{- end -}}
|
||||
</section>
|
||||
{{- end -}}
|
||||
16
themes/notepadium/layouts/partials/article-comments.html
Normal file
16
themes/notepadium/layouts/partials/article-comments.html
Normal file
@@ -0,0 +1,16 @@
|
||||
{{- if or (eq .Params.comments true) (and (ne .Params.comments false) (eq site.Params.comments.enable true)) -}}
|
||||
<section class="article discussion">
|
||||
{{- if gt (len site.DisqusShortname) 0 -}}
|
||||
{{- template "_internal/disqus.html" . -}}
|
||||
{{- else if ne site.Params.comments.utterances.repo "" -}}
|
||||
<script
|
||||
src="https://utteranc.es/client.js"
|
||||
repo="{{- site.Params.comments.utterances.repo }}"
|
||||
issue-term="{{ default "pathname" site.Params.comments.utterances.issueTerm }}"
|
||||
label="{{- default "" site.Params.comments.utterances.label -}}"
|
||||
theme="{{- default "github-light" site.Params.comments.utterances.theme -}}"
|
||||
crossorigin="anonymous" async>
|
||||
</script>
|
||||
{{- end -}}
|
||||
</section>
|
||||
{{- end -}}
|
||||
3
themes/notepadium/layouts/partials/article-extra.html
Normal file
3
themes/notepadium/layouts/partials/article-extra.html
Normal file
@@ -0,0 +1,3 @@
|
||||
<!--
|
||||
for user-side override
|
||||
-->
|
||||
@@ -0,0 +1,3 @@
|
||||
<!--
|
||||
for user-side override
|
||||
-->
|
||||
29
themes/notepadium/layouts/partials/article-header.html
Normal file
29
themes/notepadium/layouts/partials/article-header.html
Normal file
@@ -0,0 +1,29 @@
|
||||
<section class="article header">
|
||||
<h1 class="article title">{{- .Title | safeHTML -}}</h1>
|
||||
{{- $dateFormat := site.Params.dateFormat -}}
|
||||
{{- if not $dateFormat -}}{{- $dateFormat = "2006-01-02" -}}{{- end -}}
|
||||
{{- $lastmodFormat := "" -}}
|
||||
{{- $lastmod := .Lastmod -}}
|
||||
{{- if $lastmod -}}
|
||||
{{- $lastmodFormat = $lastmod.Format $dateFormat -}}
|
||||
{{- end -}}
|
||||
{{- if .Date -}}
|
||||
{{- $dateFormat := .Date.Format $dateFormat -}}
|
||||
<p class="article date">{{- $dateFormat -}}
|
||||
{{- if and ($lastmod.After .Date) (ne $lastmodFormat $dateFormat) -}}
|
||||
<span class="lastmod">{{- printf (T "edited") $lastmodFormat -}}</span>
|
||||
{{- end -}}
|
||||
{{- if or (eq .Params.readingTime true) (and (not (eq .Params.readingTime false)) (eq site.Params.readingTime true)) -}}
|
||||
<span class="reading-time">{{ T "readingTime" .ReadingTime }}</span>
|
||||
{{- end -}}
|
||||
{{- if .IsTranslated -}}
|
||||
<span class="langs">
|
||||
{{- range .Translations -}}
|
||||
<span class="lang"><a href="{{- .RelPermalink -}}">{{- .Lang -}}</a></span>
|
||||
{{- end -}}
|
||||
</span>
|
||||
{{- end -}}
|
||||
</p>
|
||||
{{- end -}}
|
||||
{{- partial "article-header-extra.html" . -}}
|
||||
</section>
|
||||
16
themes/notepadium/layouts/partials/article-labels.html
Normal file
16
themes/notepadium/layouts/partials/article-labels.html
Normal file
@@ -0,0 +1,16 @@
|
||||
{{- if or .Params.categories .Params.tags -}}
|
||||
<section class="article labels">
|
||||
{{- range .Params.categories -}}
|
||||
{{- $category := replace . "#" "%23" -}}
|
||||
{{- $category = replace $category "." "%2e" -}}
|
||||
{{- $url := print "/categories/" ($category | urlize) "/" -}}
|
||||
<a class="category" href={{- $url | relLangURL -}}>{{- . -}}</a>
|
||||
{{- end -}}
|
||||
{{- range .Params.tags -}}
|
||||
{{- $tag := replace . "#" "%23" -}}
|
||||
{{- $tag = replace $tag "." "%2e" -}}
|
||||
{{- $url := print "/tags/" ($tag | urlize) "/" -}}
|
||||
<a class="tag" href={{- $url | relLangURL -}}>{{- . -}}</a>
|
||||
{{- end -}}
|
||||
</section>
|
||||
{{- end -}}
|
||||
12
themes/notepadium/layouts/partials/article-license.html
Normal file
12
themes/notepadium/layouts/partials/article-license.html
Normal file
@@ -0,0 +1,12 @@
|
||||
{{- $license := "" -}}
|
||||
{{- if and (isset .Params "license") (ne .Params.license "") -}}
|
||||
{{- $license = .Params.license -}}
|
||||
{{- else if and (isset site.Params "license") (ne site.Params.license "") -}}
|
||||
{{- $license = site.Params.license -}}
|
||||
{{- end -}}
|
||||
|
||||
{{- if ne $license "" -}}
|
||||
<section class="article license">
|
||||
{{- $license | safeHTML -}}
|
||||
</section>
|
||||
{{- end -}}
|
||||
11
themes/notepadium/layouts/partials/article-share.html
Normal file
11
themes/notepadium/layouts/partials/article-share.html
Normal file
@@ -0,0 +1,11 @@
|
||||
{{- $addThisId := site.Params.share.addThisId -}}
|
||||
{{- if $addThisId -}}
|
||||
{{- if or (eq .Params.share true) (and (ne .Params.share false) (eq site.Params.share.enable true)) -}}
|
||||
{{- if (gt (len $addThisId) 0) -}}
|
||||
{{- $inlineToolId := site.Params.share.inlineToolId -}}
|
||||
<div class="article share addthis_inline_share_toolbox{{- if $inlineToolId -}}{{- if gt (len $inlineToolId) 0 -}}{{- print "_" $inlineToolId -}}{{- end -}}{{- end -}}"></div>
|
||||
{{- $js := resources.Get "js/addthis_widget.js" | resources.Minify | resources.Fingerprint "sha384" -}}
|
||||
<script defer src="{{- $js.RelPermalink -}}#pubid={{- $addThisId -}}" integrity="{{- $js.Data.Integrity -}}"></script>
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
14
themes/notepadium/layouts/partials/beian.html
Normal file
14
themes/notepadium/layouts/partials/beian.html
Normal file
@@ -0,0 +1,14 @@
|
||||
{{- with site.Params.beian -}}
|
||||
{{- if or .gongan .icp -}}
|
||||
<p style="font-size: 12px;">
|
||||
{{- if .gongan -}}
|
||||
<a href="http://www.beian.gov.cn/portal/registerSystemInfo?recordcode={{- .code -}}" target="_blank" rel="noopener noreferrer"><img style="vertical-align: text-bottom; width: 15px; height: 15px;" src={{- "/assets/img/gonganlogo.png" | relURL -}}>{{- .gongan -}}</a>
|
||||
|
||||
{{- end -}}
|
||||
|
||||
{{- if .icp -}}
|
||||
<a href="http://beian.miit.gov.cn/" target="_blank" rel="noopener noreferrer">{{- .icp -}}</a>
|
||||
{{- end -}}
|
||||
</p>
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
8
themes/notepadium/layouts/partials/copyright.html
Normal file
8
themes/notepadium/layouts/partials/copyright.html
Normal file
@@ -0,0 +1,8 @@
|
||||
{{- $copyright := . -}}
|
||||
<div class="footer-wrap">
|
||||
<p class="copyright">{{- $copyright -}}</p>
|
||||
<p class="powerby"><span>Powered by </span><a href="https://gohugo.io"
|
||||
target="_blank" rel="noopener noreferrer">Hugo</a><span> & </span><a href="https://themes.gohugo.io/hugo-notepadium/"
|
||||
target="_blank" rel="noopener noreferrer">Notepadium</a> {{- partial "ipv6ready.html" . -}}</p>
|
||||
{{- partial "beian.html" . -}}
|
||||
</div>
|
||||
18
themes/notepadium/layouts/partials/custom-css.html
Normal file
18
themes/notepadium/layouts/partials/custom-css.html
Normal file
@@ -0,0 +1,18 @@
|
||||
{{- $context := . -}}
|
||||
{{- $css := "" -}}
|
||||
{{- range site.Params.assets.css -}}
|
||||
{{- $customCSS := resources.Get . -}}
|
||||
{{/* {{- $customCSS := $customCSS | resources.ExecuteAsTemplate (printf "%s.custom.css" .) $context -}} */}}
|
||||
{{- if $customCSS -}}
|
||||
{{- $scss := false -}}
|
||||
{{- $filePath := . | lower -}}
|
||||
{{- if or (strings.HasSuffix $filePath ".scss") (strings.HasSuffix $filePath ".sass") -}}{{- $scss = true -}}{{- end -}}
|
||||
{{- if $scss -}}{{- $customCSS = $customCSS | resources.ToCSS -}}{{- end -}}
|
||||
{{- if eq $css "" -}}
|
||||
{{- $css = $customCSS -}}
|
||||
{{- else -}}
|
||||
{{- $css = slice $css $customCSS | resources.Concat (printf "%s.tmp_custom.css" .) -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
{{- return $css -}}
|
||||
19
themes/notepadium/layouts/partials/custom-js.html
Normal file
19
themes/notepadium/layouts/partials/custom-js.html
Normal file
@@ -0,0 +1,19 @@
|
||||
{{- $js := "" -}}
|
||||
{{- range site.Params.assets.js -}}
|
||||
{{- $customJS := resources.Get . -}}
|
||||
{{- if $customJS -}}
|
||||
{{- if eq $js "" -}}
|
||||
{{- $js = $customJS -}}
|
||||
{{- else -}}
|
||||
{{- $js = slice $js $customJS | resources.Concat (printf "%s.tmp_custom.js" .) -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
|
||||
{{- if ne $js "" -}}
|
||||
{{- $coreJS := slice $js ("" | resources.FromString "js/_core.js") | resources.Concat "js/core.js" -}}
|
||||
{{- $coreJS = $coreJS | resources.Minify | resources.Fingerprint "sha384" -}}
|
||||
<script src="{{- $coreJS.RelPermalink -}}" integrity="{{- $coreJS.Data.Integrity -}}"></script>
|
||||
{{- end -}}
|
||||
|
||||
{{- partial "js.html" . -}}
|
||||
11
themes/notepadium/layouts/partials/footer.html
Normal file
11
themes/notepadium/layouts/partials/footer.html
Normal file
@@ -0,0 +1,11 @@
|
||||
<section id="footer">
|
||||
{{- $copyright := site.Copyright -}}
|
||||
{{- if not $copyright -}}
|
||||
{{- $copyright = site.Title | safeHTML -}}
|
||||
{{- end -}}
|
||||
{{- partial "copyright.html" ($copyright | safeHTML) -}}
|
||||
</section>
|
||||
{{- partial "math.html" . -}}
|
||||
{{- partial "syntax.html" . -}}
|
||||
{{- template "_internal/google_analytics_async.html" . -}}
|
||||
{{- partial "custom-js.html" . -}}
|
||||
3
themes/notepadium/layouts/partials/head-extra.html
Normal file
3
themes/notepadium/layouts/partials/head-extra.html
Normal file
@@ -0,0 +1,3 @@
|
||||
<!--
|
||||
for user-side override
|
||||
-->
|
||||
27
themes/notepadium/layouts/partials/head.html
Normal file
27
themes/notepadium/layouts/partials/head.html
Normal file
@@ -0,0 +1,27 @@
|
||||
<meta charset="utf-8">
|
||||
{{- hugo.Generator -}}
|
||||
<meta name="viewport" content="width=device-width,initial-scale=1,viewport-fit=cover">
|
||||
<meta name="color-scheme" content="light dark">
|
||||
<meta name="supported-color-schemes" content="light dark">
|
||||
|
||||
{{- define "title" -}}
|
||||
{{- $title := .Title -}}
|
||||
{{- if and (ne $title "") (ne $title site.Title) -}}
|
||||
<title>{{- $title | safeHTML -}} – {{- site.Title | safeHTML -}}</title>
|
||||
{{- else -}}
|
||||
{{- $slogan := site.Params.slogan -}}
|
||||
<title>{{- site.Title | safeHTML -}}{{- if and (isset site.Params "slogan") (ne $slogan "") -}} –
|
||||
{{- $slogan | safeHTML -}}{{- end -}}</title>
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
|
||||
{{- block "title" . -}}{{- end -}}
|
||||
|
||||
{{- partial "style.html" . -}}
|
||||
{{- partial "rss-feed.html" . -}}
|
||||
{{- partial "twitter-card.html" . -}}
|
||||
{{- if .Params.Robots -}}
|
||||
<meta name="robots" content="{{ .Params.robots }}" />
|
||||
{{- end -}}
|
||||
{{- partial "head-extra.html" . -}}
|
||||
|
||||
14
themes/notepadium/layouts/partials/header.html
Normal file
14
themes/notepadium/layouts/partials/header.html
Normal file
@@ -0,0 +1,14 @@
|
||||
<section id="header">
|
||||
<div class="header wrap"><span class="header left-side"><a class="site home" href="{{- `/` | relLangURL -}}">
|
||||
{{- $logo := site.Params.logo -}}
|
||||
{{- if $logo -}}
|
||||
<img class="site logo" src="{{- $logo | relURL -}}" alt />
|
||||
{{- end -}}
|
||||
<span class="site name">{{- site.Title | safeHTML -}}</span></a></span>
|
||||
<span class="header right-side">
|
||||
{{- partial "navigation-items.html" site.Params.nav -}}
|
||||
</span></div>
|
||||
{{- with site.Params.slogan -}}
|
||||
<div class="site slogan"><span class="title">{{- . | safeHTML -}}</span></div>
|
||||
{{- end -}}
|
||||
</section>
|
||||
5
themes/notepadium/layouts/partials/homepage-body.html
Normal file
5
themes/notepadium/layouts/partials/homepage-body.html
Normal file
@@ -0,0 +1,5 @@
|
||||
{{- if .Content -}}
|
||||
<article class="article markdown-body">
|
||||
{{- .Content -}}
|
||||
</article>
|
||||
{{- end -}}
|
||||
8
themes/notepadium/layouts/partials/ipv6ready.html
Normal file
8
themes/notepadium/layouts/partials/ipv6ready.html
Normal file
@@ -0,0 +1,8 @@
|
||||
{{- if site.Params.ipv6ready -}}
|
||||
<!-- IPv6-test.com button BEGIN -->
|
||||
<a href='https://ipv6-test.com/validate.php?url=referer'
|
||||
><img src='https://ipv6-test.com/button-ipv6-80x15.png'
|
||||
alt='ipv6 ready' title='ipv6 ready' border='0'
|
||||
/></a>
|
||||
<!-- IPv6-test.com button END -->
|
||||
{{- end -}}
|
||||
3
themes/notepadium/layouts/partials/js.html
Normal file
3
themes/notepadium/layouts/partials/js.html
Normal file
@@ -0,0 +1,3 @@
|
||||
<!--
|
||||
for user-side override
|
||||
-->
|
||||
30
themes/notepadium/layouts/partials/math.html
Normal file
30
themes/notepadium/layouts/partials/math.html
Normal file
@@ -0,0 +1,30 @@
|
||||
{{- if or (eq site.Params.math.enable true) (eq .Params.math true) -}}
|
||||
{{- $use := "katex" -}}
|
||||
|
||||
{{- with site.Params.math -}}
|
||||
{{- if and (isset . "use") (eq (.use | lower) "mathjax") -}}
|
||||
{{- $use = "mathjax" -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
|
||||
{{- if eq $use "mathjax" -}}
|
||||
{{- $url := "https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.7/MathJax.js?config=TeX-AMS-MML_HTMLorMML" -}}
|
||||
{{- $hash := "sha384-e/4/LvThKH1gwzXhdbY2AsjR3rm7LHWyhIG5C0jiRfn8AN2eTN5ILeztWw0H9jmN" -}}
|
||||
<script defer type="text/javascript" src="{{- $url -}}" integrity="{{- $hash -}}" crossorigin="anonymous"></script>
|
||||
<script
|
||||
type="text/x-mathjax-config">MathJax.Hub.Config({ tex2jax: { inlineMath: [['$','$'], ['\\(','\\)']] } });</script>
|
||||
{{- else -}}
|
||||
{{- $url := "https://cdn.jsdelivr.net/npm/katex@0.11.1/dist/katex.min.css" -}}
|
||||
{{- $hash := "sha384-zB1R0rpPzHqg7Kpt0Aljp8JPLqbXI3bhnPWROx27a9N0Ll6ZP/+DiW/UqRcLbRjq" -}}
|
||||
<link rel="stylesheet" href="{{- $url -}}" integrity="{{- $hash -}}" crossorigin="anonymous">
|
||||
|
||||
{{- $url := "https://cdn.jsdelivr.net/npm/katex@0.11.1/dist/katex.min.js" -}}
|
||||
{{- $hash := "sha384-y23I5Q6l+B6vatafAwxRu/0oK/79VlbSz7Q9aiSZUvyWYIYsd+qj+o24G5ZU2zJz" -}}
|
||||
<script defer src="{{- $url -}}" integrity="{{- $hash -}}" crossorigin="anonymous"></script>
|
||||
|
||||
{{- $url := "https://cdn.jsdelivr.net/npm/katex@0.11.1/dist/contrib/auto-render.min.js" -}}
|
||||
{{- $hash := "sha384-kWPLUVMOks5AQFrykwIup5lo0m3iMkkHrD0uJ4H5cjeGihAutqP0yW0J6dpFiVkI" -}}
|
||||
<script defer src="{{- $url -}}" integrity="{{- $hash -}}" crossorigin="anonymous"
|
||||
onload="renderMathInElement(document.body);"></script>
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
20
themes/notepadium/layouts/partials/navigation-items.html
Normal file
20
themes/notepadium/layouts/partials/navigation-items.html
Normal file
@@ -0,0 +1,20 @@
|
||||
{{- $nav := . -}}
|
||||
{{- if or $nav.showCategories $nav.showTags $nav.custom -}}
|
||||
<div class="nav wrap"><nav class="nav">
|
||||
{{- if $nav.showCategories -}}
|
||||
<a class="nav item" href="{{- `/categories/` | relLangURL -}}">{{- T "Categories" -}}</a>
|
||||
{{- end -}}
|
||||
{{- if $nav.showTags -}}
|
||||
<a class="nav item" href="{{- `/tags/` | relLangURL -}}">{{- T "Tags" -}}</a>
|
||||
{{- end -}}
|
||||
{{- range $nav.custom -}}
|
||||
{{- $url := replace .url "#" "%23" -}}
|
||||
{{- $url = replace $url "." "%2e" -}}
|
||||
{{- $url = $url | safeURL -}}
|
||||
{{- if strings.HasPrefix $url "/" -}}{{- $url = $url | relLangURL -}}{{- end -}}
|
||||
<a class="nav item" href="{{- $url -}}"
|
||||
{{- if strings.HasPrefix $url "http" -}}target="_blank" rel="noopener noreferrer"
|
||||
{{- end -}}>{{- .title -}}</a>
|
||||
{{- end -}}
|
||||
</nav></div>
|
||||
{{- end -}}
|
||||
16
themes/notepadium/layouts/partials/note-labels.html
Normal file
16
themes/notepadium/layouts/partials/note-labels.html
Normal file
@@ -0,0 +1,16 @@
|
||||
{{- if or .Params.categories .Params.tags -}}
|
||||
<p class="note labels">
|
||||
{{- range .Params.categories -}}
|
||||
{{- $category := replace . "#" "%23" -}}
|
||||
{{- $category = replace $category "." "%2e" -}}
|
||||
{{- $url := print "/categories/" ($category | urlize) "/" -}}
|
||||
<a class="category" href="{{- $url | relLangURL -}}">{{- . -}}</a>
|
||||
{{- end -}}
|
||||
{{- range .Params.tags -}}
|
||||
{{- $tag := replace . "#" "%23" -}}
|
||||
{{- $tag = replace $tag "." "%2e" -}}
|
||||
{{- $url := print "/tags/" ($tag | urlize) "/" -}}
|
||||
<a class="tag" href="{{- $url | relLangURL -}}">{{- . -}}</a>
|
||||
{{- end -}}
|
||||
</p>
|
||||
{{- end -}}
|
||||
35
themes/notepadium/layouts/partials/note-list.html
Normal file
35
themes/notepadium/layouts/partials/note-list.html
Normal file
@@ -0,0 +1,35 @@
|
||||
{{- $paginator := . -}}
|
||||
|
||||
{{- if gt $paginator.TotalPages 0 -}}
|
||||
{{- $dateFormat := site.Params.dateFormat -}}
|
||||
{{- if not $dateFormat -}}{{- $dateFormat = "2006-01-02" -}}{{- end -}}
|
||||
<ul class="note list">
|
||||
{{- range $paginator.Pages -}}
|
||||
{{- $relURL := replace .RelPermalink "#" "%23" -}}
|
||||
{{- $relURL = replace $relURL "." "%2e" -}}
|
||||
<li class="item"><a class="note" href="{{- $relURL -}}">
|
||||
<p class="note title">{{- .Title | safeHTML -}}</p>
|
||||
{{- if .Date -}}
|
||||
<p class="note date">{{- .Date.Format $dateFormat -}}</p>
|
||||
{{- end -}}
|
||||
{{- if .Summary -}}<p class="note content">{{- .Summary | plainify | safeHTML -}}{{- if .Truncated -}}<span class="mldr">…</span>{{- end -}}</p>{{- end -}}
|
||||
|
||||
{{- $imgs := .Params.imgs -}}
|
||||
{{- with $imgs -}}
|
||||
<span class="note imgs">
|
||||
{{- $imgCount := len $imgs -}}
|
||||
{{- range $imgs -}}
|
||||
{{- $imgurl := lower . -}}
|
||||
{{- if and (not (hasPrefix $imgurl "http://")) (not (hasPrefix $imgurl "https://")) -}}
|
||||
{{- $imgurl = path.Join $relURL . -}}
|
||||
{{- end -}}
|
||||
<img class="img" src="{{- $imgurl -}}" alt />
|
||||
{{- end -}}
|
||||
</span>
|
||||
{{- end -}}
|
||||
</a>
|
||||
{{- partial "note-labels.html" . -}}
|
||||
</li>
|
||||
{{- end -}}
|
||||
</ul>
|
||||
{{- end -}}
|
||||
34
themes/notepadium/layouts/partials/pagination.html
Normal file
34
themes/notepadium/layouts/partials/pagination.html
Normal file
@@ -0,0 +1,34 @@
|
||||
{{- $paginator := . -}}
|
||||
|
||||
{{- if gt $paginator.TotalPages 1 -}}
|
||||
|
||||
{{- $pageIndex := $paginator.PageNumber -}}
|
||||
{{- $totalPages := $paginator.TotalPages -}}
|
||||
{{- $cols := 5.0 -}}
|
||||
{{- $rows := math.Ceil (div $totalPages $cols) -}}
|
||||
{{- $row := math.Ceil (div $pageIndex $cols) -}}
|
||||
{{- $startPage := sub (mul $row $cols) $cols -}}
|
||||
{{- $endPage := add $startPage $cols -}}
|
||||
|
||||
<div class="pagination">
|
||||
<ul>
|
||||
{{- if gt $row 1 -}}
|
||||
<li><a href="{{- $paginator.Prev.URL -}}"><span class="iconfont icon-pagepreview"></span></a></li>
|
||||
{{- end -}}
|
||||
|
||||
{{- range $paginator.Pagers -}}
|
||||
{{- if and (gt .PageNumber $startPage) (le .PageNumber $endPage) -}}
|
||||
{{- $active := "" -}}
|
||||
{{- if eq .PageNumber $paginator.PageNumber -}}
|
||||
{{- $active = "active" -}}
|
||||
{{- end -}}
|
||||
<li><a class="{{- $active -}}" href="{{- .URL -}}">{{- .PageNumber -}}</a></li>
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
|
||||
{{- if lt $row $rows -}}
|
||||
<li><a href="{{- $paginator.Next.URL -}}"><span class="iconfont icon-pagenext"></span></a></li>
|
||||
{{- end -}}
|
||||
</ul>
|
||||
</div>
|
||||
{{- end -}}
|
||||
3
themes/notepadium/layouts/partials/rss-feed.html
Normal file
3
themes/notepadium/layouts/partials/rss-feed.html
Normal file
@@ -0,0 +1,3 @@
|
||||
{{- range .AlternativeOutputFormats -}}
|
||||
{{ printf `<link rel="%s" type="%s" href="%s" title="%s" />` .Rel .MediaType.Type .RelPermalink $.Site.Title | safeHTML }}
|
||||
{{- end -}}
|
||||
5
themes/notepadium/layouts/partials/section-body.html
Normal file
5
themes/notepadium/layouts/partials/section-body.html
Normal file
@@ -0,0 +1,5 @@
|
||||
{{- if .Content -}}
|
||||
<article class="article markdown-body">
|
||||
{{- .Content -}}
|
||||
</article>
|
||||
{{- end -}}
|
||||
81
themes/notepadium/layouts/partials/style.html
Normal file
81
themes/notepadium/layouts/partials/style.html
Normal file
@@ -0,0 +1,81 @@
|
||||
{{- $style := "auto" -}}
|
||||
{{- if and (isset site.Params "style") (ne site.Params.style "") -}}
|
||||
{{- $style = site.Params.style | lower -}}
|
||||
{{- end -}}
|
||||
|
||||
{{- $coreCSS := resources.Get "css/normalize.css" -}}
|
||||
{{- $coreCSS = slice $coreCSS (resources.Get "css/style.css") | resources.Concat "css/tmp_normalize.css" -}}
|
||||
{{- if ne $style "light" -}}
|
||||
{{- $darkStyle := resources.Get "css/dark-style.css" -}}
|
||||
{{- if $darkStyle -}}
|
||||
{{- if eq $style "dark" -}}
|
||||
{{- $coreCSS = slice $coreCSS $darkStyle | resources.Concat "css/tmp_style.css" -}}
|
||||
{{- else -}}
|
||||
{{- $darkStyleBegin := (print "@media (prefers-color-scheme: dark) {") | resources.FromString "css/tmp_style_dark_begin.css" -}}
|
||||
{{- $darkStyleEnd := (print "}") | resources.FromString "css/tmp_style_dark_end.css" -}}
|
||||
{{- $darkStyleCSS := slice $darkStyleBegin $darkStyle | resources.Concat "css/tmp_style_dark_.css" -}}
|
||||
{{- $darkStyleCSS = slice $darkStyleCSS $darkStyleEnd | resources.Concat "css/tmp_style_dark.css" -}}
|
||||
{{- $coreCSS = slice $coreCSS $darkStyleCSS | resources.Concat "css/tmp_style.css" -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
|
||||
{{- $themePath := "" -}}
|
||||
{{- $theme := "dracula" -}}
|
||||
{{- with site.Params.syntax -}}
|
||||
{{- $use := "none" -}}
|
||||
{{- if and (isset . "use") (ne .use "") -}}{{- $use = .use | lower -}}{{- end -}}
|
||||
{{- if and (isset . "theme") (ne .theme "") -}}{{- $theme = .theme | lower -}}{{- end -}}
|
||||
|
||||
{{- if eq $use "hljs" -}}
|
||||
{{- $themePath = "css/hljs/" -}}
|
||||
{{- else if eq $use "prismjs" -}}
|
||||
{{- $themePath = "css/prism/" -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
|
||||
{{- if eq $themePath "" -}}
|
||||
{{- $themePath = "css/chroma/" -}}
|
||||
{{- end -}}
|
||||
|
||||
{{- $syntaxCSS := resources.Get (print (path.Join $themePath $theme) ".css") -}}
|
||||
|
||||
{{- $darkTheme := site.Params.syntax.darkTheme -}}
|
||||
{{- if and $darkTheme (ne $darkTheme "") -}}
|
||||
{{- if ne $style "light" -}}
|
||||
{{- $darkSyntax := resources.Get (print (path.Join $themePath $darkTheme) ".css") -}}
|
||||
{{- if $darkSyntax -}}
|
||||
{{- if eq $style "dark" -}}
|
||||
{{- $syntaxCSS = $darkSyntax -}}
|
||||
{{- else -}}
|
||||
{{- $darkSyntaxBegin := (print "@media (prefers-color-scheme: dark) {") | resources.FromString "css/tmp_syntax_dark_begin.css" -}}
|
||||
{{- $darkSyntaxEnd := (print "}") | resources.FromString "css/tmp_syntax_dark_end.css" -}}
|
||||
{{- $darkSyntaxCSS := slice $darkSyntaxBegin $darkSyntax | resources.Concat "css/tmp_syntax_dark_.css" -}}
|
||||
{{- $darkSyntaxCSS = slice $darkSyntaxCSS $darkSyntaxEnd | resources.Concat "css/tmp_syntax_dark.css" -}}
|
||||
{{- if $syntaxCSS -}}
|
||||
{{- $syntaxCSS = slice $syntaxCSS $darkSyntaxCSS | resources.Concat "css/tmp_syntax.css" -}}
|
||||
{{- else -}}
|
||||
{{- $syntaxCSS = $darkSyntaxCSS -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
|
||||
{{- if $syntaxCSS -}}
|
||||
{{- $coreCSS = slice $coreCSS $syntaxCSS | resources.Concat "css/tmp_core.css" -}}
|
||||
{{- end -}}
|
||||
|
||||
{{- $iconfontCSS := (resources.Get "css/iconfont.css") | resources.ExecuteAsTemplate "css/tmp_iconfont.css" . -}}
|
||||
{{- $coreCSS = slice $coreCSS $iconfontCSS | resources.Concat "css/tmp_iconfont_core.css" -}}
|
||||
|
||||
{{- with partial "custom-css.html" . -}}
|
||||
{{- if ne . "" -}}
|
||||
{{- $coreCSS = slice $coreCSS . | resources.Concat "css/custom_core.css" -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
|
||||
{{- $coreCSS = slice $coreCSS ("" | resources.FromString "css/_core.css") | resources.Concat "css/core.css" -}}
|
||||
{{- $coreCSS = $coreCSS | resources.Minify | resources.Fingerprint "sha384" -}}
|
||||
|
||||
<link rel="stylesheet" href="{{- $coreCSS.RelPermalink -}}" integrity="{{- $coreCSS.Data.Integrity -}}">
|
||||
21
themes/notepadium/layouts/partials/syntax.html
Normal file
21
themes/notepadium/layouts/partials/syntax.html
Normal file
@@ -0,0 +1,21 @@
|
||||
{{- with site.Params.syntax -}}
|
||||
{{- $use := "none" -}}
|
||||
{{- if and (isset . "use") (ne .use "") -}}
|
||||
{{- $use = .use | lower -}}
|
||||
{{- end -}}
|
||||
|
||||
{{- $syntaxJS := "" -}}
|
||||
{{- if eq $use "hljs" -}}
|
||||
{{- $syntaxJS = "js/hljs.js" -}}
|
||||
{{- else if eq $use "prismjs" -}}
|
||||
{{- $syntaxJS = "js/prism.js" -}}
|
||||
{{- end -}}
|
||||
|
||||
{{- if ne $syntaxJS "" -}}
|
||||
{{- $js := resources.Get $syntaxJS | resources.Minify | resources.Fingerprint "sha384" -}}
|
||||
<script src="{{- $js.RelPermalink -}}" integrity="{{- $js.Data.Integrity -}}"></script>
|
||||
{{- if eq $use "hljs" -}}
|
||||
<script>hljs.initHighlightingOnLoad();</script>
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
17
themes/notepadium/layouts/partials/twitter-card.html
Normal file
17
themes/notepadium/layouts/partials/twitter-card.html
Normal file
@@ -0,0 +1,17 @@
|
||||
<meta name="twitter:card" content="summary" />
|
||||
<meta name="twitter:title" content="{{- .Title -}}" />
|
||||
{{- $imgurl := "" -}}
|
||||
|
||||
{{- if .Params.cover -}}
|
||||
{{- $imgurl = .Params.cover -}}
|
||||
{{- else if .Params.imgs -}}
|
||||
{{- $imgurl = index .Params.imgs 0 -}}
|
||||
{{- end -}}
|
||||
|
||||
{{- if gt (len $imgurl) 0 -}}
|
||||
{{- $imgurl = lower $imgurl -}}
|
||||
{{- if and (not (hasPrefix $imgurl "http://")) (not (hasPrefix $imgurl "https://")) -}}
|
||||
{{- $imgurl = print .Permalink $imgurl -}}
|
||||
{{- end -}}
|
||||
<meta name="twitter:image" content="{{- $imgurl -}}" />
|
||||
{{- end -}}
|
||||
Reference in New Issue
Block a user