feat: add ssg open services list

This commit is contained in:
Colin
2022-06-16 11:59:35 +08:00
parent cec9d1d715
commit cda0005008
4 changed files with 42 additions and 2 deletions

View File

@@ -0,0 +1,30 @@
<!--
Params:
name: css #id
url: path or url of your data.json
-->
{{ with .Get "url" }}
{{ $url := . }}
{{ with $.Get "name" }}
{{ $name := . }}
{{ $data := getJSON $url }}
{{ range $data.data }}
{{ $item := . }}
<h3 id="{{$item.name}}">{{$item.name}}</h3>
{{ $link := urls.Parse $item.link }}
<p>{{$item.type}} - {{$item.subtitle}}</p>
<p>地址:
{{ if (gt (len $link.Host) 1) }}
<a href="{{$item.link}}" >{{$link.Host}}</a>
{{ else }}
{{$item.link}}
{{ end }}
</p>
{{ if (gt (len $item.StartServingAt) 1) }}
<p>上线于{{$item.StartServingAt}}</p>
{{ end }}
{{ end }}
{{ end }}
{{ end }}