From 04fdcac1dce2cc439dd8ad1b115507671040737e Mon Sep 17 00:00:00 2001 From: Miqdd Date: Mon, 22 Jan 2024 06:39:54 +0700 Subject: Publish --- layouts/404.html | 0 layouts/_default/baseof.html | 11 ++++ layouts/_default/list.html | 17 ++++++ layouts/_default/single.html | 42 ++++++++++++++ layouts/_default/term.html | 17 ++++++ layouts/_default/terms.html | 20 +++++++ layouts/index.html | 30 ++++++++++ layouts/partials/disqus.html | 19 +++++++ layouts/partials/footer.html | 21 +++++++ layouts/partials/head.html | 14 +++++ layouts/partials/header.html | 104 ++++++++++++++++++++++++++++++++++ layouts/partials/pagedescription.html | 7 +++ layouts/partials/paginator.html | 15 +++++ layouts/shortcodes/callout.html | 6 ++ 14 files changed, 323 insertions(+) create mode 100644 layouts/404.html create mode 100644 layouts/_default/baseof.html create mode 100644 layouts/_default/list.html create mode 100644 layouts/_default/single.html create mode 100644 layouts/_default/term.html create mode 100644 layouts/_default/terms.html create mode 100644 layouts/index.html create mode 100644 layouts/partials/disqus.html create mode 100644 layouts/partials/footer.html create mode 100644 layouts/partials/head.html create mode 100644 layouts/partials/header.html create mode 100644 layouts/partials/pagedescription.html create mode 100644 layouts/partials/paginator.html create mode 100644 layouts/shortcodes/callout.html (limited to 'layouts') diff --git a/layouts/404.html b/layouts/404.html new file mode 100644 index 0000000..e69de29 diff --git a/layouts/_default/baseof.html b/layouts/_default/baseof.html new file mode 100644 index 0000000..b941097 --- /dev/null +++ b/layouts/_default/baseof.html @@ -0,0 +1,11 @@ + + + {{- partial "header.html" . -}} + +
+ {{- partial "head.html" . -}} + {{- block "main" . }}{{- end }} + {{- partial "footer.html" . -}} +
+ + diff --git a/layouts/_default/list.html b/layouts/_default/list.html new file mode 100644 index 0000000..6e8b10c --- /dev/null +++ b/layouts/_default/list.html @@ -0,0 +1,17 @@ +{{ define "main" }} +{{ if isset .Data "Term" }} +

Entries tagged - "{{ .Data.Term }}"

+{{ else }} +

All articles

+{{ end }} + + +{{ end }} diff --git a/layouts/_default/single.html b/layouts/_default/single.html new file mode 100644 index 0000000..0e96234 --- /dev/null +++ b/layouts/_default/single.html @@ -0,0 +1,42 @@ +{{ define "main" }} +
+
+
+

{{ .Title }}

+
Posted on {{ dateFormat "Jan 2, 2006" .Date }}{{ if .Draft }} DRAFT {{ end }}
+
+ {{ if isset .Params "tldr" }} +
+ tl;dr: + {{ .Params.tldr }} +
{{ end }} + +
+ {{ .Content }} +
+ + + {{- $.Scratch.Set "isDisqus" true -}} + + {{ if not .Site.DisqusShortname }} + {{- $.Scratch.Set "isDisqus" false -}} + {{ end }} + + {{- if eq ($.Scratch.Get "isDisqus") true -}} + {{- partial "disqus.html" . -}} + {{- end -}} +
+
+{{ end }} diff --git a/layouts/_default/term.html b/layouts/_default/term.html new file mode 100644 index 0000000..41a4c6f --- /dev/null +++ b/layouts/_default/term.html @@ -0,0 +1,17 @@ +{{ define "main" }} +{{ if isset .Data "Term" }} +

Entries tagged - "{{ .Data.Term }}"

+{{ else }} +

All articles

+{{ end }} + + +{{ end }} diff --git a/layouts/_default/terms.html b/layouts/_default/terms.html new file mode 100644 index 0000000..fea9c2f --- /dev/null +++ b/layouts/_default/terms.html @@ -0,0 +1,20 @@ +{{ define "main" }} +

All tags

+ +{{ $biggest := 1 }} +{{ $smallest := 1 }} +{{ $max := 3 }} +{{ $min := 1 }} +{{ $size := $min }} + +{{ $data := .Data }} +
+ +
+{{ end }} diff --git a/layouts/index.html b/layouts/index.html new file mode 100644 index 0000000..bd4d1da --- /dev/null +++ b/layouts/index.html @@ -0,0 +1,30 @@ + + + {{ partial "header.html" . }} + +
+ {{ partial "head.html" . }} + +
+
+ {{- if isset .Site.Params "subtitle" -}} +

