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 {
justify-content: center;
justify-content: flex-start;
}
.index-articles aside {
@ -116,8 +116,8 @@ article {
}
article.index {
width: 256px;
height: 414px;
width: 300px;
height: 485px;
}
article.index img {

2
layouts/_default/list.html

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

2
layouts/_default/single.html

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

4
layouts/partials/article.html

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

6
layouts/partials/image.html

@ -7,7 +7,7 @@ Renders an image with the given class, alt, and sizes.
*/}}
{{- $alt := .alt }}
{{- $image := .image }}
{{- $img := .image }}
{{- $sizes := .sizes }}
{{- $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 */}}
{{- range $index, $width := $sizes }}
{{- $resizeSpec := printf "%dx webp q90" $width }}
{{- $resized := ($image.Resize $resizeSpec) }}
{{- $resized := ($img.Resize $resizeSpec) }}
{{- $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 }}
{{- $smallestResizeSpec := printf "%dx webp q90" $smallestWidth }}
{{- $smallest := ($image.Resize $smallestResizeSpec) }}
{{- $smallest := ($img.Resize $smallestResizeSpec) }}
{{- $src := $smallest.RelPermalink }}
<img class="{{ delimit $classes " " }}"
src="{{ $src }}"

Loading…
Cancel
Save