From bb54be4a4c775bd541dd8d9877c2112c130b3ef0 Mon Sep 17 00:00:00 2001 From: Zhang Liang Date: Tue, 10 Apr 2018 11:32:18 +0800 Subject: [PATCH 1/2] Change back to display sequence only --- layouts/_default/list.html | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/layouts/_default/list.html b/layouts/_default/list.html index 9630c4d..7e8a75d 100644 --- a/layouts/_default/list.html +++ b/layouts/_default/list.html @@ -10,7 +10,7 @@ ID 名称 - 序列或题库 + 序列 创建日期 {{ range (where .Data.Pages "Section" "!=" "") }} @@ -19,11 +19,11 @@ {{ .Title }} {{ if fileExists (printf "static/seq/%s.json" .File) }} - {{ printf "%s.json" .File }} + {{ printf "%s.json" .File }} {{ else if fileExists (printf "static/seq/%s.csv" .File) }} - {{ printf "%s.csv" .File }} + {{ printf "%s.csv" .File }} {{ else if fileExists (printf "static/seq/%s" .File) }} - {{ printf "%s" .File }} + {{ printf "%s.json" .File }} {{ else }} 暂无 {{ end }} From 3c3867f83a4ee88f36d2bd6d47ce7aef5c5192f7 Mon Sep 17 00:00:00 2001 From: Zhang Liang Date: Tue, 10 Apr 2018 11:32:49 +0800 Subject: [PATCH 2/2] Add one shortcode to display directory files --- layouts/shortcodes/directoryindex.html | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 layouts/shortcodes/directoryindex.html diff --git a/layouts/shortcodes/directoryindex.html b/layouts/shortcodes/directoryindex.html new file mode 100644 index 0000000..a1c9b7e --- /dev/null +++ b/layouts/shortcodes/directoryindex.html @@ -0,0 +1,13 @@ +{{- $pathURL := .Get "pathURL" -}} +{{- $path := .Get "path" -}} +{{- $files := readDir $path -}} + + + +{{- range $files }} + + + + +{{- end }} +
文件大小(字节)文件名称
{{ .Size }} {{ .Name }}