diff --git a/web/layouts/shortcodes/dataFile.html b/web/layouts/shortcodes/dataFile.html index d47c61c71a2be7278b7c8d5d967c9cebc5b19fd1..23e7a3a45964337ce90dddf169a8230bffbcee69 100644 --- a/web/layouts/shortcodes/dataFile.html +++ b/web/layouts/shortcodes/dataFile.html @@ -2,7 +2,14 @@ {{- $map := split . "." }} {{- $url := index $.Site.Data $map -}} {{- if $url -}} -{{- $url -}} + {# Second parameter allows to get a version component, starting with index 1 #} + {{- with $.Get 1 -}} + {# Start with index 1, subtract 1 to get zero-based index #} + {{- $index := math.Sub . 1 -}} + {{- $version_comps := split $url "." -}} + {{- $url = index $version_comps $index -}} + {{- end -}} + {{- $url -}} {{- else -}} {{- errorf "No data for key %s" . -}} {{- end -}}