Skip to content

Instantly share code, notes, and snippets.

@moa3
Created June 23, 2017 07:47
Show Gist options
  • Save moa3/369f524f95519871d4251f21ffc4bed1 to your computer and use it in GitHub Desktop.
Save moa3/369f524f95519871d4251f21ffc4bed1 to your computer and use it in GitHub Desktop.
content list layout to put in layouts/_default/list.ace
/ Using ace templating engine but should be easily transferable to go templating
= content list
.col-xs-12.col-sm-8.col-md-9.content-column.white-background
{{ partial "mobileNavToggle.html" . }}
.list.row
.col-lg-12
/ this is where the magic happens. In my case,
/ the only listing page is the workshops one so this condition is hardcoded
{{ range (where .Data.Pages.ByDate "Section" "workshops") }}
col-xs-12.col-sm-6.col-md-4.col-lg-3.masonry-item
.box-masonry
{{ if and (isset .Params "image") .Params.image }}
a.box-masonry-image.with-hover-overlay.with-hover-icon href={{ .Permalink }}
img.img-responsive src={{ .Params.image }}
.box-masonry-text
{{ if .Title }}
h4
a href={{ .Permalink }}
{{ .Title }}
{{ end }}
{{ end }}
{{ end }}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment