docs-v2/layouts/shortcodes/cloud_regions.html

46 lines
1.4 KiB
HTML
Raw Normal View History

{{ $type := .Get "type" | default "table" }}
{{ $scratch := newScratch }}
{{ if eq $type "table"}}
{{ range .Site.Data.influxdb_urls.cloud.providers }}
{{ $scratch.Set "title" .name }}
{{ if not (in .name .short_name) }}
{{ $scratch.Set "title" (print .name " (" .short_name ")")}}
{{ end }}
{{ $title := $scratch.Get "title" }}
{{ $titleID := anchorize $title }}
<h3 id="{{ $titleID }}">{{ $title }}</h3>
<table>
<thead>
<th align="left">Region</th>
<th align="left">Location</th>
<th align="left">URL</th>
</thead>
{{ range .regions }}
<tr>
<td {{ if .status }}class="{{ .status }}"{{ end }}>{{ .name }}</td>
<td><a href="{{ .location }}">{{ .location }}</a></td>
2020-06-01 19:02:39 +00:00
<td><a href="{{ .url }}">{{ .url }}</a></td>
</tr>
{{ end }}
</table>
{{ end }}
{{ else if eq $type "list" }}
<ul>
{{ range .Site.Data.influxdb_urls.cloud.providers }}
{{ $scratch.Set "title" .name }}
{{ if not (in .name .short_name) }}
{{ $scratch.Set "title" (print .name " (" .short_name ")")}}
{{ end }}
{{ $title := $scratch.Get "title" }}
<li><strong>{{ $title }}</strong>
<ul>
{{ range .regions }}
<li {{ if .status }}class="{{ .status }}"{{ end }}>{{ .name }}</li>
{{ end }}
</ul>
</li>
{{ end }}
</ul>
{{ end }}