mirror of
https://github.com/yihui/hugo-xmin.git
synced 2024-11-22 16:39:19 +02:00
Merge pull request #1 from iquizoo/dev
Refine list template and add one shortcode
This commit is contained in:
commit
3aab3a4834
|
@ -10,7 +10,7 @@
|
|||
<tr>
|
||||
<th>ID</th>
|
||||
<th>名称</th>
|
||||
<th>序列或题库</th>
|
||||
<th>序列</th>
|
||||
<th>创建日期</th>
|
||||
</tr>
|
||||
{{ range (where .Data.Pages "Section" "!=" "") }}
|
||||
|
@ -19,11 +19,11 @@
|
|||
<td><a href="{{ .URL }}">{{ .Title }}</a></td>
|
||||
<td>
|
||||
{{ if fileExists (printf "static/seq/%s.json" .File) }}
|
||||
<a href="{{ printf "/seq/%s.json" .File }}">{{ printf "%s.json" .File }}</a>
|
||||
<a href="{{ printf "/seq/%s.json" .File }}" target="_blank">{{ printf "%s.json" .File }}</a>
|
||||
{{ else if fileExists (printf "static/seq/%s.csv" .File) }}
|
||||
<a href="{{ printf "/seq/%s.csv" .File }}">{{ printf "%s.csv" .File }}</a>
|
||||
<a href="{{ printf "/seq/%s.csv" .File }}" target="_blank">{{ printf "%s.csv" .File }}</a>
|
||||
{{ else if fileExists (printf "static/seq/%s" .File) }}
|
||||
<a href="{{ printf "/seq/%s/" .File }}">{{ printf "%s" .File }}</a>
|
||||
<a href="{{ printf "/seq/%s/sequence.json" .File }}" target="_blank">{{ printf "%s.json" .File }}</a>
|
||||
{{ else }}
|
||||
暂无
|
||||
{{ end }}
|
||||
|
|
|
@ -0,0 +1,13 @@
|
|||
{{- $pathURL := .Get "pathURL" -}}
|
||||
{{- $path := .Get "path" -}}
|
||||
{{- $files := readDir $path -}}
|
||||
<table>
|
||||
<th>文件大小(字节)</th>
|
||||
<th>文件名称</th>
|
||||
{{- range $files }}
|
||||
<tr>
|
||||
<td>{{ .Size }}</td>
|
||||
<td><a href="{{ $pathURL }}{{ .Name | relURL }}" target="_blank"> {{ .Name }}</a></td>
|
||||
</tr>
|
||||
{{- end }}
|
||||
</table>
|
Loading…
Reference in New Issue