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:
11
themes/notepadium/layouts/404.html
Normal file
11
themes/notepadium/layouts/404.html
Normal file
@@ -0,0 +1,11 @@
|
||||
{{- define "main" -}}
|
||||
<div class="article-container">
|
||||
<article class="article markdown-body">
|
||||
<h1 id="title">NOT FOUND</h1>
|
||||
<pre class="chroma"><code class="language-c" data-lang="c"><span class="kt">int</span> <span class="nf">main</span><span class="p">(</span><span class="kt">int</span> <span class="n">argc</span><span class="p">,</span> <span class="kt">char</span> <span class="o">*</span><span class="o">*</span><span class="n">argv</span><span class="p">)</span> <span class="p">{</span>
|
||||
<span class="n">printf</span><span class="p">(</span><span class="sa"></span><span class="s">"</span><span class="s">404</span><span class="s">"</span><span class="p">)</span><span class="p">;</span>
|
||||
<span class="k">return</span> <span class="mi">0</span><span class="p">;</span>
|
||||
<span class="p">}</span></code></pre>
|
||||
</article>
|
||||
</div>
|
||||
{{- end -}}
|
||||
15
themes/notepadium/layouts/_default/_markup/render-image.html
Normal file
15
themes/notepadium/layouts/_default/_markup/render-image.html
Normal file
@@ -0,0 +1,15 @@
|
||||
{{- $url := .Destination | safeURL -}}
|
||||
{{- $block := gt (len .Title) 0 -}}
|
||||
|
||||
{{- if $block -}}
|
||||
<span class="image-container"><span class="link">
|
||||
{{- end -}}
|
||||
<img {{ if $block }}class="img"{{ end }} src="{{- $url -}}"
|
||||
alt{{- with .Text -}}="{{- . -}}" {{- end -}} />
|
||||
{{- if $block -}}
|
||||
</span>
|
||||
{{- if ne .Title " " -}}
|
||||
<span class="caption"><span class="title">{{- .Title | safeHTML -}}</span></span>
|
||||
{{- end -}}
|
||||
</span>
|
||||
{{- end -}}
|
||||
@@ -0,0 +1,5 @@
|
||||
{{- $url := .Destination | safeURL -}}
|
||||
{{- $text := .Text | safeHTML -}}
|
||||
<a href="{{- $url -}}"
|
||||
{{- with .Title -}}title="{{- . -}}"{{- end -}}
|
||||
{{- if strings.HasPrefix $url "http" -}}target="_blank" rel="noopener noreferrer"{{- end -}}>{{- $text -}}</a>
|
||||
13
themes/notepadium/layouts/_default/baseof.html
Normal file
13
themes/notepadium/layouts/_default/baseof.html
Normal file
@@ -0,0 +1,13 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="{{- site.Language.Lang -}}">
|
||||
{{- partial "head.html" . -}}
|
||||
|
||||
<body>
|
||||
{{- partial "header.html" . -}}
|
||||
<section id="content">
|
||||
{{- block "main" . -}}{{- end -}}
|
||||
</section>
|
||||
{{- partial "footer.html" . -}}
|
||||
</body>
|
||||
|
||||
</html>
|
||||
20
themes/notepadium/layouts/_default/list.html
Normal file
20
themes/notepadium/layouts/_default/list.html
Normal file
@@ -0,0 +1,20 @@
|
||||
{{- define "main" -}}
|
||||
{{- $paginator := .Paginator -}}
|
||||
|
||||
{{- $title := T .Title -}}
|
||||
{{- if not $title -}}
|
||||
{{- $title = .Title -}}
|
||||
{{- end -}}
|
||||
<section class="article header"><h1>{{- $title -}}</h1></section>
|
||||
{{- if .Content -}}
|
||||
<article class="article markdown-body">
|
||||
<!-- "{{.Content}}" pulls from the markdown content of the corresponding _index.md -->
|
||||
{{- .Content -}}
|
||||
</article>
|
||||
{{- end -}}
|
||||
<!-- Ranges through content/posts/*.md -->
|
||||
|
||||
{{- partial "note-list.html" $paginator -}}
|
||||
{{- partial "pagination.html" $paginator -}}
|
||||
|
||||
{{- end -}}
|
||||
26
themes/notepadium/layouts/_default/rss.xml
Normal file
26
themes/notepadium/layouts/_default/rss.xml
Normal file
@@ -0,0 +1,26 @@
|
||||
<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>{{ .Permalink }}</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 .Site.Author.email }}
|
||||
<managingEditor>{{.}}{{ with $.Site.Author.name }} ({{.}}){{end}}</managingEditor>{{end}}{{ with .Site.Author.email }}
|
||||
<webMaster>{{.}}{{ with $.Site.Author.name }} ({{.}}){{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 />" .Permalink .MediaType | safeHTML }}
|
||||
{{ end }}
|
||||
{{ range first 10 .Site.RegularPages }}
|
||||
<item>
|
||||
<title>{{ .Title }}</title>
|
||||
<link>{{ .Permalink }}</link>
|
||||
<pubDate>{{ .Date.Format "Mon, 02 Jan 2006 15:04:05 -0700" | safeHTML }}</pubDate>
|
||||
{{ with .Site.Author.email }}<author>{{.}}{{ with $.Site.Author.name }} ({{.}}){{end}}</author>{{end}}
|
||||
<guid>{{ .Permalink }}</guid>
|
||||
<description>{{ .Content | html }}</description>
|
||||
</item>
|
||||
{{ end }}
|
||||
</channel>
|
||||
</rss>
|
||||
11
themes/notepadium/layouts/_default/section.html
Normal file
11
themes/notepadium/layouts/_default/section.html
Normal file
@@ -0,0 +1,11 @@
|
||||
{{- define "main" -}}
|
||||
{{- $paginator := .Paginator -}}
|
||||
|
||||
<section class="article header"><h1>{{- .Title -}}</h1></section>
|
||||
{{- partial "section-body.html" . -}}
|
||||
<!-- Ranges through content/posts/*.md -->
|
||||
|
||||
{{- partial "note-list.html" $paginator -}}
|
||||
{{- partial "pagination.html" $paginator -}}
|
||||
|
||||
{{- end -}}
|
||||
22
themes/notepadium/layouts/_default/single.html
Normal file
22
themes/notepadium/layouts/_default/single.html
Normal file
@@ -0,0 +1,22 @@
|
||||
{{- define "main" -}}
|
||||
|
||||
{{- $justify := false -}}
|
||||
{{- if eq .Params.justify true -}} {{- $justify = true -}} {{- end -}}
|
||||
<div class="article-container">
|
||||
{{- partial "article-header.html" . -}}
|
||||
<article class="article markdown-body" {{- if $justify -}}style="text-align: justify;" {{- end -}}>
|
||||
{{- with .Params.cover -}}<p><img class="cover" src="{{- . | safeURL -}}" alt></p>{{- end -}}
|
||||
{{- .Content -}}
|
||||
</article>
|
||||
|
||||
{{- partial "article-labels.html" . -}}
|
||||
{{- partial "article-share.html" . -}}
|
||||
{{- partial "article-license.html" . -}}
|
||||
{{- partial "article-author.html" . -}}
|
||||
{{- partial "article-extra.html" . -}}
|
||||
</div>
|
||||
<div class="article bottom">
|
||||
{{- partial "article-bottom-navigation.html" . -}}
|
||||
{{- partial "article-comments.html" . -}}
|
||||
</div>
|
||||
{{- end -}}
|
||||
6
themes/notepadium/layouts/index.html
Normal file
6
themes/notepadium/layouts/index.html
Normal file
@@ -0,0 +1,6 @@
|
||||
{{- define "main" -}}
|
||||
{{- partial "homepage-body.html" . -}}
|
||||
{{- $paginator := .Paginate (where site.RegularPages "Type" "in" site.Params.mainSections) -}}
|
||||
{{- partial "note-list.html" $paginator -}}
|
||||
{{- partial "pagination.html" $paginator -}}
|
||||
{{- end -}}
|
||||
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 -}}
|
||||
3
themes/notepadium/layouts/robots.txt
Normal file
3
themes/notepadium/layouts/robots.txt
Normal file
@@ -0,0 +1,3 @@
|
||||
User-agent: *
|
||||
Disallow:
|
||||
Sitemap: /sitemap.xml
|
||||
24
themes/notepadium/layouts/shortcodes/bilibili.html
Normal file
24
themes/notepadium/layouts/shortcodes/bilibili.html
Normal file
@@ -0,0 +1,24 @@
|
||||
<div class="video_wrapper" style="position: relative; padding-bottom: 75%;">
|
||||
{{- $bvid := "" -}}
|
||||
{{if .Get "id"}}
|
||||
{{$bvid = .Get "id"}}
|
||||
{{else if .Get 0}}
|
||||
{{$bvid = .Get 0}}
|
||||
{{end}}
|
||||
{{if $bvid}}
|
||||
<iframe
|
||||
style="position: absolute; top: 0; left: 0;"
|
||||
width="100%"
|
||||
height="100%"
|
||||
src="//player.bilibili.com/player.html?aid=123456&bvid={{ $bvid }}&cid=123456&page=1"
|
||||
scrolling="no"
|
||||
border="0"
|
||||
frameborder="no"
|
||||
framespacing="0"
|
||||
allowfullscreen="true"
|
||||
>
|
||||
</iframe>
|
||||
{{else}}
|
||||
<h6>请填写视频 url 中的视频 id,例如:BV1FV411d7u7</h6>
|
||||
{{end}}
|
||||
</div>
|
||||
36
themes/notepadium/layouts/shortcodes/figure.html
Normal file
36
themes/notepadium/layouts/shortcodes/figure.html
Normal file
@@ -0,0 +1,36 @@
|
||||
<span{{ with .Get "class" }} class="{{ . }}"{{ else }} class="image-container"{{ end }}>
|
||||
{{- $src := .Get "src" -}}
|
||||
{{- $link := .Get "link" -}}
|
||||
{{- $target := .Get "target" -}}
|
||||
{{- $alt := .Get "alt" -}}
|
||||
{{- $caption := .Get "caption" -}}
|
||||
{{- $title := .Get "title" -}}
|
||||
{{- $attr := .Get "attr" -}}
|
||||
{{- $attrlink := .Get "attrlink" -}}
|
||||
{{- if not $link -}}{{- $link = $src -}}{{- end -}}
|
||||
{{- if not $target -}}{{- $target = "_blank" -}}{{- end -}}
|
||||
<span class="link" ><a href="{{ $link }}"
|
||||
target="{{ $target }}"{{ with .Get "rel" }}
|
||||
rel="{{ . }}"{{ end }}><img class="img" src="{{ $src }}"
|
||||
{{- if or $alt $caption }}
|
||||
alt="{{ with $alt }}{{ . }}{{ else }}{{ $caption | markdownify| plainify }}{{ end }}"
|
||||
{{- end -}}
|
||||
{{- with .Get "width" }} width="{{ . }}"{{ end -}}
|
||||
{{- with .Get "height" }} height="{{ . }}"{{ end -}}
|
||||
/></a></span>
|
||||
{{- if or (or $title $caption) $attr -}}
|
||||
<span class="caption">
|
||||
{{ with $title -}}
|
||||
<span class="title">{{ . }}</span class="image-container-caption">
|
||||
{{- end -}}
|
||||
{{- if or $caption $attr -}}<p>
|
||||
{{- $caption | markdownify -}}
|
||||
{{- with $attrlink }}
|
||||
<a href="{{ . }}">
|
||||
{{- end -}}
|
||||
{{- $attr | markdownify -}}
|
||||
{{- if $attrlink }}</a>{{ end }}</p>
|
||||
{{- end }}
|
||||
</span>
|
||||
{{- end }}
|
||||
</span>
|
||||
18
themes/notepadium/layouts/shortcodes/gravizo.html
Normal file
18
themes/notepadium/layouts/shortcodes/gravizo.html
Normal file
@@ -0,0 +1,18 @@
|
||||
{{ $title := "Diagram" }}
|
||||
{{ if .IsNamedParams }}
|
||||
{{ with .Get "title" }}
|
||||
{{ $title = . }}
|
||||
{{ end }}
|
||||
{{ else }}
|
||||
{{ with .Get 0 }}
|
||||
{{ $title = . }}
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
|
||||
<figure>
|
||||
<img
|
||||
src='https://g.gravizo.com/svg?{{ .Inner }}'
|
||||
alt='{{ $title }}'
|
||||
/>
|
||||
<figcaption>{{ $title }}</figcaption>
|
||||
</figure>
|
||||
13
themes/notepadium/layouts/shortcodes/plist.html
Normal file
13
themes/notepadium/layouts/shortcodes/plist.html
Normal file
@@ -0,0 +1,13 @@
|
||||
{{- with .Params -}}
|
||||
<table class="plstable">
|
||||
{{- range . -}}
|
||||
{{- $arg := split . ":" -}}
|
||||
{{- $key := index $arg 0 -}}
|
||||
{{- $value := index $arg 1 -}}
|
||||
<tr>
|
||||
<th>{{- $key | markdownify -}}</th>
|
||||
<td>{{- $value | markdownify -}}</td>
|
||||
</tr>
|
||||
{{- end -}}
|
||||
</table>
|
||||
{{- end -}}
|
||||
1
themes/notepadium/layouts/shortcodes/pquote.html
Normal file
1
themes/notepadium/layouts/shortcodes/pquote.html
Normal file
@@ -0,0 +1 @@
|
||||
<p><q>{{ .Inner }}</q></p>
|
||||
2
themes/notepadium/layouts/shortcodes/raw.html
Normal file
2
themes/notepadium/layouts/shortcodes/raw.html
Normal file
@@ -0,0 +1,2 @@
|
||||
<!-- raw html -->
|
||||
{{ .Inner }}
|
||||
24
themes/notepadium/layouts/sitemap.xml
Normal file
24
themes/notepadium/layouts/sitemap.xml
Normal file
@@ -0,0 +1,24 @@
|
||||
{{- 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 not (in .Params.Robots "noindex") -}}
|
||||
<url>
|
||||
<loc>{{- .Permalink -}}</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 .Translations -}}
|
||||
<xhtml:link
|
||||
rel="alternate"
|
||||
hreflang="{{- .Lang -}}"
|
||||
href="{{- .Permalink -}}"
|
||||
/>{{- end -}}
|
||||
<xhtml:link
|
||||
rel="alternate"
|
||||
hreflang="{{- .Lang -}}"
|
||||
href="{{- .Permalink -}}"
|
||||
/>{{- end -}}
|
||||
</url>
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
</urlset>
|
||||
Reference in New Issue
Block a user