AMPERION_Webpage/layouts/_default/single.html

70 lines
2.6 KiB
HTML
Raw Normal View History

2025-06-06 18:12:46 +02:00
{{ define "main" }}
2025-09-08 01:15:11 +02:00
{{ partial "breadcrumbs.html" . }}
2025-06-06 18:12:46 +02:00
{{ partial "page-title.html" . }}
2025-09-08 01:15:11 +02:00
2025-06-06 18:12:46 +02:00
<!-- checking blog -->
{{ if or (eq .Section "post") (eq .Section "posts") (eq .Section "blog") (eq .Section "blogs") (eq .Section "news") (eq .Section "categories") (eq .Section "tags") }}
<section class="page-wrapper">
<div class="container">
<div class="row">
<div class="col-md-8">
<div class="post post-single">
<h2 class="post-title">{{ .Title }}</h2>
<div class="post-meta">
<ul>
<li><i class="ion-calendar"></i> {{ time.Format ":date_long" .PublishDate }}</li>
<li><i class="ion-android-people"></i>
{{ i18n "posted_by" }}
{{ $authors := slice }}{{ if reflect.IsSlice .Params.author }}{{ $authors = .Params.author }}{{ else }}{{ $authors = (slice .Params.author) }}{{ end -}}
{{ range $index, $elements := $authors }}{{ if ne $index 0 }}, {{ end }}<a class="text-primary" href="{{ `author/` | relLangURL }}{{ . | urlize }}">{{ . }}</a>{{ end }}
</li>
<li><i class="ion-pricetags"></i>
{{ range $index, $elements:= .Params.tags }}{{ if ne $index 0 }}, {{ end }}<a href="{{ `tags/` | relLangURL }}{{ . | urlize }}">{{ . }}</a>{{ end }}
</li>
</ul>
</div>
<div class="post-thumb">
{{ with .Params.image -}}
2025-09-08 01:15:11 +02:00
{{ $img := . }}
{{ $static := printf "static/%s" (strings.TrimLeft "/" $img) }}
{{ $w := 0 }}{{ $h := 0 }}
{{ if fileExists $static }}
{{ with (imageConfig $static) }}{{ $w = .Width }}{{ $h = .Height }}{{ end }}
{{ end }}
<img class="img-responsive"
src="{{ $img | relURL }}"
alt="{{ $.Title | plainify }}"
loading="lazy"
decoding="async"
{{ if gt $w 0 }}width="{{ $w }}"{{ end }}
{{ if gt $h 0 }}height="{{ $h }}"{{ end }}>
{{- end }}
2025-06-06 18:12:46 +02:00
</div>
<div class="post-content post-excerpt">
{{ .Content }}
</div>
2025-09-08 01:15:11 +02:00
{{ partial "related.html" . }}
2025-06-06 18:12:46 +02:00
{{ with site.Params.DisqusShortname -}}
<div class="post-comments">
{{ template "_internal/disqus.html" . }}
</div>
{{- end }}
</div>
</div>
<div class="col-md-4">
{{ partial "blog-sidebar.html" . }}
</div>
</div>
</div>
</section>
<!-- regular page -->
{{ else -}}
{{ .Render "default" }}
{{- end }}
<!-- /regular page -->
{{ end }}