mirror of https://github.com/onweru/compose.git

weru
02.28.2025 fd26c84391f9891523ba38ed94a87fe69af61d81
update templates #134
2 files deleted
3 files added
1 files renamed
5 files modified
275 ■■■■ changed files
exampleSite/config/_default/menus/menu.en.toml 29 ●●●●● patch | view | raw | blame | history
exampleSite/config/_default/params.toml 2 ●●● patch | view | raw | blame | history
exampleSite/tina/collections/config.ts patch | view | raw | blame | history
exampleSite/tina/collections/menu.ts patch | view | raw | blame | history
exampleSite/tina/collections/setting.ts patch | view | raw | blame | history
layouts/blog/list.html 45 ●●●●● patch | view | raw | blame | history
layouts/blog/single.html 31 ●●●●● patch | view | raw | blame | history
layouts/home.html patch | view | raw | blame | history
layouts/list.html 69 ●●●● patch | view | raw | blame | history
layouts/single.html 43 ●●●● patch | view | raw | blame | history
layouts/term.html 56 ●●●● patch | view | raw | blame | history
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/"
name = "Example"
weight = 3
url = "https://composedocs.netlify.app"
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
exampleSite/tina/collections/config.ts
exampleSite/tina/collections/menu.ts
exampleSite/tina/collections/setting.ts
layouts/blog/list.html
File was deleted
layouts/blog/single.html
File was deleted
layouts/home.html
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 }}
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 }}
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 -}}
{{- end -}}