diff --git a/docs/tutorials/projects/helmet.md b/docs/tutorials/projects/helmet.md index a86cb4571a..cef0d9ed96 100644 --- a/docs/tutorials/projects/helmet.md +++ b/docs/tutorials/projects/helmet.md @@ -4,7 +4,7 @@ linkTitle: "Helmet Monitor" type: "docs" description: "Get a text or email if people are not wearing hard hats, and track data over time." videos: ["/tutorials/helmet/hardhat.webm", "/tutorials/helmet/hardhat.mp4"] -# images: ["/tutorials/helmet/hardhat-data.png"] +images: ["/tutorials/helmet/hardhat.gif"] videoAlt: "A man without a hard hat is detected and labeled as No-Hardhat. Then he puts on a hard hat and a bounding box labeled Hardhat appears. He gives a thumbs-up to the camera." tags: ["tutorial"] authors: [Jessamy Taylor] diff --git a/layouts/_default/list.typesense.json b/layouts/_default/list.typesense.json index 9263453e8a..bf9d1d9b34 100644 --- a/layouts/_default/list.typesense.json +++ b/layouts/_default/list.typesense.json @@ -45,25 +45,25 @@ {{- end -}} {{- end -}} + {{- $.Scratch.Set "image" "" -}} {{- else -}} {{- $.Scratch.Set "webm" "" -}} {{- $.Scratch.Set "mp4" "" -}} - {{- end -}} - - {{- if (index .Params.images 0) -}} - {{- $image_ext := path.Ext (index .Params.images 0) -}} - {{- $image_extensions := slice ".png" ".jpg" ".jpeg" ".svg" -}} - {{- if in $image_extensions $image_ext -}} - {{- if eq ((index .Params.images 0) | printf "%.1s") "/" -}} - {{- $.Scratch.Set "image" (printf "..%s" (index .Params.images 0)) -}} + {{- if (index .Params.images 0) -}} + {{- $image_ext := path.Ext (index .Params.images 0) -}} + {{- $image_extensions := slice ".png" ".jpg" ".jpeg" ".svg" -}} + {{- if in $image_extensions $image_ext -}} + {{- if eq ((index .Params.images 0) | printf "%.1s") "/" -}} + {{- $.Scratch.Set "image" (printf "..%s" (index .Params.images 0)) -}} + {{- else -}} + {{- $.Scratch.Set "image" (printf "%s" (index .Params.images 0)) -}} + {{- end -}} {{- else -}} - {{- $.Scratch.Set "image" (printf "%s" (index .Params.images 0)) -}} + {{- $.Scratch.Set "image" "" -}} {{- end -}} {{- else -}} - {{- $.Scratch.Set "image" "" -}} - {{- end -}} - {{- else -}} {{- $.Scratch.Set "image" "" -}} + {{- end -}} {{- end -}} {{- if .Params.canonical -}} diff --git a/static/tutorials/helmet/hardhat.gif b/static/tutorials/helmet/hardhat.gif new file mode 100644 index 0000000000..8ca66974ae Binary files /dev/null and b/static/tutorials/helmet/hardhat.gif differ