I’m trying to create a list of references from a preformatted YAML-file with a list of publications. I don’t want to alter the YAML-data itself, since it is what an automatic Zotero export creates.
Here’s a shortened version of the data (/data/publications.yaml
), cut down to one example:
---
references:
- id: White2024
abstract: >-
This chapter traces the history of tabletop role-playing games (TRPGs). It
treats Dungeons & Dragons (D&D) as a key textual expression of TRPG
experience with which other designs and play communities are in dialogue but
which itself changes over time and discusses the tension between D&D as
commercial intellectual property on one hand and as a folk cultural play
practice intertwined with popular media fandom on another. We examine the
design responses to D&D and the articulation of tabletop RPG practices by
players, and discuss the impact of new technologies on TRPG publishing,
distribution, and engagement since the turn of the century. In doing so, we
present TRPGs as an active cultural form, rather than merely an obsolescent
predecessor form of digital games.
author:
- family: White
given: William J.
- family: Arjoranta
given: Jonne
- family: Hitchens
given: Michael
- family: Peterson
given: Jon
- family: Torner
given: Evan
- family: Walton
given: Jonathan
citation-key: White2024
container-title: The Routledge Handbook of Role-Playing Game Studies
editor:
- family: Zagal
given: José P.
- family: Deterding
given: Sebastian
event-place: New York
ISBN: 978-1-00-329804-5
issued:
- year: 2024
number-of-pages: '24'
page: 68-91
publisher: Routledge
publisher-place: New York
title: Tabletop Role-Playing Games
type: chapter
URL: https://doi.org/10.4324/9781003298045-6
...
I tried creating a shortcode that I could include in a page to get a list of publications based on this data.
{{ $publications := sort .Site.Data.publications.references "citation-key" "desc" }}
<ul>
{{ range $publications }}
<li>{{ .author }}. {{ .issued }}. <a href="/repository/{{ .id }}.pdf">{{ .title }}</a>. {{ .publisher }}. </li>
{{ end }}
<ul>
This correctly parses the data into:
[map[family:White given:William J.] map[family:Arjoranta given:Jonne] map[family:Hitchens given:Michael] map[family:Peterson given:Jon] map[family:Torner given:Evan] map[family:Walton given:Jonathan]]. [map[year:2024]]. [Tabletop Role-Playing Games](http://localhost:1313/repository/White2024.pdf). Routledge.
I’m struggling with getting the maps parsed correctly into strings. I tried ranging over them in different ways, but can’t seem to find a way that would work. Can anyone help me figure out what I’m doing wrong?