fix: ignore malformed organization founding year
This commit is contained in:
@@ -19,7 +19,12 @@
|
|||||||
"sameAs" $sameAs
|
"sameAs" $sameAs
|
||||||
-}}
|
-}}
|
||||||
{{- with $brand.contactEmail -}}{{- if not (in . ".example") -}}{{- $data = merge $data (dict "email" .) -}}{{- end -}}{{- end -}}
|
{{- with $brand.contactEmail -}}{{- if not (in . ".example") -}}{{- $data = merge $data (dict "email" .) -}}{{- end -}}{{- end -}}
|
||||||
{{- with $brand.foundedYear -}}{{- if gt (int .) 0 -}}{{- $data = merge $data (dict "foundingDate" (printf "%d" (int .))) -}}{{- end -}}{{- end -}}
|
{{- with $brand.foundedYear -}}
|
||||||
|
{{- $year := printf "%v" . -}}
|
||||||
|
{{- if gt (len (findRE `^[0-9]{4}$` $year)) 0 -}}
|
||||||
|
{{- $data = merge $data (dict "foundingDate" $year) -}}
|
||||||
|
{{- end -}}
|
||||||
|
{{- end -}}
|
||||||
<script type="application/ld+json">{{ $data | jsonify | safeJS }}</script>
|
<script type="application/ld+json">{{ $data | jsonify | safeJS }}</script>
|
||||||
|
|
||||||
{{- end -}}
|
{{- end -}}
|
||||||
|
|||||||
Reference in New Issue
Block a user