Browse Source

responsive shortcode and fixed types

master
Alexander Avery 3 years ago
parent
commit
e58ee3a08a
  1. 2
      layouts/_default/list.html
  2. 11
      layouts/shortcodes/responsive-image.html

2
layouts/_default/list.html

@ -5,7 +5,7 @@
{{ .Content }}
<section class="article-list">
{{ $pages := .Pages }}
{{ if .IsHome }}{{ $pages = where .Site.RegularPages "CurrentSection" "not in" (default "[]" .Site.Params.excludedSections) }}{{ end }}
{{ if .IsHome }}{{ $pages = where .Site.RegularPages "Type" "not in" (default "[]" .Site.Params.excludedSections) }}{{ end }}
{{ range (where $pages "Section" "ne" "") }}
{{ partial "article-card.html" . }}
{{ end }}

11
layouts/shortcodes/responsive-image.html

@ -0,0 +1,11 @@
<img class="fill-wh"
{{ with .Page.Resources.GetMatch (.Get "src") }}
srcset="
{{ (.Resize "320x q30").RelPermalink }} 320w,
{{ (.Resize "600x q40").RelPermalink }} 600w,
{{ (.Resize "1200x q65").RelPermalink }} 2x"
src="{{ .RelPermalink }}"
{{ end }}
alt="{{ .Get "alt" }}"
/>
Loading…
Cancel
Save