kopia lustrzana https://github.com/lowtechmag/solar_v2
110 wiersze
3.5 KiB
HTML
110 wiersze
3.5 KiB
HTML
{{ define "main" }}
|
||
|
||
<main class='article {{ range .Params.categories }} {{ . | urlize }} {{ end }}'>
|
||
|
||
<article>
|
||
<section id="content" class="article">
|
||
<header class="entry-header">
|
||
<h1 class="entry-title">
|
||
{{ .Title }}</h1>
|
||
|
||
<p class="summary">
|
||
{{ .Summary }}
|
||
</p>
|
||
<div class="metadata">
|
||
{{/* disable metadata author for about category */}}
|
||
{{ if not (in .Params.categories "About") }}
|
||
{{if (.GetTerms "authors")}}
|
||
<div class="authors">
|
||
<span class="byline">{{i18n "written_by" | default "Written by" }}</span>
|
||
{{ range (.GetTerms "authors") }}
|
||
<span class="author"><a href="{{ .Permalink }}">{{ .Title }}</a></span>
|
||
{{ end }}
|
||
</div>
|
||
{{ end }}
|
||
{{ end }}
|
||
|
||
{{ if (.GetTerms "translators") }}
|
||
|
||
<div class="translations">
|
||
<span class="byline">{{i18n "translated_by" | default "translated by"}}</span>
|
||
{{ range (.GetTerms "translators") }}
|
||
<span class="author"><a href="{{ .Permalink }}">{{ .Title }}</a></span>
|
||
{{ end }}
|
||
</div>
|
||
{{ end }}
|
||
|
||
{{ if .IsTranslated }}
|
||
<div class="translations">
|
||
<span class="byline">{{i18n "translations" | default "Translations"}}</span>
|
||
{{ range .Translations }}
|
||
<a href="{{ .Permalink }}">{{ .Lang }}</a>
|
||
{{ end }}
|
||
</div>
|
||
{{ end }}
|
||
</div>
|
||
</header>
|
||
|
||
<div class="entry-content">
|
||
{{- $contents := split .Content `<div class="footnotes" role="doc-endnotes">` -}}
|
||
{{ index $contents 0 | safeHTML }}
|
||
</div>
|
||
{{ if not (in .Params.categories "About") }}
|
||
{{ if not (in .Params.categories "") }}
|
||
{{ partial "post-footer" }}
|
||
{{ end }}
|
||
{{ end }}
|
||
</section>
|
||
|
||
{{ $commentsfile := printf "comments.%s.md" .Lang }}
|
||
{{ with .Resources.GetMatch $commentsfile }}
|
||
<section class="comments" id="comments">
|
||
<h2 id="comments-title">{{ i18n "commentstitle" | default "Comments"}} </h2>
|
||
<p><em>{{ i18n "commentsdescription" | default "To make a comment, please send an e-mail to solar (at) lowtechmagazine (dot) com. Your e-mail address is not used for other purposes, and will be deleted after the comment is published. If you don’t want your real name to be published, sign the e-mail with the name you want to appear."}}</em></p>
|
||
<details>
|
||
<summary><span id="comment-count"></span> {{ i18n "commentstitle" | default "Reactions"}}</summary>
|
||
<div id="comments-list">
|
||
{{ .Content }}
|
||
</div>
|
||
</details>
|
||
</section>
|
||
{{ end }}
|
||
|
||
<section id="reference">
|
||
<div class="footnotes" role="doc-endnotes">
|
||
{{ index $contents 1 | safeHTML }}
|
||
</section>
|
||
|
||
|
||
{{$tags := (.GetTerms "tags")}}
|
||
{{ if $tags }}
|
||
|
||
<section id="related" class="article-list">
|
||
<h3 class="related">Related Articles</h3>
|
||
<div class="post-info gray">
|
||
<p class="tags">{{ i18n "theme" | default "Themes"}}:
|
||
{{ range $tags }}
|
||
<a href="{{ .Permalink }}" class="tag">{{ .LinkTitle }}</a>
|
||
{{ end }}
|
||
</p>
|
||
</div>
|
||
<div class="grid">
|
||
{{ $allposts := where .Site.RegularPages "Type" "in" "posts" }}
|
||
{{ $notunlisted := where site.RegularPages ".Params.unlisted" "!=" "true" }}
|
||
{{ $posts := $allposts | intersect $notunlisted }}
|
||
{{ $related := $posts.RelatedIndices . "tags" "lang" | first 4}}
|
||
{{ range $related }}
|
||
{{ if isset .Params ("categories") }}
|
||
|
||
{{ partial "article-list/default" . }}
|
||
|
||
{{ end }}
|
||
{{ end }}
|
||
</div>
|
||
</section>
|
||
{{ end }}
|
||
|
||
</article>
|
||
</main>
|
||
{{ end }}
|