|
|
@ -157,7 +157,7 @@ resolve-additional-types.)
|
|
|
|
|
|
|
|
|
|
|
|
{{/* If the string uses a known format, use it. */}}
|
|
|
|
{{/* If the string uses a known format, use it. */}}
|
|
|
|
{{ with .format }}
|
|
|
|
{{ with .format }}
|
|
|
|
{{ with partial "custom-format" . }}
|
|
|
|
{{ with partial "string-format" . }}
|
|
|
|
{{ $type = . }}
|
|
|
|
{{ $type = . }}
|
|
|
|
{{ end }}
|
|
|
|
{{ end }}
|
|
|
|
{{ end }}
|
|
|
|
{{ end }}
|
|
|
@ -264,7 +264,7 @@ resolve-additional-types.)
|
|
|
|
{{ range $formatId, $formatType := $formatMap.Values }}
|
|
|
|
{{ range $formatId, $formatType := $formatMap.Values }}
|
|
|
|
{{ $formatKey := "string" }}
|
|
|
|
{{ $formatKey := "string" }}
|
|
|
|
{{ if ne $formatId "string" }}
|
|
|
|
{{ if ne $formatId "string" }}
|
|
|
|
{{ with partial "custom-format" $formatId }}
|
|
|
|
{{ with partial "string-format" $formatId }}
|
|
|
|
{{ $formatKey = . }}
|
|
|
|
{{ $formatKey = . }}
|
|
|
|
{{ else }}
|
|
|
|
{{ else }}
|
|
|
|
{{ errorf "Unsupported value for `x-pattern-format`: %s" $formatId }}
|
|
|
|
{{ errorf "Unsupported value for `x-pattern-format`: %s" $formatId }}
|
|
|
@ -331,12 +331,12 @@ resolve-additional-types.)
|
|
|
|
Computes the type to display for a string format, given the identifier of
|
|
|
|
Computes the type to display for a string format, given the identifier of
|
|
|
|
the format as a string.
|
|
|
|
the format as a string.
|
|
|
|
*/}}
|
|
|
|
*/}}
|
|
|
|
{{ define "partials/custom-format" }}
|
|
|
|
{{ define "partials/string-format" }}
|
|
|
|
{{ $customFormat := "" }}
|
|
|
|
{{ $stringFormat := "" }}
|
|
|
|
|
|
|
|
|
|
|
|
{{ with index site.Data "custom-formats" . }}
|
|
|
|
{{ with index site.Data "string-formats" . }}
|
|
|
|
{{ $customFormat = printf "<a href=\"%s\">%s</a>" (htmlEscape .url) (htmlEscape .title) }}
|
|
|
|
{{ $stringFormat = printf "<a href=\"%s\">%s</a>" (htmlEscape .url) (htmlEscape .title) }}
|
|
|
|
{{ end }}
|
|
|
|
{{ end }}
|
|
|
|
|
|
|
|
|
|
|
|
{{ return $customFormat }}
|
|
|
|
{{ return $stringFormat }}
|
|
|
|
{{ end }}
|
|
|
|
{{ end }}
|
|
|
|