From 02301428b73d3907b8d19c361643729ae4f76eee Mon Sep 17 00:00:00 2001
From: wgroeneveld
+ {{ .Params.series }} series ▹ + {{- range $series -}} + {{ .Params.game_name }} ○ + {{- end -}} +
+ {{ end }} + {{ end }} + + {{- $currRellink := substr .RelPermalink 0 -1 -}} + {{- $currContent := .Content -}} + {{- $currTitle := .Title -}} + {{- $backlinks := slice -}} + {{- $forwardlinks := slice -}} + {{- range (where (where .Site.Pages ".Section" "in" (slice "articles" "games")) ".Params.ignore" "!=" "true") -}} + {{- $found := findRE $currRellink .Content 1 -}} + {{- if and $found (ne .Title $currTitle) -}} + {{- $backlinks = $backlinks | append . -}} + {{- else -}} + {{- $rellink := substr .RelPermalink 0 -1 -}} + {{- $found = findRE $rellink $currContent 1 -}} + {{- if and $found (ne .Title $currTitle) -}} + {{- $forwardlinks = $forwardlinks | append . -}} + {{- end -}} + {{- end -}} + {{- end -}} + {{- $rel := append $backlinks $forwardlinks -}} + {{ $related := (where ($rel | complement $series) ".Params.game_name" "ne" nil) }} + {{ $has_related := $related | len }} + {{ if gt $has_related 0 }} + {{- $related = sort $related ".Params.game_release_year" "asc" }} ++ Related games ▹ + {{- range $related | uniq -}} + {{ .Params.game_name }} ○ + {{- end -}} +
+ {{ end }} +By {{ .Site.Author.name }} on .
{{ if .Params.game_name }}
- {{ $platform := .CurrentSection.Title }}
+ {{- $platform := .CurrentSection.Title -}}
{{ with .CurrentSection.Params.platform }}
Played on: {{ $platform }}
- {{ end }}
+ {{- end -}}
{{ with .Params.game_genre }}
{{ $tag := replaceRE `\s` "-" . }}
Genre: {{ . }}
- {{ end }}
+ {{- end -}}
{{ with .Params.game_release_year }}
Release year: {{ . }}
- {{ end }}
+ {{- end -}}
{{ with .Params.game_developer }}
Developer: {{ . }}
- {{ end }}
+ {{- end -}}
{{ with .Params.howlongtobeat_hrs }}
How long to beat: {{ . }}
hr{{ if gt . 1}}s{{ end }}
- {{ end }}
+ {{- end -}}
- {{ $thumb := "" }}
- {{ if .Params.image }}
- {{ $thumb = .Params.image }}
- {{ else }}
- {{ if .Params.howlongtobeat_id }}
- {{ $thumb = (printf "%scover.jpg" .Page.Permalink) }}
- {{ end }}
- {{ end }}
+ {{- $thumb := "" -}}
+ {{- if .Params.image -}}
+ {{- $thumb = .Params.image -}}
+ {{- else -}}
+ {{- if .Params.howlongtobeat_id -}}
+ {{- $thumb = (printf "%scover.jpg" .Page.Permalink) -}}
+ {{- end -}}
+ {{- end -}}
{{ if ne $thumb "" }}
{{ end }}