Skip to content

Commit

Permalink
[web] Shortcode-comments have an interesting syntax.
Browse files Browse the repository at this point in the history
  • Loading branch information
bilke committed Jun 11, 2024
1 parent e5ddf17 commit e0c3bae
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions web/layouts/shortcodes/dataFile.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
{{- $map := split . "." }}
{{- $url := index $.Site.Data $map -}}
{{- if $url -}}
{# Second parameter allows to get a version component, starting with index 1 #}
{{/*% 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 #}
{{/*% Start with index 1, subtract 1 to get zero-based index % */}}
{{- $index := math.Sub . 1 -}}
{{- $version_comps := split $url "." -}}
{{- $url = index $version_comps $index -}}
Expand Down

0 comments on commit e0c3bae

Please sign in to comment.