first commit
This commit is contained in:
@@ -0,0 +1,15 @@
|
||||
{{- /* Usage: {{< screenshot src="app/name.png" alt="…" caption="…" >}}. Images live in assets/screenshots/. Add demo="true" for screenshots taken on an upstream public demo rather than a Federated Core server. */ -}}
|
||||
{{- $src := .Get "src" -}}
|
||||
{{- with resources.Get (printf "screenshots/%s" $src) -}}
|
||||
{{- $img := . -}}
|
||||
{{- if gt .Width 1280 }}{{ $img = .Resize "1280x webp q82" }}{{ else }}{{ $img = .Process "webp q82" }}{{ end -}}
|
||||
<figure class="screenshot">
|
||||
<a href="{{ .RelPermalink }}"><img src="{{ $img.RelPermalink }}" width="{{ $img.Width }}" height="{{ $img.Height }}" alt="{{ $.Get "alt" }}" loading="lazy" decoding="async"></a>
|
||||
<figcaption>
|
||||
{{- with $.Get "caption" }}{{ . | $.Page.RenderString }}{{ end -}}
|
||||
{{- if eq ($.Get "demo") "true" }} <span class="screenshot-src">Shown on the public demo. Your server may look slightly different.</span>{{ end -}}
|
||||
</figcaption>
|
||||
</figure>
|
||||
{{- else -}}
|
||||
{{- errorf "screenshot: assets/screenshots/%s not found (%s)" $src $.Position -}}
|
||||
{{- end -}}
|
||||
Reference in New Issue
Block a user