Files
website/layouts/shortcodes/blocks/feature.html
T
Bjørn Erik Pedersen 1b5ff98a44 Make the home page into reusable and translatable blocks (#10071)
* Make navigation and UI strings i18n friendly

This commit

* Extracts most UI strings into i18n bundles so they can be translated
* Makes a proper Hugo menu out of the hardcoded menu that is shown on smaller screens
* Changes the language selector logic to navigate to the current page in the other language if possible (e.g. the translation). If not possible, it takes you to the home page for that language.

For testing, this commit also adds Norwegian as a new language. This is turned off.

* Make the home page into reusable and translatable blocks

This commit adds a set of block type shortcodes that is then used to build the home page.

* These shortcodes gets common image resources from a new headless bundle. These resources can be inherited or overridden by translations.
* The hardcoded case studies section on the home page is replaced with a query and a loop.
* The hardcoded feature list on the home page is replaed qith a query and a loop.
2018-09-14 14:47:24 -07:00

16 lines
637 B
HTML

{{/*
This shortcode renders a main feature as seen on the top of the Kubernetes home page.
It can be given a "image" parameter with a name partially matching a file in the images folder of the _common-resources bundle.
*/}}
{{- $imageName := $.Get "image" | default "flower" -}}
{{ if $imageName }}{{- template "shortcodes-blocks_getimage" (dict "name" $imageName "ctx" . "target" "feature-image") -}}{{ end }}
{{- $image := $.Scratch.Get "feature-image" -}}
<main>
{{ with $image }}<div class="image-wrapper"><img src="{{ .RelPermalink }}" alt="{{ .Title }}"></div>{{ end }}
<div class="content">
{{ $.Inner }}
</div>
</main>