mirror of
https://github.com/tiennm99/HugoBlox-kit.git
synced 2026-10-13 08:15:44 +00:00
feat: add support for View wrappers
E.g. a custom view (views/custom.html) can be wrapped with: views/custom-start.html views/custom-end.html This allows for custom grid-based views (cards, etc.)
This commit is contained in:
1 parent
230d4a35ce
commit
848a7c6a2a
1 file changed
+9
@@ -7,11 +7,20 @@
|
||||
<div class="article-style">{{ . }}</div>
|
||||
{{ end }}
|
||||
|
||||
|
||||
{{ if templates.Exists (printf "partials/views/%s-start.html" (lower $.Params.view | default "compact")) }}
|
||||
{{ partial "functions/render_view" (dict "page" $ "item" . "view" (printf "%s-start" $.Params.view) "index" 0) }}
|
||||
{{ end }}
|
||||
|
||||
{{ $paginator := .Paginate .Pages }}
|
||||
{{ range $index, $post := $paginator.Pages }}
|
||||
{{ partial "functions/render_view" (dict "page" $ "item" . "view" ($.Params.view | default "compact") "index" $index) }}
|
||||
{{end}}
|
||||
|
||||
{{ if templates.Exists (printf "partials/views/%s-end.html" (lower $.Params.view | default "compact")) }}
|
||||
{{ partial "functions/render_view" (dict "page" $ "item" . "view" (printf "%s-end" $.Params.view) "index" 0) }}
|
||||
{{ end }}
|
||||
|
||||
{{ partial "pagination" . }}
|
||||
</div>
|
||||
|
||||
|
||||
Reference in new issue
Block a user