From fd26c84391f9891523ba38ed94a87fe69af61d81 Mon Sep 17 00:00:00 2001
From: weru <fromweru@gmail.com>
Date: Sun, 02 Nov 2025 12:28:16 +0000
Subject: [PATCH] update templates #134
---
/dev/null | 31 -------
layouts/home.html | 0
exampleSite/tina/collections/setting.ts | 0
exampleSite/config/_default/menus/menu.en.toml | 29 +++----
layouts/term.html | 56 +++++++------
layouts/single.html | 43 +++++++++-
exampleSite/tina/collections/config.ts | 0
layouts/list.html | 69 ++++++++++++++--
exampleSite/config/_default/params.toml | 2
exampleSite/tina/collections/menu.ts | 0
10 files changed, 139 insertions(+), 91 deletions(-)
diff --git a/exampleSite/config/_default/menus/menu.en.toml b/exampleSite/config/_default/menus/menu.en.toml
index b7a2b37..fc3d841 100644
--- a/exampleSite/config/_default/menus/menu.en.toml
+++ b/exampleSite/config/_default/menus/menu.en.toml
@@ -1,25 +1,20 @@
# menu items
[[main]]
- name = "Blog"
- weight = 5
- url = "blog/"
+name = "Blog"
+weight = 4
+url = "blog/"
[[main]]
- name = "Docs"
- weight = 2
- url = "docs/"
+name = "Docs"
+weight = 2
+url = "docs/"
[[main]]
- name = "Tutorials"
- weight = 2
- url = "tutorials/"
+name = "Tutorials"
+weight = 2
+url = "tutorials/"
[[main]]
- name = "Example"
- weight = 3
- url = "https://docs.neuralvibes.com"
-
-# [[main]]
-# name = "Blog"
-# weight = 4
-# url = "blog/"
\ No newline at end of file
+name = "Example"
+weight = 3
+url = "https://composedocs.netlify.app"
diff --git a/exampleSite/config/_default/params.toml b/exampleSite/config/_default/params.toml
index 837f1bf..24cc4fc 100644
--- a/exampleSite/config/_default/params.toml
+++ b/exampleSite/config/_default/params.toml
@@ -13,7 +13,7 @@
defaultLightingMode = "auto" # other possible values: "dark", "light"
# sets the maximum number of lines per codeblock. The codeblock will however be scrollable and expandable.
-codeMaxLines = 10
+codeMaxLines = 15
# show/hide line numbers by default. Switch to `true` if you'd rather have them on.
showLineNumbers = false
diff --git a/exampleSite/tina/collections/config.ts b/exampleSite/tina/collections/config.ts
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/exampleSite/tina/collections/config.ts
diff --git a/exampleSite/tina/collections/menu.ts b/exampleSite/tina/collections/menu.ts
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/exampleSite/tina/collections/menu.ts
diff --git a/exampleSite/tina/collections/setting.ts b/exampleSite/tina/collections/setting.ts
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/exampleSite/tina/collections/setting.ts
diff --git a/layouts/blog/list.html b/layouts/blog/list.html
deleted file mode 100644
index 7100f50..0000000
--- a/layouts/blog/list.html
+++ /dev/null
@@ -1,45 +0,0 @@
-{{ define "main" }}
-{{- $pages := where site.RegularPages "Section" site.Params.blogDir }}
-<div class="wrap pt-2 mt-2">
- {{- $paginator := .Paginate $pages -}}
- {{- $size := $paginator.PagerSize }}
- {{- $scratch := newScratch }}
- {{- range $index, $value := $paginator.Pages }}
- {{- if isset .Params "image" }}
- {{- $scratch.Set "image" .Params.image }}
- {{- else }}
- {{- $scratch.Set "image" "thumbnail.svg" }}
- {{- end }}
- {{- $image := $scratch.Get "image" }}
- {{- $bg := $image }}
- {{- if ne (in $image "images") true }}
- {{- $bg = (absURL (printf "images/%s" $image)) }}
- {{- end }}
- {{- if in $image "https://" }}
- {{- $bg = $image }}
- {{- end }}
- <article class="article mb-2">
- <a href="{{ $value.Permalink }}" {{ if eq $index 0 }} class="grid-reverse" {{ end }}>
- <div class="article_thumb" style="background-image: url({{ $bg }});"></div>
- <div class="article_meta {{ if eq $index 0 }} center_y {{ end }}">
- <div class="post_date">{{ dateFormat "January 02, 2006" $value.Date }}</div>
- <h3 class="article_title">{{ $value.Title }}</h3>
- <div class="article_excerpt {{ if eq $index 0 }} visible {{ end }}">
- <p>{{ truncate 100 $value.Summary }}</p>
- </div>
- </div>
- </a>
- </article>
- {{- if and (eq $index 0) (gt $size 1) }}<div class="grid-2 article_showcase">{{ end }}
- {{- if and (eq $index (add $size -1)) (gt $size 1) }}</div>{{ end }}
- {{- end }}
-</div>
-</div>
-<!-- <a href='{{ absURL (printf "post/%s" "") }}' class=post_nav>
- <span class=post_next>View Archive
- <svg class="icon icon_scale">
- <use href="#double-arrow"></use>
- </svg>
- </span>
-</a> -->
-{{- end }}
\ No newline at end of file
diff --git a/layouts/blog/single.html b/layouts/blog/single.html
deleted file mode 100644
index 3cf092b..0000000
--- a/layouts/blog/single.html
+++ /dev/null
@@ -1,31 +0,0 @@
-{{ define "main" }}
- <div class="wrap mt post">
- <div>
- {{- $date := (dateFormat "02. January 2006" .Date) -}}
- <p class="post_date">{{ $date }}</p>
- <h1 class="post_title">{{ .Title }}</h1>
- <div class="post_body">
- <div class="post_inner">
- {{- with .Params.image }}
- {{- $image := . }}
- {{- if ne (in . "images") true }}
- {{- $image = printf "images/%s" . }}
- {{- end }}
- {{- $image = absURL $image }}
- {{- if in . "https://" }}
- {{- $image = . }}
- {{- end }}
- <img src="{{ $image }}" alt="{{ . }}" class="post_thumbnail">
- {{- end }}
- {{- .Content }}
- </div>
- <div class="post_extra mb-2">
- {{- partialCached "share" . }}
- </div>
- <div>
- {{ partial "disqus.html" . }}
- </div>
- </div>
- </div>
- </div>
-{{ end }}
diff --git a/layouts/index.html b/layouts/home.html
similarity index 100%
rename from layouts/index.html
rename to layouts/home.html
diff --git a/layouts/list.html b/layouts/list.html
index ddbfa62..5cd2c0e 100644
--- a/layouts/list.html
+++ b/layouts/list.html
@@ -1,14 +1,61 @@
{{- define "main" }}
- {{- .Content }}
- {{ if eq .Kind "taxonomy" }}
- <ol>
- {{ range .Data.Pages }}
- <li>
- <a href="{{ .Permalink }}">
- {{ .Title }}
+ {{- $blog := site.Params.blogDir }}
+ {{- if eq .Section $blog }}
+ {{- $pages := where site.RegularPages "Section" $blog }}
+ <div class="wrap pt-2 mt-2">
+ {{- $paginator := .Paginate $pages -}}
+ {{- $size := $paginator.PagerSize }}
+ {{- $scratch := newScratch }}
+ {{- range $index, $value := $paginator.Pages }}
+ {{- if isset .Params "image" }}
+ {{- $scratch.Set "image" .Params.image }}
+ {{- else }}
+ {{- $scratch.Set "image" "thumbnail.svg" }}
+ {{- end }}
+ {{- $image := $scratch.Get "image" }}
+ {{- $bg := $image }}
+ {{- if ne (in $image "images") true }}
+ {{- $bg = (absURL (printf "images/%s" $image)) }}
+ {{- end }}
+ {{- if in $image "https://" }}
+ {{- $bg = $image }}
+ {{- end }}
+ <article class="article mb-2">
+ <a href="{{ $value.Permalink }}" {{ if eq $index 0 }} class="grid-reverse" {{ end }}>
+ <div class="article_thumb" style="background-image: url({{ $bg }});"></div>
+ <div class="article_meta {{ if eq $index 0 }} center_y {{ end }}">
+ <div class="post_date">{{ dateFormat "January 02, 2006" $value.Date }}</div>
+ <h3 class="article_title">{{ $value.Title }}</h3>
+ <div class="article_excerpt {{ if eq $index 0 }} visible {{ end }}">
+ <p>{{ truncate 100 $value.Plain }}</p>
+ </div>
+ </div>
</a>
- </li>
- {{ end }}
- </ol>
- {{ end }}
+ </article>
+ {{- if and (eq $index 0) (gt $size 1) }}<div class="grid-2 article_showcase">{{ end }}
+ {{- if and (eq $index (add $size -1)) (gt $size 1) }}</div>{{ end }}
+ {{- end }}
+ </div>
+ </div>
+ <!-- <a href='{{ absURL (printf "post/%s" "") }}' class=post_nav>
+ <span class=post_next>View Archive
+ <svg class="icon icon_scale">
+ <use href="#double-arrow"></use>
+ </svg>
+ </span>
+ </a> -->
+ {{- else }}
+ {{- .Content }}
+ {{ if eq .Kind "taxonomy" }}
+ <ol>
+ {{ range .Data.Pages }}
+ <li>
+ <a href="{{ .Permalink }}">
+ {{ .Title }}
+ </a>
+ </li>
+ {{ end }}
+ </ol>
+ {{- end }}
+ {{- end }}
{{- end }}
diff --git a/layouts/single.html b/layouts/single.html
index d300530..77649ea 100644
--- a/layouts/single.html
+++ b/layouts/single.html
@@ -1,7 +1,40 @@
{{- define "main" }}
-<div class="content">
- <h1>{{ .Title }}</h1>
- {{ with .Params.description }}<div>{{ markdownify . }}</div>{{ end }}
- {{- .Content }}
-</div>
+ {{- $blog := site.Params.blogDir }}
+ {{- if eq .Section $blog }}
+ <div class="wrap mt post">
+ <div>
+ {{- $date := (dateFormat "02. January 2006" .Date) -}}
+ <p class="post_date">{{ $date }}</p>
+ <h1 class="post_title">{{ .Title }}</h1>
+ <div class="post_body">
+ <div class="post_inner">
+ {{- with .Params.image }}
+ {{- $image := . }}
+ {{- if ne (in . "images") true }}
+ {{- $image = printf "images/%s" . }}
+ {{- end }}
+ {{- $image = absURL $image }}
+ {{- if in . "https://" }}
+ {{- $image = . }}
+ {{- end }}
+ <img src="{{ $image }}" alt="{{ . }}" class="post_thumbnail">
+ {{- end }}
+ {{- .Content }}
+ </div>
+ <div class="post_extra mb-2">
+ {{- partialCached "share" . }}
+ </div>
+ <div>
+ {{ partial "disqus.html" . }}
+ </div>
+ </div>
+ </div>
+ </div>
+ {{ else }}
+ <div class="content">
+ <h1>{{ .Title }}</h1>
+ {{ with .Params.description }}<div>{{ markdownify . }}</div>{{ end }}
+ {{- .Content }}
+ </div>
+ {{ end }}
{{- end }}
diff --git a/layouts/term.html b/layouts/term.html
index 56f9643..73aaabf 100644
--- a/layouts/term.html
+++ b/layouts/term.html
@@ -6,31 +6,35 @@
{{- $size := $paginator.PagerSize }}
{{- $scratch := newScratch }}
{{- range $index, $value := $paginator.Pages }}
- {{- if isset .Params "image" }}
- {{- $scratch.Set "image" .Params.image }}
- {{- else }}
- {{- $scratch.Set "image" "thumbnail.svg" }}
- {{- end }}
- {{- $image := $scratch.Get "image" }}
- {{- $bg := (absURL (printf "images/%s" $image)) }}
- {{- if in $image "https://" }}
- {{- $bg = $image }}
- {{- end }}
- <article class="article mb-2">
- <a href="{{ $value.Permalink }}" {{ if eq $index 0 }} class=grid-reverse {{ end }}>
- <div class="article_thumb" style="background-image: url({{ $bg }})"></div>
- <div class="article_meta {{ if eq $index 0 }} center_y {{ end }}">
- <div class="post_date">{{ dateFormat "January 02, 2006" $value.Date }}</div>
- <h3 class="article_title">{{ $value.Title }}</h3>
- <div class="article_excerpt {{ if eq $index 0 }} visible {{ end }}">
- <p>{{ $value.Summary | truncate 100 }}</p>
+ {{- if isset .Params "image" }}
+ {{- $scratch.Set "image" .Params.image }}
+ {{- else }}
+ {{- $scratch.Set "image" "thumbnail.svg" }}
+ {{- end }}
+ {{- $image := $scratch.Get "image" }}
+ {{- $bg := absURL $image }}
+ {{- if in $image "https://" }}
+ {{- $bg = $image }}
+ {{- end }}
+ <article class="article mb-2">
+ <a href="{{ $value.Permalink }}" {{ if eq $index 0 }} class=grid-reverse {{ end }}>
+ <div class="article_thumb" style="background-image: url({{ $bg }})"></div>
+ <div class="article_meta {{ if eq $index 0 }} center_y {{ end }}">
+ <div class="post_date">{{ dateFormat "January 02, 2006" $value.Date }}</div>
+ <h3 class="article_title">{{ $value.Title }}</h3>
+ <div class="article_excerpt {{ if eq $index 0 }} visible {{ end }}">
+ <p>{{ truncate 100 .Plain }}</p>
+ </div>
</div>
- </div>
- </a>
- </article>
- {{- if and (eq $index 0) (gt $size 1) }}<div class="grid-2 article_showcase">{{ end }}
- {{- if and (eq $index (add $size -1)) (gt $size 1) }}</div>{{ end }}
- {{- end }}
+ </a>
+ </article>
+ {{- if and (eq $index 0) (gt $size 1) }}
+ <div class="grid-2 article_showcase">
+ {{ end }}
+ {{- if and (eq $index (add $size -1)) (gt $size 1) }}
+ </div>
+ {{ end }}
+ {{- end }}
+ </div>
</div>
-</div>
-{{- end -}}
\ No newline at end of file
+{{- end -}}
--
Gitblit v1.10.0