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

weru
30.45.2023 43a58bce3d5a22ca03b7228cf82e3497ec70aa69
update template

Signed-off-by: weru <fromweru@gmail.com>
4 files modified
64 ■■■■ changed files
layouts/blog/list.html 31 ●●●● patch | view | raw | blame | history
layouts/blog/single.html 18 ●●●●● patch | view | raw | blame | history
layouts/partials/nav.html 13 ●●●● patch | view | raw | blame | history
layouts/partials/share.html 2 ●●● patch | view | raw | blame | history
layouts/blog/list.html
@@ -1,6 +1,6 @@
{{ define "main" }}
{{- $pages := where site.RegularPages "Section" site.Params.blogDir  }}
<div class = 'wrap pt-2 mt-2'>
<div class="wrap pt-2 mt-2">
  {{- $paginator := .Paginate $pages -}}
  {{- $size := $paginator.PageSize }}
  {{- $scratch := newScratch }}
@@ -11,30 +11,33 @@
      {{ $scratch.Set "image" "thumbnail.svg" }}
    {{ end }}
    {{ $image := $scratch.Get "image" }}
    {{ $bg := (absURL (printf "images/%s" $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 }}'>
        <time class = 'post_date'>{{ dateFormat "January 02, 2006" $value.Date }}</time>
        <h3 class = 'article_title'>{{ $value.Title }}</h3>
        <div class = 'article_excerpt {{ if eq $index 0 }} visible {{ end }}'>
        <p>{{ $value.Summary | truncate 100 }}</p>
  <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 }}">
        <time class="post_date">{{ dateFormat "January 02, 2006" $value.Date }}</time>
        <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 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>
<!-- <a href = '{{ absURL (printf "post/%s" "") }}' class = 'post_nav'>
  <span class = 'post_next'>View Archive
<!-- <a href='{{ absURL (printf "post/%s" "") }}' class=post_nav>
  <span class=post_next>View Archive
  <svg class="icon icon_scale">
    <use xlink:href="#double-arrow"></use>
    <use href="#double-arrow"></use>
  </svg>
  </span>
</a> -->
layouts/blog/single.html
@@ -6,17 +6,21 @@
      <h1 class="post_title">{{ .Title }}</h1>
      <div class="post_body">
        <div class="post_inner">
        {{ with .Params.image }}
          {{- $image := absURL (printf "images/%s" .) }}
          {{ if in . "https://" }}
        {{- with .Params.image }}
          {{- $image := . }}
          {{- if ne (in . "images") true }}
            {{- $image = printf "images/%s" . }}
          {{- end }}
          {{- $image = absURL $image }}
          {{- if in . "https://" }}
            {{- $image = . }}
          {{ end }}
          {{- end }}
          <img src="{{ $image }}" alt="{{ . }}" class="post_thumbnail">
        {{ end }}
          {{ .Content }}
        {{- end }}
          {{- .Content }}
        </div>
        <div class="post_extra mb-2">
          {{ partialCached "share" . }}
          {{- partialCached "share" . }}
        </div>
        <div>
        {{ template "_internal/disqus.html" . }}
layouts/partials/nav.html
@@ -1,12 +1,11 @@
{{- $s := site }}
{{- $sp := $s.Params }}
{{- $config := site.Params }}
<nav class="wrap nav menu">
    <a href='{{ absLangURL "" }}' class="nav_brand">
        {{- $logos := $sp.logo }}
        {{- $logos := $config.logo }}
        {{- $litPath := absURL ($logos.lightMode) }}
        {{- $darkPath := absURL ($logos.darkMode) }}
        <picture data-lit="{{ $litPath }}" data-dark="{{ $darkPath }}">
            <img src="{{ $litPath }}" alt="{{ $s.Title }} Logo">
            <img src="{{ $litPath }}" alt="{{ site.Title }} Logo">
        </picture>
        <label class="nav_toggle toggle" title='{{ T "site_menu" }}' role="button">
            {{ partial "sprite" (dict "icon" "harmburger") }}
@@ -17,7 +16,7 @@
            {{- partial "search" . }}
        </li>
        {{- $p := . }}
        {{- range $s.Menus.main }}
        {{- range site.Menus.main }}
        <li class="nav-item">
            {{- $active := or ($p.IsMenuCurrent "main" .) ($p.HasMenuCurrent "main" .) }}
            {{- with .Page }}
@@ -30,8 +29,8 @@
            <a class="nav-link{{if $active }} active{{end}}" href="{{ $url }}"><span{{if $active }} class="active"{{end}}>{{ T .Identifier | default .Name }}</span></a>
        </li>
        {{- end }}
        {{ $repo := $sp.source }}
        {{ with $sp.source }}
        {{ $repo := $config.source }}
        {{ with $config.source }}
        <li class="nav-item nav_repo">
            <a class="nav-link" href="{{ .url }}" target="_blank">
                {{ if .iconLight }}
layouts/partials/share.html
@@ -2,6 +2,6 @@
{{- $lc := T "link_copied" }}
<div class="copy" data-before="{{ $s }}" data-after="{{ $lc }}">
  <svg class="icon">
    <use xlink:href="#copy"></use>
    <use href="#copy"></use>
  </svg>
</div>