From 2c17fbcdf8ea36d9d10dba243db94de85575e8ed Mon Sep 17 00:00:00 2001 From: Martin Kagamino Lehoux Date: Mon, 2 Oct 2023 09:02:20 +0200 Subject: chore: Copy theme layouts --- layouts/404.html | 12 +++++++++++ layouts/_default/baseof.html | 13 +++++++++++ layouts/_default/list.html | 17 +++++++++++++++ layouts/_default/single.html | 3 +++ layouts/index.html | 17 +++++++++++++++ layouts/partials/footer.html | 4 ++++ layouts/partials/footer/copyright.html | 3 +++ layouts/partials/footer/social.html | 5 +++++ layouts/partials/handler/svg.html | 6 ++++++ layouts/partials/head.html | 2 ++ layouts/partials/head/styles.html | 13 +++++++++++ layouts/partials/header.html | 7 ++++++ layouts/partials/header/avatar.html | 7 ++++++ layouts/partials/header/nav.html | 10 +++++++++ layouts/partials/header/title.html | 7 ++++++ layouts/partials/list/categories.html | 3 +++ layouts/partials/list/components/pagination.html | 25 ++++++++++++++++++++++ layouts/partials/list/default.html | 11 ++++++++++ .../single/components/comments/comments.html | 11 ++++++++++ .../single/components/comments/disqus.html | 4 ++++ .../single/components/comments/giscus.html | 21 ++++++++++++++++++ .../single/components/metatag/categories.html | 8 +++++++ .../partials/single/components/metatag/tags.html | 9 ++++++++ .../partials/single/components/metatag/time.html | 4 ++++ .../partials/single/components/title/large.html | 1 + .../partials/single/components/title/small.html | 1 + layouts/partials/single/default.html | 17 +++++++++++++++ layouts/partials/single/homepage.html | 8 +++++++ layouts/robot.txt | 4 ++++ layouts/shortcodes/begin-task-list.html | 1 + layouts/shortcodes/img.html | 23 ++++++++++++++++++++ layouts/taxonomies/home.html | 17 +++++++++++++++ 32 files changed, 294 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/index.html create mode 100644 layouts/partials/footer.html create mode 100644 layouts/partials/footer/copyright.html create mode 100644 layouts/partials/footer/social.html create mode 100644 layouts/partials/handler/svg.html create mode 100644 layouts/partials/head.html create mode 100644 layouts/partials/head/styles.html create mode 100644 layouts/partials/header.html create mode 100644 layouts/partials/header/avatar.html create mode 100644 layouts/partials/header/nav.html create mode 100644 layouts/partials/header/title.html create mode 100644 layouts/partials/list/categories.html create mode 100644 layouts/partials/list/components/pagination.html create mode 100644 layouts/partials/list/default.html create mode 100644 layouts/partials/single/components/comments/comments.html create mode 100644 layouts/partials/single/components/comments/disqus.html create mode 100644 layouts/partials/single/components/comments/giscus.html create mode 100644 layouts/partials/single/components/metatag/categories.html create mode 100644 layouts/partials/single/components/metatag/tags.html create mode 100644 layouts/partials/single/components/metatag/time.html create mode 100644 layouts/partials/single/components/title/large.html create mode 100644 layouts/partials/single/components/title/small.html create mode 100644 layouts/partials/single/default.html create mode 100644 layouts/partials/single/homepage.html create mode 100644 layouts/robot.txt create mode 100644 layouts/shortcodes/begin-task-list.html create mode 100644 layouts/shortcodes/img.html create mode 100644 layouts/taxonomies/home.html diff --git a/layouts/404.html b/layouts/404.html new file mode 100644 index 0000000..d042ff8 --- /dev/null +++ b/layouts/404.html @@ -0,0 +1,12 @@ +{{ define "main" }} + +
+
+

{{ .Title }}

