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/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 +++++++ 23 files changed, 187 insertions(+) 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 (limited to 'layouts/partials') 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 -- cgit v1.3