Skip to content

Commit

Permalink
Error checking of attributes on feature shortcode (#1205)
Browse files Browse the repository at this point in the history
This should make attribute spelling mistakes much
harder to do in the future!
  • Loading branch information
markmandel authored and roberthbailey committed Dec 4, 2019
1 parent 3ac6978 commit 3351c0c
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions site/layouts/shortcodes/feature.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
{{- $version := getenv "RELEASE_VERSION" | default $.Page.Site.Params.release_version }}

{{- with or (.Get "publishVersion") (.Get "expiryVersion")}}
{{- else }}
{{ errorf "missing value for either publishVersion or expiryVersion: %s" .Position}}
{{- end}}
{{- $publishVersion := (.Get "publishVersion" ) | default "0.0.0" }}
{{- $expiryVersion := (.Get "expiryVersion") | default "9999.0.0"}}
{{- $publDigits := split $publishVersion "." }}
Expand Down

0 comments on commit 3351c0c

Please sign in to comment.