136 lines
4.9 KiB
HTML
136 lines
4.9 KiB
HTML
{{ $url := .Site.BaseURL }}
|
|
|
|
<nav class="sidebar col-xs-6 col-sm-4 col-md-3 sidebar-offcanvas">
|
|
<div class="sidebar-content sidebar-scrolling">
|
|
<h1 class="sidebar-heading"><a href="{{ .Site.BaseURL }}">{{ .Site.Title }}</a></h1>
|
|
|
|
{{ $thumb := "" }}
|
|
{{ if .Params.image }}
|
|
{{ $thumb = .Params.image }}
|
|
{{ else }}
|
|
{{ if .Params.howlongtobeat_id }}
|
|
{{ $thumb = printf "%s%d%s" "img/hltb/" .Params.howlongtobeat_id ".jpg" }}
|
|
{{ end }}
|
|
{{ end }}
|
|
{{ if ne $thumb "" }}
|
|
<div class="sidebar-game-info">
|
|
<p style="position: relative;">
|
|
<img src="{{ $url }}{{ $thumb }}" alt="game cover image" alt="game cover" class="img-responsive img-inactive" style="border: 1px solid black"/>
|
|
|
|
{{ if ne .CurrentSection.Params.platform .Params.platform }}
|
|
{{ $platform := .CurrentSection.Title }}
|
|
{{ with .CurrentSection.Params.platform }}
|
|
<img src="{{ $url }}img/{{ lower . }}.jpg" alt="{{ $platform }}" alt="platform" class="sidebar-game-platform img-responsive"/>
|
|
Played on: <a href="/games/{{ lower . }}">{{ $platform }}</a><br/>
|
|
{{ end }}
|
|
{{ end }}
|
|
|
|
{{ with .Params.game_genre }}
|
|
{{ $tag := replaceRE `\s` "-" . }}
|
|
Genre: <a href="/tags/{{ $tag | lower }}">{{ . }}</a><br/>
|
|
{{ end }}
|
|
{{ with .Params.game_release_year }}
|
|
Release year: {{ . }}<br/>
|
|
{{ end }}
|
|
{{ with .Params.game_developer }}
|
|
Developer: <a href="https://en.wikipedia.org/wiki/{{ . }}" target="_blank" rel="noopener" class="external">{{ . }}</a><br/>
|
|
{{ end }}
|
|
{{ with .Params.howlongtobeat_id }}
|
|
<a href="https://howlongtobeat.com/game?id={{ . }}" target="_blank" rel="noopener" class="external">How long to beat</a>
|
|
{{ end }}
|
|
{{ with .Params.howlongtobeat_hrs }}
|
|
: <code>{{ . }}</code> hr{{ if gt . 1}}s{{ end }}<br/>
|
|
{{ end }}
|
|
{{ $name := .Params.game_name }}
|
|
{{ with .Params.cost }}
|
|
<a href="https://www.pricecharting.com/search-products?q={{ $name }}&type=prices">Game Value</a>: <code>€{{ . }}</code><br/>
|
|
{{ end }}
|
|
</p>
|
|
</div>
|
|
{{ end }}
|
|
|
|
|
|
{{ $currRellink := substr .RelPermalink 0 -1 }}
|
|
{{ $currContent := .Content }}
|
|
{{ $backlinks := slice }}
|
|
{{ $forwardlinks := slice }}
|
|
{{ range (where (where .Site.Pages.ByDate.Reverse ".Section" "in" (slice "articles" "games")) ".Params.ignore" "!=" "true") }}
|
|
{{ $found := findRE $currRellink .Content 1 }}
|
|
{{ if $found }}
|
|
{{ $backlinks = $backlinks | append . }}
|
|
{{ else }}
|
|
{{ $rellink := substr .RelPermalink 0 -1 }}
|
|
{{ $found = findRE $rellink $currContent 1 }}
|
|
{{ if $found }}
|
|
{{ $forwardlinks = $forwardlinks | append . }}
|
|
{{ end }}
|
|
{{ end }}
|
|
{{ end }}
|
|
|
|
{{ $related := append $backlinks $forwardlinks }}
|
|
{{ if $related }}
|
|
<div class="sidebar-header">
|
|
<span>Related Posts</span>
|
|
<img src="/img/gob_purse.gif" alt="related articles" />
|
|
</div>
|
|
|
|
<ul class="sidebar-menu">
|
|
{{ range first 5 $related }}
|
|
<li>
|
|
<a href="{{ .RelPermalink }}">{{ .Title }}</a><br/>
|
|
<span class="sidebar-date">
|
|
{{ if isset .Params "Description" }}
|
|
{{ .Description }}
|
|
{{ else }}
|
|
{{ .Summary }}
|
|
{{ end }}
|
|
</span>
|
|
</li>
|
|
{{ end }}
|
|
</ul>
|
|
<hr/>
|
|
{{ end }}
|
|
|
|
<div class="sidebar-header">
|
|
<span>Recent Codex Entries</span>
|
|
<img src="/img/gob_letter.gif" alt="latest articles" />
|
|
</div>
|
|
<ul class="sidebar-menu">
|
|
{{ range first 5 (where (where .Site.Pages.ByDate.Reverse ".Section" "in" (slice "articles" "games")) ".Params.ignore" "!=" "true") }}
|
|
<li>
|
|
<a href="{{ .RelPermalink }}">{{ .Title }}</a><br/>
|
|
<span class="sidebar-date">
|
|
{{ if .Description }}
|
|
{{ .Description }}
|
|
{{ else if .Summary }}
|
|
{{ .Summary }}
|
|
{{ else }}
|
|
A {{ .Params.game_genre }} game by {{ .Params.game_developer }} in {{ .Params.game_release_year }} that takes about {{ .Params.howlongtobeat_hrs }} hour(s) to beat.
|
|
{{ end }}
|
|
</span>
|
|
</li>
|
|
{{ end }}
|
|
</ul>
|
|
|
|
<div class="sidebar-header">
|
|
<span>Looking For More?</span>
|
|
<img src="/img/gob_waypoint.gif" alt="More information" />
|
|
</div>
|
|
<ul class="sidebar-menu">
|
|
{{ range .Site.Params.navlinks }}
|
|
<li><a href="{{ $url }}{{ .url }}">{{ .name }}</a></li>
|
|
{{ end }}
|
|
</ul>
|
|
|
|
|
|
<div class="copyright">
|
|
<p class="credit">
|
|
{{ with .Site.Params.copyright }}
|
|
{{ . | safeHTML }}
|
|
{{ end }}
|
|
</p>
|
|
</div>
|
|
</div>
|
|
</nav>
|
|
|