Browse Source

using image.html in article-card and article-meta

master
Alexander Avery 9 months ago
parent
commit
adc9b11012
  1. 3
      layouts/partials/article-card.html
  2. 7
      layouts/partials/article-meta.html

3
layouts/partials/article-card.html

@ -1,7 +1,8 @@
<article class="shadow float-on-hover card">
<div class="article-image">
<a href=" {{ .Permalink }}">
{{ partial "responsive-image.html" (dict "context" .)}}
{{ $image := .Resources.GetMatch .Params.featured.url }}
{{ partial "image.html" (dict "image" $image "alt" .Params.featured.alt "class" "fill-wh")}}
</a>
</div>
<div class="article-info-container">

7
layouts/partials/article-meta.html

@ -1,8 +1,8 @@
<section class="article-header">
<h1>{{ .Title | markdownify }}</h1>
{{ $authors := .Params.authors | default (slice .Site.Params.defaultAuthor) }}
{{ $primaryAuthor := index $authors 0 }}
{{- $authors := .Params.authors | default (slice .Site.Params.defaultAuthor) }}
{{- $primaryAuthor := index $authors 0 }}
{{ with $primaryAuthor }}
<a class="center-text" href={{ printf "/%s/%s" "authors" (urlize .) }}>
@ -16,6 +16,7 @@
<a class="small-text" href="{{ .Permalink }}">{{ .LinkTitle }}</a>
{{ end }}
{{ partial "header-image.html" (dict "image" (.Resources.GetMatch .Params.featured.url) "alt" .Params.featured.alt) }}
{{ $image := (.Resources.GetMatch .Params.featured.url) }}
{{ partial "image.html" (dict "image" $image "alt" .Params.featured.alt "class" "shadow featured") }}
</section>

Loading…
Cancel
Save