Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion content/author/ronald-visser/_index.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
name: Ronald M. Visser
mastodon: https://akademienl.social/@RonaldVisser
bio: Interdisicplinary scientist combining archaeology, dendrochronology and data science
bio: Interdisciplinary scientist combining archaeology, dendrochronology and data science
github: RonaldVisser
gitlab: RonaldVisser
orcid: 0000-0001-6966-1729
Expand Down
3 changes: 1 addition & 2 deletions content/blog/2024-06-06-from-scripts-to-package/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@
slug: "from-scripts-to-package"
title: From scripts to package. Developing dendroNetwork and learning with rOpenSci
package_version: 0.5.4
author:
- Ronald Visser
author: Ronald M. Visser
editor:
- Steffi LaZerte
date: 2024-06-06
Expand Down
21 changes: 15 additions & 6 deletions themes/ropensci/layouts/blog/list.json.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,17 +21,26 @@
{{ $data.Set "authors" .Params.author }}
{{ else }}
{{ $data.Set "authors" (slice .Params.author) }}
{{ end }}
{{ if isset .Params "editor" }}
{{ if eq (substr (jsonify .Params.editor) 0 1) "[" }}
{{ $data.Set "editors" .Params.editor }}
{{ else }}
{{ $data.Set "editors" (slice .Params.editor) }}
{{ end }}
{{ end }}
{{ if isset .Params "translator" }}
{{ if eq (substr (jsonify .Params.translator) 0 1) "[" }}
{{ $data.Set "translators" .Params.translator }}
{{ else }}
{{ $data.Set "translators" (slice .Params.translator) }}
{{ end }}
{{ end }}
{
"id": "{{ printf "https://doi.org/%s" .Params.doi }}",
"title": "{{ .Title }}",
"language" : "{{ .Lang }}",
"authors": [{{ range $i, $e := ($data.Get "authors") }}{{ range first 1 (where ($data.Get "pages") ".Params.name" $e) }}{{ $params := .Params }}{{ $name := $params.name }}{{ if $i }}, {{ end }}{{ range first 1 (where ($data.Get "pages") ".Params.name" $e) }}
{
"name": "{{ $name }}",
{{ with .Params.orcid }}"url": "https://orcid.org/{{ . }}" ,{{ end }}
"avatar": "{{ ( partial "blogs/author-img" . ) }}"
}{{ end }}{{ end }}{{ end }}],
"authors": [{{ partial "blogs/combined-authors.html" . }}],
{{ with .Params.tags }} "tags": {{ . | uniq | jsonify}},{{ end }}
"content_html": {{ .Content | replaceRE "\n" "" | jsonify }},
"url": "{{ .Permalink }}",
Expand Down
66 changes: 66 additions & 0 deletions themes/ropensci/layouts/partials/blogs/combined-authors.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
{{- $editors := .Params.editor -}}
{{- if $editors -}}
{{- if ne (printf "%T" $editors) "[]string" -}}
{{- $editors = slice $editors -}}
{{- end -}}
{{- end -}}

{{- $translators := .Params.translator -}}
{{- if $translators -}}
{{- if ne (printf "%T" $translators) "[]string" -}}
{{- $translators = slice $translators -}}
{{- end -}}
{{- end -}}

{{- $authors := .Params.author -}}
{{- if $authors -}}
{{- if ne (printf "%T" $authors) "[]string" -}}
{{- $authors = slice $authors -}}
{{- end -}}
{{- end -}}

{{- $interviewees := .Params.interviewee -}}
{{- if $interviewees -}}
{{- if ne (printf "%T" $interviewees) "[]string" -}}
{{- $interviewees = slice $interviewees -}}
{{- end -}}
{{- end -}}

{{- $allPeople := dict -}}

{{- range $editors -}}
{{/* Look up current person in dictionary, return empty slice if not found */}}
{{- $existing := index $allPeople . | default slice -}}
{{/* Add "editor" to their roles and update the dictionary */}}
{{- $allPeople = merge $allPeople (dict . ($existing | append "editor")) -}}
{{- end -}}

{{- range $translators -}}
{{- $existing := index $allPeople . | default slice -}}
{{- $allPeople = merge $allPeople (dict . ($existing | append "translator")) -}}
{{- end -}}

{{- range $authors -}}
{{- $existing := index $allPeople . | default slice -}}
{{- $allPeople = merge $allPeople (dict . ($existing | append "author")) -}}
{{- end -}}

{{- range $interviewees -}}
{{- $existing := index $allPeople . | default slice -}}
{{- $allPeople = merge $allPeople (dict . ($existing | append "interviewee")) -}}
{{- end -}}

{{- $personIndex := 0 -}}
{{- range $name, $roles := $allPeople -}}
{{- $personPage := index (where $.Site.Pages ".Params.name" $name) 0 -}}
{{- if $personPage -}}
{{- if $personIndex -}}, {{ end -}}
{
"name": "{{ $name }}",
"url": "{{ if $personPage.Params.orcid }}https://orcid.org/{{ $personPage.Params.orcid }}{{ else }}{{ $personPage.Permalink }}{{ end }}",
"avatar": "{{ ( partial "blogs/author-img" $personPage ) }}",
"_role": {{ $roles | jsonify }}
}
{{- $personIndex = add $personIndex 1 -}}
{{- end -}}
{{- end -}}