mirror of
https://gitlab.com/ansol/web-ansol.org.git
synced 2024-11-28 08:47:42 +00:00
93 lines
2.9 KiB
HTML
93 lines
2.9 KiB
HTML
{{ $page := . }}
|
|
{{ $featured := (.Resources.ByType "image").GetMatch "*cover*" }}
|
|
{{ $anchor := $page.Params.image.focal_point | default "Smart" }}
|
|
|
|
{{/* Set default titles for node pages */}}
|
|
{{ $title := .Title }}
|
|
{{ if and (not $title) .IsNode }}
|
|
{{ if eq .Type "post" }}
|
|
{{ $title = i18n "posts" }}
|
|
{{ else if eq .Type "talk" }}
|
|
{{ $title = i18n "talks" }}
|
|
{{ else if eq .Type "publication" }}
|
|
{{ $title = i18n "publications" }}
|
|
{{end}}
|
|
{{end}}
|
|
|
|
{{/* Header image */}}
|
|
{{ if and .Params.header.image (not (and $featured (not .Params.image.preview_only))) }}
|
|
<div class="article-header">
|
|
{{ $img_src := urls.Parse .Params.header.image }}
|
|
{{ if $img_src.Scheme }}
|
|
<img src="{{ .Params.header.image }}" class="article-banner" alt="">
|
|
{{ else }}
|
|
<img src="{{ (printf "/img/%s" .Params.header.image) | relURL }}" class="article-banner" alt="">
|
|
{{ end }}
|
|
|
|
{{ with .Params.header.caption }}<span class="article-header-caption">{{ . | markdownify | emojify }}</span>{{ end }}
|
|
</div>
|
|
{{end}}
|
|
|
|
{{/* Featured image layout */}}
|
|
{{ if and $featured (not .Params.image.preview_only) }}
|
|
|
|
{{/* Fit image within max size. */}}
|
|
{{ $image := $featured }}
|
|
|
|
{{/* Determine image placement. */}}
|
|
{{ $placement := .Params.image.placement | default 1 }}{{/* Default to full column width. */}}
|
|
{{ $image_container := "" }}
|
|
{{ if eq $placement 2}}
|
|
{{ $image_container = "container" }}
|
|
{{ if gt $featured.Width 1200 }}
|
|
{{ $image = $featured.Resize "1200x" }}
|
|
{{ end }}
|
|
{{else if eq $placement 3}}
|
|
{{ $image_container = "container-fluid" }}
|
|
{{ $image := $featured.Fit "2560x2560" }}
|
|
{{else}}
|
|
{{ $image_container = "article-container" }}
|
|
{{ if gt $featured.Width 720 }}
|
|
{{ end }}
|
|
{{end}}
|
|
|
|
<div class="article-container pt-3">
|
|
<h1>{{ $title }}</h1>
|
|
|
|
{{ with $page.Params.subtitle }}
|
|
<p class="page-subtitle">{{ . | markdownify | emojify }}</p>
|
|
{{end}}
|
|
|
|
{{ partial "page_metadata" (dict "page" $page "is_list" 0 "share" true) }}
|
|
{{ partial "page_links_div.html" $page }}
|
|
</div>
|
|
|
|
{{/* Featured image */}}
|
|
<div class="article-header {{$image_container}} featured-image-wrapper mt-4 mb-4">
|
|
<div style="position: relative">
|
|
<img src="{{ $image.RelPermalink }}" alt="{{ with $.Params.image.alt_text }}{{.}}{{ end }}" class="featured-image">
|
|
{{ with $.Params.image.caption }}<div class="featured-image-caption">{{ . | markdownify | emojify }}</div>{{ end }}
|
|
</div>
|
|
</div>
|
|
{{else}}
|
|
{{/* Case when page has no image */}}
|
|
|
|
{{/* Wider container for nodes */}}
|
|
{{ $ctnr := "article-container" }}
|
|
{{ if $page.IsNode }}
|
|
{{ $ctnr = "universal-wrapper body-width" }}
|
|
{{end}}
|
|
<div class="{{$ctnr}} pt-3">
|
|
<h1>{{ $title }}</h1>
|
|
|
|
{{ with $page.Params.subtitle }}
|
|
<p class="page-subtitle">{{ . | markdownify | emojify }}</p>
|
|
{{end}}
|
|
|
|
{{ if not .IsNode }}
|
|
{{ partial "page_metadata" (dict "page" $page "is_list" 0 "share" true) }}
|
|
{{ partial "page_links_div.html" $page }}
|
|
{{end}}
|
|
</div>
|
|
{{end}}
|