{{ .Site.Params.Subtitle | markdownify }}

+ {{- end -}} +
+ {{ $pages := where .Site.RegularPages "Type" "in" .Site.Params.mainSections }} + {{ $paginator := .Paginate (where $pages "Params.hidden" "ne" true) }} + {{ range $paginator.Pages }} +
+

{{.Title}}

+ +
{{ template "partials/pagedescription.html" . }} + Read more ⟶ +
+ {{ end }} + {{ template "partials/paginator.html" . }} +
+ {{ partial "footer.html" . }} +
+ + + diff --git a/layouts/partials/disqus.html b/layouts/partials/disqus.html new file mode 100644 index 0000000..11bd488 --- /dev/null +++ b/layouts/partials/disqus.html @@ -0,0 +1,19 @@ +
+ + +comments powered by Disqus \ No newline at end of file diff --git a/layouts/partials/footer.html b/layouts/partials/footer.html new file mode 100644 index 0000000..b453bff --- /dev/null +++ b/layouts/partials/footer.html @@ -0,0 +1,21 @@ + +{{ if not .Site.IsServer }} +{{ template "_internal/google_analytics_async.html" . }} +{{ end }} + +{{- if (isset .Site.Params "social") -}} + +{{- end -}} diff --git a/layouts/partials/head.html b/layouts/partials/head.html new file mode 100644 index 0000000..30476c8 --- /dev/null +++ b/layouts/partials/head.html @@ -0,0 +1,14 @@ +
+ + +
diff --git a/layouts/partials/header.html b/layouts/partials/header.html new file mode 100644 index 0000000..ad3ae4c --- /dev/null +++ b/layouts/partials/header.html @@ -0,0 +1,104 @@ + + + + {{- $title := ( .Title ) -}} + {{- $siteTitle := ( .Site.Title ) -}} + {{- if .IsHome -}} + {{ $siteTitle }} | Home + {{- else -}} + {{ $title }} - {{ $siteTitle }} + {{- end -}} + + {{- if isset .Site.Params "favicon" -}} + + {{- end -}} + + + + + {{ with .OutputFormats.Get "rss" -}} + {{ printf `` .Rel .MediaType.Type .Permalink $.Site.Title | safeHTML }} + {{ end -}} + + {{- template "_internal/opengraph.html" . -}} + {{- template "_internal/twitter_cards.html" . -}} + {{ if and (isset .Site.Params "social") (.Site.Params.useCDN | default false) -}} + + {{- else if or (isset .Site.Params "social") (eq .Site.Params.mode "toggle") -}} + + {{ end }} + {{ if .Site.Params.useCDN | default false -}} + + + + {{- else -}} + {{ $fontstyle := resources.Get "css/fonts.css" | fingerprint }} + + {{ end }} + + {{ $style := resources.Get "css/main.css" | fingerprint }} + + + {{- if or (eq .Site.Params.mode "auto") (eq .Site.Params.mode "dark") (eq .Site.Params.mode "toggle") -}} + {{ $darkstyle := resources.Get "css/dark.css" | fingerprint }} + + {{ end }} + + + {{ with .Site.Params.mathjax }} + + + + + {{ end }} + + + {{ with .Site.Params.katex }} + + + + + + + {{ end }} + + + {{- if isset .Site.Params "customcss" }} + {{ range .Site.Params.customCSS }} + {{ $customstyle := resources.Get . | fingerprint }} + + {{ end }} + {{- end -}} + {{- range .Site.Params.customJS }} + {{- if or (hasPrefix . "http://") (hasPrefix . "https://") }} + + {{- else if (hasPrefix . " + {{- end }} + {{- end }} + diff --git a/layouts/partials/pagedescription.html b/layouts/partials/pagedescription.html new file mode 100644 index 0000000..d69bb9a --- /dev/null +++ b/layouts/partials/pagedescription.html @@ -0,0 +1,7 @@ +
+ {{ if isset .Params "description" }} + {{ .Description }} + {{ else }} + {{ .Summary }}… + {{ end }} +
\ No newline at end of file diff --git a/layouts/partials/paginator.html b/layouts/partials/paginator.html new file mode 100644 index 0000000..5acc06d --- /dev/null +++ b/layouts/partials/paginator.html @@ -0,0 +1,15 @@ +{{ $pag := $.Paginator }} +{{ if gt $pag.TotalPages 1 }} + +{{ end }} diff --git a/layouts/shortcodes/callout.html b/layouts/shortcodes/callout.html new file mode 100644 index 0000000..5557aad --- /dev/null +++ b/layouts/shortcodes/callout.html @@ -0,0 +1,6 @@ + +
+
+ 💡 {{ .Get "text" }} +
+
\ No newline at end of file -- cgit v1.2.3