hugo-owu-se/layouts/shortcodes/vps_location.html

20 lines
575 B
HTML
Raw Normal View History

2025-04-10 14:30:18 +07:00
{{- /*
For use with 7
*/}}
{{- /* Get LOCATION Arguments. */}}
{{- $ASN := or (.Get "asn") "N/a" }}
{{- $ASN_NAME := or (.Get "asn_name") "N/a" }}
{{- $COUNTRY := or (.Get "country") "N/a" }}
{{- $CITY := or (.Get "city") "N/a" }}
{{ $location := slice
(dict "type" "ASN" "value" (safeHTML (print "<a target=_blank href='https://bgp.tools/as/" $ASN "'>AS" $ASN "</a> " $ASN_NAME)))
(dict "type" "Country" "value" (print $CITY ", " $COUNTRY))
}}
<h3>Location</h3>
{{ range $location }}
<pre> <b>{{ .type }}:</b> {{ .value | safeHTML }}</pre>
2025-04-10 14:30:18 +07:00
{{ end }}