mirror of
https://github.com/tiennm99/hugoDocs.git
synced 2026-10-14 16:17:21 +00:00
Move showcase items in list view to a template in the layout
This seems more efficient to me than keeping it in a partial, being that it won't be used elsewhere and will help keep "partial-srprawl" down.
This commit is contained in:
1 parent
f34620e905
commit
d1415795be
2 files changed
+21
-15
No files matched your search
@@ -1,14 +0,0 @@
|
|||||||
<a href="{{.Permalink}}" class="b--moon-gray ba bg-animate bg-white db flex-auto-ns hover-bg-near-white mb3 mr3 w-100 w-40-l">
|
|
||||||
<div class="flex flex-column black h-100 mb2 pa3 pa4-l">
|
|
||||||
{{ $img := (.Resources.ByType "image").GetMatch "*featured*" }}
|
|
||||||
{{ with $img }}
|
|
||||||
{{ $img := .Fill "600x300 top" }}
|
|
||||||
<img src="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYwMCIgaGVpZ2h0PSI5MDAiIHZpZXdCb3g9IjAgMCAxNjAwIDkwMCIgdmVyc2lvbj0iMS4xIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHhtbG5zOnhsaW5rPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5L3hsaW5rIj48dGl0bGU+UmVjdGFuZ2xlPC90aXRsZT48ZGVzYz5DcmVhdGVkIHdpdGggU2tldGNoLjwvZGVzYz48ZyBpZD0iUGFnZS0xIiBzdHJva2U9Im5vbmUiIHN0cm9rZS13aWR0aD0iMSIgZmlsbD0ibm9uZSIgZmlsbC1ydWxlPSJldmVub2RkIj48cmVjdCBpZD0iUmVjdGFuZ2xlIiB4PSIwIiB5PSIwIiB3aWR0aD0iMTYwMCIgaGVpZ2h0PSI5MDAiLz48L2c+PC9zdmc+" data-src="{{ .RelPermalink }}" class="grow img lazyload" />
|
|
||||||
{{end}}
|
|
||||||
<div style="margin-top:auto;">{{/* the margin aligns to the bottom */}}
|
|
||||||
<h2 class="dib f3 mt4">
|
|
||||||
{{- .Title -}}
|
|
||||||
</h2>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</a>
|
|
||||||
@@ -10,7 +10,7 @@
|
|||||||
</article>
|
</article>
|
||||||
<section class="flex-ns flex-wrap justify-between w-100 v-top">
|
<section class="flex-ns flex-wrap justify-between w-100 v-top">
|
||||||
{{ range (.Paginator 20).Pages }}
|
{{ range (.Paginator 20).Pages }}
|
||||||
{{ partial "boxes-showcase-items.html" . }}
|
{{template "showcase_items" .}}
|
||||||
{{ end }}
|
{{ end }}
|
||||||
</section>
|
</section>
|
||||||
<div class="nested-list-reset nested-links">
|
<div class="nested-list-reset nested-links">
|
||||||
@@ -19,3 +19,23 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
{{ end }}
|
{{ end }}
|
||||||
|
|
||||||
|
|
||||||
|
{{define "showcase_items"}}
|
||||||
|
<a href="{{.Permalink}}" class="b--moon-gray ba bg-animate bg-white db flex-auto-ns hover-bg-near-white mb3 mr3 w-100 w-40-l">
|
||||||
|
<div class="flex flex-column black h-100 mb2 pa3 pa4-l">
|
||||||
|
{{ $img := (.Resources.ByType "image").GetMatch "*featured*" }}
|
||||||
|
{{ with $img }}
|
||||||
|
{{ $img := .Fill "600x300 top" }}
|
||||||
|
<img src="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYwMCIgaGVpZ2h0PSI5MDAiIHZpZXdCb3g9IjAgMCAxNjAwIDkwMCIgdmVyc2lvbj0iMS4xIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHhtbG5zOnhsaW5rPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5L3hsaW5rIj48dGl0bGU+UmVjdGFuZ2xlPC90aXRsZT48ZGVzYz5DcmVhdGVkIHdpdGggU2tldGNoLjwvZGVzYz48ZyBpZD0iUGFnZS0xIiBzdHJva2U9Im5vbmUiIHN0cm9rZS13aWR0aD0iMSIgZmlsbD0ibm9uZSIgZmlsbC1ydWxlPSJldmVub2RkIj48cmVjdCBpZD0iUmVjdGFuZ2xlIiB4PSIwIiB5PSIwIiB3aWR0aD0iMTYwMCIgaGVpZ2h0PSI5MDAiLz48L2c+PC9zdmc+" data-src="{{ .RelPermalink }}" class="grow img lazyload" />
|
||||||
|
{{end}}
|
||||||
|
<div style="margin-top:auto;">{{/* the margin aligns to the bottom */}}
|
||||||
|
<h2 class="dib f3 mt4">
|
||||||
|
{{- .Title -}}
|
||||||
|
</h2>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</a>
|
||||||
|
|
||||||
|
|
||||||
|
{{end}}
|
||||||
Reference in new issue
Block a user