Skip to content

Commit

Permalink
mapping nums for pub_type
Browse files Browse the repository at this point in the history
  • Loading branch information
Chris-Larkin committed Dec 19, 2024
1 parent 3d9810f commit 5367fc8
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion layouts/publication/single.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@
{{ $pub_type_param := .Params.publication_types | default (slice 0) }}

{{/* Convert string in form `"0"` to int (`0`) */}}
{{ $pub_type := (index $pub_type_param 0) | default 0 }}
{{ $pub_type_map := dict "article-journal" 1 "book" 2 "thesis" 3 }}
{{ $pub_type := index $pub_type_map (index $pub_type_param 0) }}

{{/* Validate Pub Type if defined */}}
{{ if gt $pub_type (sub (len $pub_types) 1) }}
Expand Down

0 comments on commit 5367fc8

Please sign in to comment.