Skip to content
Snippets Groups Projects
Commit 25a1399f authored by alexisben's avatar alexisben
Browse files

add config for pages layout

parent d41541df
No related branches found
No related tags found
No related merge requests found
......@@ -55,6 +55,7 @@ params:
default_image: false
index:
truncate_description: 200 # Set to 0 to disable truncate
layout: grid # grid | list
papers:
default_image: false
sidebar:
......
......@@ -7,7 +7,15 @@
)}}
<ul class="list {{ if and (not $show_descriptions) (not $show_images) }} title-only {{ end }}">
{{ range .pages }}
{{ $page := site.GetPage .file }}
{{- $file := false -}}
{{/* Check if . is a map or page url, necessary when pages/grid is called outside block context */}}
{{ if reflect.IsMap . }}
{{ $file = .file }}
{{ else }}
{{ $file = . }}
{{ end }}
{{ $page := site.GetPage $file }}
{{ with $page }}
<li>
{{ if or $show_descriptions $show_images }}
......
......@@ -2,13 +2,14 @@
{{ if .Params.bodyclass }}
{{- $page_class = printf "block-page-%s" .Params.bodyclass }}
{{ end }}
{{ $show_images := eq site.Params.pages.index.layout "grid" }}
<div class="block block-pages block-pages--grid {{ $page_class }}">
<div class="block block-pages block-pages--children block-pages--{{ site.Params.pages.index.layout }} {{ $page_class }}">
<div class="container">
<div class="block-content">
{{- partial "blocks/templates/pages/grid.html" (dict
{{- partial (printf "blocks/templates/pages/%s.html" site.Params.pages.index.layout) (dict
"pages" .Params.children
"show_images" true
"show_images" $show_images
"heading_level" 2
"show_descriptions" true
) }}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment