diff --git a/archetypes/tutorials/single/index.md b/archetypes/tutorials/single/index.md index 8c0c74a32b85..3b2281b85d45 100644 --- a/archetypes/tutorials/single/index.md +++ b/archetypes/tutorials/single/index.md @@ -12,6 +12,12 @@ meta_desc: Here is a brief description of what this tutorial's all about. # An image for the tutorial. It appears on tutorial page and in social-media previews. meta_image: meta.png +# An optional video for the tutorial. When present, it appears at the top of the page, replacing +# the meta image. YouTube and HTML5 video sources are supported. +# video: +# url: /blog/drift-detection/drift.mp4 +# youtube: Q8tw6YTD3ac + # The order in which the tutorial appears in most lists. Order is ascending, so higher numbers # mean the tutorial will appear further down the list. Positive integers only. weight: 999 diff --git a/layouts/partials/tutorials/nav.html b/layouts/partials/tutorials/nav.html index 0132a06c574d..7c9fb19d5791 100644 --- a/layouts/partials/tutorials/nav.html +++ b/layouts/partials/tutorials/nav.html @@ -17,6 +17,14 @@ {{ end }} {{ end }} + {{ $providers := slice }} + {{ range .Site.Data.tutorials.collections }} + {{ if and (.featured) (eq .type "provider") (ne (index $.Site.Taxonomies.collections .id) nil) }} + {{ $collectionPath := (printf "/tutorials/%s/" .id) }} + {{ $providers = $providers | append (dict "id" .id "label" .name "href" $collectionPath "active" (eq $collectionPath $currentPath)) }} + {{ end }} + {{ end }} + {{ $collections := slice }} {{ range .Site.Data.tutorials.collections }} {{ if and (ne .type "provider") (ne (index $.Site.Taxonomies.collections .id) nil) }} @@ -25,10 +33,12 @@ {{ end }} {{ end }} - {{ $menuItems = slice - (dict "id" "get-started" "label" "Get started" "href" "/docs/get-started/" "children" $clouds) - (dict "id" "collections" "label" "Collections" "href" nil "children" $collections) - }} + {{ $menuItems = slice }} + {{ $menuItems = $menuItems | append (dict "id" "get-started" "label" "Get started" "href" "/docs/get-started/" "children" $clouds) }} + {{ if gt (len $providers) 0 }} + {{ $menuItems = $menuItems | append (dict "id" "providers" "label" "Browse by cloud" "href" nil "children" $providers) }} + {{ end }} + {{ $menuItems = $menuItems | append (dict "id" "collections" "label" "Collections" "href" nil "children" $collections) }} {{/* On module pages, show the member topics and a link back to the home page. */}} {{ else if eq .Kind "section" }} diff --git a/layouts/partials/video.html b/layouts/partials/video.html new file mode 100644 index 000000000000..28999e9a19f1 --- /dev/null +++ b/layouts/partials/video.html @@ -0,0 +1,12 @@ +{{ $src := .url }} +{{ $title := .title }} +{{ $controls := default true .controls }} +{{ $autoplay := default false .autoplay }} +{{ $loop := default false .loop }} + + diff --git a/layouts/partials/youtube.html b/layouts/partials/youtube.html new file mode 100644 index 000000000000..d4f746ab24be --- /dev/null +++ b/layouts/partials/youtube.html @@ -0,0 +1,7 @@ +{{ $id := .id }} +{{ $title := .title }} + + +
diff --git a/layouts/taxonomy/collection.html b/layouts/taxonomy/collection.html index 4d126042d432..661aa2fc3402 100644 --- a/layouts/taxonomy/collection.html +++ b/layouts/taxonomy/collection.html @@ -26,7 +26,7 @@