Clean history, git LFS
This commit is contained in:
@@ -0,0 +1,22 @@
|
||||
{{ $slug := .Page.Slug }}
|
||||
{{ $galleryName := .Get "name" }}
|
||||
{{ $file := printf "%s.yaml" $galleryName }}
|
||||
{{ $galleryData := .Page.Resources.GetMatch $file | transform.Unmarshal }}
|
||||
|
||||
<div class="gallery grid grid-cols-1 sm:grid-cols-2 md:grid-cols-3 gap-4">
|
||||
{{ range $galleryData.images }}
|
||||
|
||||
<figure class="{{ .class | default "" }}">
|
||||
<img
|
||||
src="{{ site.Params.filesBase }}/{{ $slug }}/{{ .src }}"
|
||||
alt="{{ .alt | default "" }}"
|
||||
loading="lazy"
|
||||
decoding="async" />
|
||||
{{ with .caption }}
|
||||
<figcaption>{{ . }}</figcaption>
|
||||
{{ end }}
|
||||
</figure>
|
||||
|
||||
|
||||
{{ end }}
|
||||
</div>
|
||||
@@ -0,0 +1,16 @@
|
||||
{{ $src := .Get "src" }}
|
||||
{{ $alt := .Get "alt" }}
|
||||
{{ $slug := .Page.Slug }}
|
||||
|
||||
<figure>
|
||||
<img
|
||||
src="{{ site.Params.filesBase }}/{{ $slug }}/{{ $src }}"
|
||||
alt="{{ $alt }}"
|
||||
loading="lazy"
|
||||
decoding="async"
|
||||
width="{{ .Get "width" | default "800" }}" />
|
||||
|
||||
{{ with .Get "caption" }}
|
||||
<figcaption>{{ . }}</figcaption>
|
||||
{{ end }}
|
||||
</figure>
|
||||
@@ -0,0 +1,20 @@
|
||||
{{- $src := .Get "src" -}}
|
||||
{{- $poster := .Get "poster" -}}
|
||||
{{- $env := .Get "env" -}}
|
||||
{{- $alt := .Get "alt" | default "3D Model" -}}
|
||||
{{- $controls := .Get "controls" | default "camera-controls touch-action='pan-y'" -}}
|
||||
{{- $shadow := .Get "shadow" | default "0" -}}
|
||||
{{ $slug := .Page.Slug }}
|
||||
|
||||
<!--move this elsewhere-->
|
||||
<script type="module" src="https://ajax.googleapis.com/ajax/libs/model-viewer/4.0.0/model-viewer.min.js"></script>
|
||||
|
||||
<model-viewer
|
||||
style="width: 100%; height: 500px;"
|
||||
alt="{{ $alt }}"
|
||||
src="{{ site.Params.filesBase }}/{{ $slug }}/{{ $src }}"
|
||||
poster="{{ site.Params.filesBase }}/{{ $slug }}/{{ $poster }}"
|
||||
environment-image="{{ $env }}"
|
||||
shadow-intensity="{{ $shadow }}"
|
||||
{{ $controls | safeHTMLAttr }}>
|
||||
</model-viewer>
|
||||
@@ -0,0 +1,50 @@
|
||||
{{ $autoplay := .Get "autoplay" -}}
|
||||
{{ $caption := .Get "caption" -}}
|
||||
{{ $class := .Get "class" -}}
|
||||
{{ $loop := .Get "loop" -}}
|
||||
{{ $poster := .Get "poster" -}}
|
||||
{{ $preload := .Get "preload" | default "metadata" -}}
|
||||
{{ $src := .Get "src" -}}
|
||||
{{ $width := .Get "width" -}}
|
||||
|
||||
{{ $posterres := false -}}
|
||||
{{ $resource := false -}}
|
||||
{{ $static := false -}}
|
||||
{{ $type := false -}}
|
||||
|
||||
{{ if and $poster (fileExists (path.Join "/static" $poster)) -}}
|
||||
{{ $poster = relURL $poster -}}
|
||||
{{ else if $poster -}}
|
||||
{{ $poster = strings.TrimLeft "/" $poster -}}
|
||||
{{ with resources.Get $poster -}}
|
||||
{{ $posterres = . -}}
|
||||
{{ end -}}
|
||||
{{ with .Page.Resources.Get $poster -}}
|
||||
{{ $posterres = . -}}
|
||||
{{ end -}}
|
||||
{{ end -}}
|
||||
|
||||
{{ if $posterres -}}
|
||||
{{ if $width -}}
|
||||
{{ $image := $posterres.Resize (printf "%sx" $width) -}}
|
||||
{{ $poster = $image.RelPermalink -}}
|
||||
{{ else -}}
|
||||
{{ $poster = $posterres.RelPermalink -}}
|
||||
{{ end -}}
|
||||
{{ end -}}
|
||||
|
||||
{{ if not $src -}}
|
||||
{{ warnf "%s shortcode number %d in \"content/%s\" is missing the \"src\" attribute." .Name .Ordinal .Page.File.Path -}}
|
||||
{{ end -}}
|
||||
|
||||
{{ $slug := .Page.Slug }}
|
||||
|
||||
|
||||
<figure class="video{{ with $class }} {{ . }}{{ end }}">
|
||||
<video controls preload="{{ $preload }}" {{ with $width }}width="{{ . }}"{{ end }} {{ with $poster }}poster="{{ . }}"{{ end }} {{ with $autoplay }}autoplay="{{ . }}"{{ end }} {{ with $loop }}loop="{{ . }}"{{ end }}>
|
||||
<source src="{{ site.Params.filesBase }}/{{ $slug }}/{{ $src }}" {{ with $type }}type="{{ . }}"{{ end }}>
|
||||
</video>
|
||||
{{ with $caption -}}
|
||||
<figcaption>{{ . | .Page.RenderString }}</figcaption>
|
||||
{{ end -}}
|
||||
</figure>
|
||||
Reference in New Issue
Block a user