Commit 1016452d authored by Kaushal Modi's avatar Kaushal Modi

Hyperlink nim commit hash in versions front-matter

parent 8cca6b93
......@@ -65,7 +65,12 @@
{{ range $k, $v := . }}
{{ printf "<code>%s</code> " $k | safeHTML }}
{{ if (eq "string" (printf "%T" $v)) }} <!-- Check if the value is a string -->
{{ printf "%s" $v | safeHTML -}} <!-- Don't print strings using "%#v" else they get double-quoted -->
{{ $v_is_hex := findRE "^[0-9a-f]{6,}$" ($v | lower) }}
{{ if (and (eq "nim" ($k | lower)) $v_is_hex) }}
{{ printf `<a href="https://github.com/nim-lang/Nim/commit/%s">%s</a>` $v $v | safeHTML -}}
{{ else }}
{{ printf "%s" $v | safeHTML -}} <!-- Don't print strings using "%#v" else they get double-quoted -->
{{ end }}
{{- else -}}
{{- printf "%#v" $v | safeHTML -}} <!-- Cannot print floats like 0.39 using "%s", so using "%#v" -->
{{- end -}}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment