jefklakscodex/themes/jefklak-creative-portfolio/layouts/partials/sidebar.html

129 lines
4.8 KiB
HTML
Raw Normal View History

2022-11-18 13:42:22 +01:00
<nav class="sidebar">
<div class="sidebar-content sidebar-scrolling">
2022-11-18 13:42:22 +01:00
<a name="menu" id="menu"></a>
<h1 class="sidebar-heading"><a href="{{ .Site.BaseURL }}" title="{{ .Site.Title }} Home">{{ .Site.Title }}</a></h1>
2018-05-14 07:41:47 +02:00
2022-11-18 13:42:22 +01:00
{{- $thumb := "" -}}
{{- if .Params.image -}}
{{- $thumb = .Params.image -}}
{{- else -}}
{{- if .Params.howlongtobeat_id -}}
{{- $thumb = (printf "%scover.jpg" .Page.Permalink) -}}
{{- end -}}
{{- end -}}
{{- if ne $thumb "" -}}
2018-05-14 07:41:47 +02:00
<div class="sidebar-game-info">
<p style="position: relative;">
<img src="{{ $thumb | absURL }}" alt="game cover image" alt="game cover" class="img-responsive img-inactive" style="border: 1px solid black"/>
2022-11-18 13:42:22 +01:00
{{- if ne .CurrentSection.Params.platform .Params.platform -}}
{{- $platform := .CurrentSection.Title -}}
{{- with .CurrentSection.Params.platform -}}
<img src="/img/{{ lower . }}.jpg" alt="{{ $platform }}" alt="platform" class="sidebar-game-platform img-responsive"/>
2022-11-20 09:22:19 +01:00
&nbsp;Played on: <a class="p-category" href="/games/{{ lower . }}">{{ $platform }}</a><br/>
2022-11-18 13:42:22 +01:00
{{- end -}}
{{- end -}}
2022-11-18 13:42:22 +01:00
{{- with .Params.game_genre -}}
{{- $tag := replaceRE `\s` "-" . -}}
&nbsp;Genre: <a href="/tags/{{ $tag | lower }}">{{ . }}</a><br/>
2022-11-18 13:42:22 +01:00
{{- end -}}
{{- with .Params.game_release_year -}}
&nbsp;Release year: {{ . }}<br/>
2022-11-18 13:42:22 +01:00
{{- end -}}
{{- with .Params.game_developer -}}
2022-09-10 21:28:46 +02:00
&nbsp;Developer: <a href="https://www.mobygames.com/search/quick?sFilter=1&offset=0&q={{ . }}&p=-1&sC=on" target="_blank" rel="noopener" class="external">{{ . }}</a><br/>
2022-11-18 13:42:22 +01:00
{{- end -}}
{{- with .Params.howlongtobeat_id -}}
&nbsp;<a href="https://howlongtobeat.com/game?id={{ . }}" target="_blank" rel="noopener" class="external">How long to beat</a>
2022-11-18 13:42:22 +01:00
{{- end -}}
{{- with .Params.howlongtobeat_hrs -}}
: <code>{{ . }}</code> hr{{ if gt . 1}}s{{ end }}<br/>
2022-11-18 13:42:22 +01:00
{{- end -}}
2018-05-14 07:41:47 +02:00
</p>
</div>
2022-11-18 13:42:22 +01:00
{{- end -}}
2022-11-18 13:42:22 +01:00
{{- $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 -}}
2022-11-18 13:42:22 +01:00
{{- $related := append $backlinks $forwardlinks -}}
{{- if and .Params.Date $related -}}
2018-05-14 07:41:47 +02:00
<div class="sidebar-header">
<span>Related Posts</span>
2020-06-05 14:10:22 +02:00
<img src="/img/gob_purse.gif" alt="related articles" />
2018-05-14 07:41:47 +02:00
</div>
<ul class="sidebar-menu">
2022-11-18 13:42:22 +01:00
{{- range first 5 $related | uniq -}}
2018-05-14 07:41:47 +02:00
<li>
2021-03-25 17:49:44 +01:00
<a href="{{ .RelPermalink }}">{{ .Title }}</a><br/>
2022-11-18 13:42:22 +01:00
<span class="sidebar-description">
{{- if isset .Params "Description" -}}
2020-06-09 14:50:49 +02:00
{{ .Description }}
2022-11-18 13:42:22 +01:00
{{- else -}}
2020-06-09 14:50:49 +02:00
{{ .Summary }}
2022-11-18 13:42:22 +01:00
{{- end -}}
2020-06-09 14:50:49 +02:00
</span>
2018-05-14 07:41:47 +02:00
</li>
2022-11-18 13:42:22 +01:00
{{- end -}}
2018-05-14 07:41:47 +02:00
</ul>
<hr/>
2022-11-18 13:42:22 +01:00
{{- end -}}
2018-05-14 07:41:47 +02:00
<div class="sidebar-header">
<span>Recent Codex Entries</span>
2020-06-05 14:10:22 +02:00
<img src="/img/gob_letter.gif" alt="latest articles" />
</div>
<ul class="sidebar-menu">
2022-11-18 13:42:22 +01:00
{{- range first 5 (where (where .Site.Pages.ByDate.Reverse ".Section" "in" (slice "articles" "games")) ".Params.ignore" "!=" "true") -}}
<li>
2021-03-25 17:49:44 +01:00
<a href="{{ .RelPermalink }}">{{ .Title }}</a><br/>
2022-11-18 13:42:22 +01:00
<span class="sidebar-description">
{{- if .Description -}}
2020-06-09 14:50:49 +02:00
{{ .Description }}
2022-11-18 13:42:22 +01:00
{{- else if .Summary -}}
2020-06-09 14:50:49 +02:00
{{ .Summary }}
2022-11-18 13:42:22 +01:00
{{- 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.
2022-11-18 13:42:22 +01:00
{{- end -}}
</span>
</li>
2022-11-18 13:42:22 +01:00
{{- end -}}
</ul>
2018-05-14 07:41:47 +02:00
<div class="sidebar-header">
2020-06-09 14:50:49 +02:00
<span>Looking For More?</span>
2020-06-05 14:10:22 +02:00
<img src="/img/gob_waypoint.gif" alt="More information" />
</div>
<ul class="sidebar-menu">
2022-11-18 13:42:22 +01:00
{{- range .Site.Params.navlinks -}}
<li><a href="{{ .url }}">{{ .name }}</a></li>
2022-11-18 13:42:22 +01:00
{{- end -}}
</ul>
2018-05-14 07:41:47 +02:00
<div class="copyright">
<p class="credit">
2022-11-18 13:42:22 +01:00
{{- with .Site.Params.copyright -}}
2018-05-14 07:41:47 +02:00
{{ . | safeHTML }}
2022-11-18 13:42:22 +01:00
{{- end -}}
2018-05-14 07:41:47 +02:00
</p>
</div>
</div>
2020-06-05 14:10:22 +02:00
</nav>
2018-05-14 07:41:47 +02:00