Compare commits

...

4 Commits

  1. 6
      assets/css/main.css
  2. 2
      layouts/_default/list.html
  3. 2
      layouts/_default/single.html
  4. 4
      layouts/partials/article.html
  5. 6
      layouts/partials/image.html

6
assets/css/main.css

@ -92,7 +92,7 @@ main img {
} }
.author-articles { .author-articles {
justify-content: center; justify-content: flex-start;
} }
.index-articles aside { .index-articles aside {
@ -116,8 +116,8 @@ article {
} }
article.index { article.index {
width: 256px; width: 300px;
height: 414px; height: 485px;
} }
article.index img { article.index img {

2
layouts/_default/list.html

@ -13,7 +13,7 @@
{{- end }} {{- end }}
{{- range (.GetTerms "tags") }} {{- range (.GetTerms "tags") }}
<span><a href="{{ .Permalink }}">{{ .LinkTitle }}</a></span> <span><a href="{{ .Permalink }}">#{{ .LinkTitle }}</a></span>
{{- end }} {{- end }}
{{- partial "image.html" {{- partial "image.html"

2
layouts/_default/single.html

@ -13,7 +13,7 @@
{{- end }} {{- end }}
{{- range (.GetTerms "tags") }} {{- range (.GetTerms "tags") }}
<span><a href="{{ .Permalink }}">{{ .LinkTitle }}</a></span> <span><a href="{{ .Permalink }}">#{{ .LinkTitle }}</a></span>
{{- end }} {{- end }}
{{- partial "image.html" {{- partial "image.html"

4
layouts/partials/article.html

@ -4,10 +4,12 @@
<img src={{ $image.RelPermalink }} alt="{{ .Params.featured.alt }}"> <img src={{ $image.RelPermalink }} alt="{{ .Params.featured.alt }}">
</a> </a>
<h3 class="title">{{ .Title | markdownify }}</h3> <h3 class="title">{{ .Title | markdownify }}</h3>
{{- if not (.Params.hideDate) }}
{{- with .Date }} {{- with .Date }}
<p>{{ .Format "2006/01/02" }}</p> <p>{{ .Format "2006/01/02" }}</p>
{{- end }} {{- end }}
{{- end }}
{{- with index (.GetTerms "tags") 0 }} {{- with index (.GetTerms "tags") 0 }}
<a href="{{ .Permalink }}">{{ .LinkTitle }}</a> <a href="{{ .Permalink }}">#{{ .LinkTitle }}</a>
{{- end }} {{- end }}
</article> </article>

6
layouts/partials/image.html

@ -7,7 +7,7 @@ Renders an image with the given class, alt, and sizes.
*/}} */}}
{{- $alt := .alt }} {{- $alt := .alt }}
{{- $image := .image }} {{- $img := .image }}
{{- $sizes := .sizes }} {{- $sizes := .sizes }}
{{- $classes := .classes }} {{- $classes := .classes }}
@ -18,7 +18,7 @@ Renders an image with the given class, alt, and sizes.
{{/* Loop through widths to resize images and build attributes */}} {{/* Loop through widths to resize images and build attributes */}}
{{- range $index, $width := $sizes }} {{- range $index, $width := $sizes }}
{{- $resizeSpec := printf "%dx webp q90" $width }} {{- $resizeSpec := printf "%dx webp q90" $width }}
{{- $resized := ($image.Resize $resizeSpec) }} {{- $resized := ($img.Resize $resizeSpec) }}
{{- $srcsetParts = $srcsetParts | append (printf "%s %dw" $resized.RelPermalink $width) }} {{- $srcsetParts = $srcsetParts | append (printf "%s %dw" $resized.RelPermalink $width) }}
@ -33,7 +33,7 @@ Renders an image with the given class, alt, and sizes.
{{- $smallestWidth := index $sizes 0 }} {{- $smallestWidth := index $sizes 0 }}
{{- $smallestResizeSpec := printf "%dx webp q90" $smallestWidth }} {{- $smallestResizeSpec := printf "%dx webp q90" $smallestWidth }}
{{- $smallest := ($image.Resize $smallestResizeSpec) }} {{- $smallest := ($img.Resize $smallestResizeSpec) }}
{{- $src := $smallest.RelPermalink }} {{- $src := $smallest.RelPermalink }}
<img class="{{ delimit $classes " " }}" <img class="{{ delimit $classes " " }}"
src="{{ $src }}" src="{{ $src }}"

Loading…
Cancel
Save