Skip to content

Instantly share code, notes, and snippets.

@noah-de
Last active Feb 27, 2020
Embed
What would you like to do?
mock up of the desired output:
<h2>Faculty</h2>
image image image
name name name
<h2>Post Docs</h2>
image image image
name name name
<h2>PhD Candidates</h2>
image image image
name name name
<h2>Emeriti</h2>
image image image
name name name
**website/content/members/homer/index.md**
title: "Homer Simpson"
date: 2019-10-22T11:14:44-07:00
affiliation: ["PhD Student"]
sort_order: "6"
tags: []
draft: false
website: ["http://hsimpson.info/"]
featured_image: "homer.png"
**layout/members/list.html**
{{ define "title" }}Members{{ end }}
{{ define "content" }}
{{ range .Pages.ByParam "sort_order" }}
<div>
{{ if .Params.featured_image }}
{{ with .Resources.GetMatch (.Params.featured_image) }}
{{ $image := .Fill "200x200" }}
{{ $image := $image.Filter (images.Grayscale)}}
<img src="{{ $image.Permalink }}" alt="no image">
{{ else }}
<img src="/img/alias.png" alt='img' width=200 height=200/>
{{ end }}
{{ end }}
<div class="caption">
{{ .Title }}
{{ .Params.affiliation }}
</div>
{{/* <a href="{{ .RelPermalink }}">{{ .Title }}</a> */}}
</div><!-- end col --->
{{ end }}
{{ end }}
**Proposed ugly solution (that seems like it should work, but does not)**
{{ if eq .Params.affiliation "Faculty" }}
<h2>Faculty</h2>
{{ end }}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment