feat: Hugo engine for iGaming affiliate template (layouts, assets, i18n, verified data, CI build script)
This commit is contained in:
@@ -0,0 +1,30 @@
|
||||
{{- /* related-pages.html — renders the current page's relatedPages front-matter
|
||||
(a list of slugs) as cards. Matches by .Slug or file base name. */ -}}
|
||||
{{- $current := . -}}
|
||||
{{- $related := .Params.relatedPages -}}
|
||||
{{- if $related -}}
|
||||
{{- $found := slice -}}
|
||||
{{- range $slug := $related -}}
|
||||
{{- range $p := $current.Site.Pages -}}
|
||||
{{- if and (ne $p $current) (not $p.IsHome) -}}
|
||||
{{- if or (eq $p.Slug $slug) (and $p.File (eq $p.File.ContentBaseName $slug)) -}}
|
||||
{{- $found = $found | append $p -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
{{- with $found -}}
|
||||
<section class="site-container section" aria-labelledby="related-heading">
|
||||
<h2 id="related-heading" class="text-xl font-bold">Related pages</h2>
|
||||
<div class="mt-4 grid gap-4 sm:grid-cols-2 lg:grid-cols-3">
|
||||
{{- range . -}}
|
||||
<a href="{{ .RelPermalink }}" class="card card-hover block no-underline">
|
||||
<span class="badge-primary">{{ .LinkTitle }}</span>
|
||||
<p class="mt-2 text-sm text-secondary/70">{{ .Params.description | default (.Summary | plainify) | truncate 110 }}</p>
|
||||
<span class="mt-3 inline-block text-sm font-semibold text-primary">Read more →</span>
|
||||
</a>
|
||||
{{- end -}}
|
||||
</div>
|
||||
</section>
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
Reference in New Issue
Block a user