+
+
+ Looks like you've followed a broken link or entered a URL that doesn't exist on this site. +
+
+ +{{ end }} \ No newline at end of file diff --git a/layouts/_default/baseof.html b/layouts/_default/baseof.html new file mode 100644 index 0000000..69be8f7 --- /dev/null +++ b/layouts/_default/baseof.html @@ -0,0 +1,13 @@ + + + + {{- partial "head.html" . -}} + + + {{ partial "header.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..577852f --- /dev/null +++ b/layouts/_default/list.html @@ -0,0 +1,17 @@ +{{ define "main" }} +{{ $pages := .Pages }} +{{ $paginator := .Paginate $pages }} +
+

{{ if .Params.header }}{{ .Params.header }}{{ else }}{{ .Title }}{{ end }}

+{{ if .Content }}

{{ .Content }}

{{ end }} +
+ +
+{{ range $index, $pages := $paginator.Pages }} + {{ partial "list/default" . }} +{{ end }} +
+ +{{ partial "list/components/pagination" . }} + +{{ end }} \ No newline at end of file diff --git a/layouts/_default/single.html b/layouts/_default/single.html new file mode 100644 index 0000000..13aa7d0 --- /dev/null +++ b/layouts/_default/single.html @@ -0,0 +1,3 @@ +{{ define "main" }} +{{ partial "single/default" . }} +{{ end }} \ No newline at end of file diff --git a/layouts/index.html b/layouts/index.html new file mode 100644 index 0000000..7f31f64 --- /dev/null +++ b/layouts/index.html @@ -0,0 +1,17 @@ +{{ define "main" }} +{{ if site.Params.isSinglePage }} +{{ partial "single/homepage" . }} +{{ else }} +{{ $pages := where site.RegularPages "Type" "in" site.Params.mainSections }} +{{ $paginator := .Paginate $pages }} +
+

Latest Posts

+
+
+{{ range $index, $pages := $paginator.Pages }} + {{ partial "list/default" . }} +{{ end }} +
+{{ partial "list/components/pagination" . }} +{{ end }} +{{ end }} \ No newline at end of file diff --git a/layouts/partials/footer.html b/layouts/partials/footer.html new file mode 100644 index 0000000..73f32ae --- /dev/null +++ b/layouts/partials/footer.html @@ -0,0 +1,4 @@ + \ No newline at end of file diff --git a/layouts/partials/footer/copyright.html b/layouts/partials/footer/copyright.html new file mode 100644 index 0000000..b24cc2c --- /dev/null +++ b/layouts/partials/footer/copyright.html @@ -0,0 +1,3 @@ +
+ © {{ replace .Site.Copyright "{year}" now.Year }} — {{ .Site.Title }} with Lowkey +
\ No newline at end of file diff --git a/layouts/partials/footer/social.html b/layouts/partials/footer/social.html new file mode 100644 index 0000000..0b70dd6 --- /dev/null +++ b/layouts/partials/footer/social.html @@ -0,0 +1,5 @@ +
+ +
\ No newline at end of file diff --git a/layouts/partials/handler/svg.html b/layouts/partials/handler/svg.html new file mode 100644 index 0000000..72162e8 --- /dev/null +++ b/layouts/partials/handler/svg.html @@ -0,0 +1,6 @@ +{{- $iconFile := resources.GetMatch (printf "icons/%s.svg" .) -}} +{{- if $iconFile -}} + {{- $iconFile.Content | safeHTML -}} +{{- else -}} + {{- errorf "Error: icon '%s.svg' is not found under 'assets/icons' folder" . -}} +{{- end -}} \ No newline at end of file diff --git a/layouts/partials/head.html b/layouts/partials/head.html new file mode 100644 index 0000000..27e7b20 --- /dev/null +++ b/layouts/partials/head.html @@ -0,0 +1,2 @@ +{{- partial "head/meta.html" . -}} +{{- partial "head/styles.html" . -}} diff --git a/layouts/partials/head/styles.html b/layouts/partials/head/styles.html new file mode 100644 index 0000000..68577ce --- /dev/null +++ b/layouts/partials/head/styles.html @@ -0,0 +1,13 @@ +{{/* Resources */}} +{{- $tailwind := resources.Get "css/tailwind.css" | postCSS (dict "config" "./config/postcss.config.js") -}} + +{{/* Processor */}} +{{- $styles := slice $tailwind | resources.Concat "css/app.css" -}} + +{{/* Output */}} +{{- if eq hugo.Environment "development" -}} + +{{- else -}} +{{- $styles := $styles | minify | fingerprint | resources.PostProcess -}} + +{{- end -}} diff --git a/layouts/partials/header.html b/layouts/partials/header.html new file mode 100644 index 0000000..cdfb463 --- /dev/null +++ b/layouts/partials/header.html @@ -0,0 +1,7 @@ +
+ {{ partial "header/avatar.html" . }} +
+ {{ partial "header/title.html" . }} + {{ partial "header/nav.html" . }} +
+
\ No newline at end of file diff --git a/layouts/partials/header/avatar.html b/layouts/partials/header/avatar.html new file mode 100644 index 0000000..e3c1021 --- /dev/null +++ b/layouts/partials/header/avatar.html @@ -0,0 +1,7 @@ +{{ $avatar := resources.GetMatch .Site.Params.avatar }} +{{ $tiny := ($avatar.Fill "80x80 q90") }} +
+ + {{ .Site.Title }} + +
diff --git a/layouts/partials/header/nav.html b/layouts/partials/header/nav.html new file mode 100644 index 0000000..c0c20b3 --- /dev/null +++ b/layouts/partials/header/nav.html @@ -0,0 +1,10 @@ + \ No newline at end of file diff --git a/layouts/partials/header/title.html b/layouts/partials/header/title.html new file mode 100644 index 0000000..d6e6ba3 --- /dev/null +++ b/layouts/partials/header/title.html @@ -0,0 +1,7 @@ + + {{ if .IsHome }} +

{{ .Site.Title }}

+ {{ else }} +

{{ .Site.Title }}

+ {{ end }} +
\ No newline at end of file diff --git a/layouts/partials/list/categories.html b/layouts/partials/list/categories.html new file mode 100644 index 0000000..db527c6 --- /dev/null +++ b/layouts/partials/list/categories.html @@ -0,0 +1,3 @@ +
  • + {{ .Title }} ({{ len .Pages }}) +
  • diff --git a/layouts/partials/list/components/pagination.html b/layouts/partials/list/components/pagination.html new file mode 100644 index 0000000..07b3e74 --- /dev/null +++ b/layouts/partials/list/components/pagination.html @@ -0,0 +1,25 @@ +{{ $paginator := .Paginator }} + +
    + + +
    + {{ if $paginator.HasPrev }} + + {{ partial "handler/svg" "arrow-left" }} + Newer Posts + + {{ end }} +
    + +
    + + {{ if $paginator.HasNext }} + + Older Posts + {{ partial "handler/svg" "arrow-right" }} + + {{ end }} +
    + +
    diff --git a/layouts/partials/list/default.html b/layouts/partials/list/default.html new file mode 100644 index 0000000..a965ce5 --- /dev/null +++ b/layouts/partials/list/default.html @@ -0,0 +1,11 @@ +
    +

    {{ .Title }}

    +
    + {{ if .Params.description }} + {{ .Params.description }} + {{ else if .Summary }} + {{ .Summary }} + {{ end }} +
    + +
    \ No newline at end of file diff --git a/layouts/partials/single/components/comments/comments.html b/layouts/partials/single/components/comments/comments.html new file mode 100644 index 0000000..2eae412 --- /dev/null +++ b/layouts/partials/single/components/comments/comments.html @@ -0,0 +1,11 @@ +{{ if .IsPage }} + + {{ if .Site.Params.giscus.enable }} + {{ partial "single/components/comments/giscus" . }} + {{ end }} + + + {{ if .Site.Params.disqusShortname }} + {{ partial "single/components/comments/disqus" . }} + {{ end }} +{{ end }} \ No newline at end of file diff --git a/layouts/partials/single/components/comments/disqus.html b/layouts/partials/single/components/comments/disqus.html new file mode 100644 index 0000000..b794098 --- /dev/null +++ b/layouts/partials/single/components/comments/disqus.html @@ -0,0 +1,4 @@ +
    + {{/* https://gohugo.io/templates/internal/#disqus */}} + {{- template "_internal/disqus.html" . -}} +
    \ No newline at end of file diff --git a/layouts/partials/single/components/comments/giscus.html b/layouts/partials/single/components/comments/giscus.html new file mode 100644 index 0000000..4daa23a --- /dev/null +++ b/layouts/partials/single/components/comments/giscus.html @@ -0,0 +1,21 @@ +
    + +
    \ No newline at end of file diff --git a/layouts/partials/single/components/metatag/categories.html b/layouts/partials/single/components/metatag/categories.html new file mode 100644 index 0000000..1d0f808 --- /dev/null +++ b/layouts/partials/single/components/metatag/categories.html @@ -0,0 +1,8 @@ +{{ with (.GetTerms "categories") }} + — + {{ range . }} + + {{ .LinkTitle }} + + {{ end }} +{{ end }} \ No newline at end of file diff --git a/layouts/partials/single/components/metatag/tags.html b/layouts/partials/single/components/metatag/tags.html new file mode 100644 index 0000000..800ebc2 --- /dev/null +++ b/layouts/partials/single/components/metatag/tags.html @@ -0,0 +1,9 @@ +{{ with (.GetTerms "tags") }} +
    + {{ range . }} + + {{ .LinkTitle }} + + {{ end }} +
    +{{ end }} diff --git a/layouts/partials/single/components/metatag/time.html b/layouts/partials/single/components/metatag/time.html new file mode 100644 index 0000000..4575fc0 --- /dev/null +++ b/layouts/partials/single/components/metatag/time.html @@ -0,0 +1,4 @@ +{{- $pubdate := .PublishDate.Format "2 January 2006" }} + \ No newline at end of file diff --git a/layouts/partials/single/components/title/large.html b/layouts/partials/single/components/title/large.html new file mode 100644 index 0000000..20b9b3f --- /dev/null +++ b/layouts/partials/single/components/title/large.html @@ -0,0 +1 @@ +

    {{ .Title }}

    diff --git a/layouts/partials/single/components/title/small.html b/layouts/partials/single/components/title/small.html new file mode 100644 index 0000000..bda0a1e --- /dev/null +++ b/layouts/partials/single/components/title/small.html @@ -0,0 +1 @@ +

    {{ .Title }}

    \ No newline at end of file diff --git a/layouts/partials/single/default.html b/layouts/partials/single/default.html new file mode 100644 index 0000000..2d2ad63 --- /dev/null +++ b/layouts/partials/single/default.html @@ -0,0 +1,17 @@ +
    +
    + {{ partial "single/components/title/large" . }} +
    + {{ partial "single/components/metatag/time" . }} + {{ partial "single/components/metatag/categories" . }} +
    +
    +
    + {{/* {{.TableOfContents}} */}} + {{ .Content | emojify }} +
    + {{ partial "single/components/comments/comments" . }} +
    + {{ partial "single/components/metatag/tags" . }} +
    +
    \ No newline at end of file diff --git a/layouts/partials/single/homepage.html b/layouts/partials/single/homepage.html new file mode 100644 index 0000000..2e80535 --- /dev/null +++ b/layouts/partials/single/homepage.html @@ -0,0 +1,8 @@ +
    +
    + {{ partial "single/components/title/small" . }} +
    +
    + {{ .Content | emojify }} +
    +
    \ No newline at end of file diff --git a/layouts/robot.txt b/layouts/robot.txt new file mode 100644 index 0000000..ac68366 --- /dev/null +++ b/layouts/robot.txt @@ -0,0 +1,4 @@ +User-agent: * +{{ range .Pages }} +Disallow: {{ .RelPermalink }} +{{ end }} \ No newline at end of file diff --git a/layouts/shortcodes/begin-task-list.html b/layouts/shortcodes/begin-task-list.html new file mode 100644 index 0000000..73a7776 --- /dev/null +++ b/layouts/shortcodes/begin-task-list.html @@ -0,0 +1 @@ + diff --git a/layouts/shortcodes/img.html b/layouts/shortcodes/img.html new file mode 100644 index 0000000..a0673a3 --- /dev/null +++ b/layouts/shortcodes/img.html @@ -0,0 +1,23 @@ +{{/* Image Resources */}} +{{ $img := .Page.Resources.GetMatch (printf "%s" (.Get "src" | safeURL ))}} +{{ $alt := .Get "alt"}} + +{{/* Image Processing */}} +{{ $command := .Get "size-method" }} +{{ $options := .Get "size-format" }} +{{ if eq $command "Fit"}} + {{ $img = $img.Fit $options }} +{{ else if eq $command "Resize"}} + {{ $img = $img.Resize $options }} +{{ else if eq $command "Fill"}} + {{ $img = $img.Fill $options }} +{{ else if eq $command "Crop"}} + {{ $img = $img.Crop $options }} +{{ end }} + +{{/* Position */}} +{{ $position := .Get "position" }} + +
    + +
    \ No newline at end of file diff --git a/layouts/taxonomies/home.html b/layouts/taxonomies/home.html new file mode 100644 index 0000000..6a7dce5 --- /dev/null +++ b/layouts/taxonomies/home.html @@ -0,0 +1,17 @@ +{{ define "main" }} +{{ $pages := .Pages }} +
    +

    {{ if .Params.header }}{{ .Params.header }}{{ else }}{{ .Title }}{{ end }}

    +{{ if .Content }}

    {{ .Content }}

    {{ end }} +
    + +
    + +
    + + +{{ end }} -- cgit v1.3