Adding files page and UI with proper linking for large files containment, starting with the uk sound series stuff as a test
This commit is contained in:
parent
7f5e10be71
commit
8c0792af3d
@ -25,3 +25,6 @@ Params:
|
|||||||
- name: Dev Blog
|
- name: Dev Blog
|
||||||
description: Dev stuff
|
description: Dev stuff
|
||||||
uri: /dev
|
uri: /dev
|
||||||
|
- name: Files
|
||||||
|
description: Links to files
|
||||||
|
uri: /files
|
||||||
|
@ -7,32 +7,55 @@
|
|||||||
<h5>/feed</h5>
|
<h5>/feed</h5>
|
||||||
{{ else if eq .Dir "dev/" }}
|
{{ else if eq .Dir "dev/" }}
|
||||||
<h5>/dev</h5>
|
<h5>/dev</h5>
|
||||||
|
{{ else if eq .Dir "files/" }}
|
||||||
|
<h5>/files</h5>
|
||||||
{{ end }}
|
{{ end }}
|
||||||
{{ end }}
|
{{ end }}
|
||||||
<p>{{ .Content }}</p>
|
<p>{{ .Content }}</p>
|
||||||
|
{{ if hasPrefix $path "files" }}
|
||||||
|
{{ $colors := slice "cyan" "yellow" "pink"}}
|
||||||
|
{{ $opts := len $colors }}
|
||||||
|
{{ range $i, $top := readDir "content/files/" }}
|
||||||
|
<!-- Skip non - directories -->
|
||||||
|
{{ if eq $top.IsDir false }} {{ continue }} {{ end }}
|
||||||
|
|
||||||
|
<!-- Generate card for each folder -->
|
||||||
|
<div class="card" style="border-color: {{ mod $i $opts | index $colors }}">
|
||||||
|
<h5 class="card-header postcard card-title">{{ $top.Name }}</h5>
|
||||||
|
<!-- generate links for all the folder's files -->
|
||||||
|
{{ range $file := print "content/files/" $top.Name | readDir }}
|
||||||
|
<ul>
|
||||||
|
<a href="{{ print "/files/" $top.Name "/" $file.Name }}">
|
||||||
|
{{ print $file.Name }}
|
||||||
|
</a>
|
||||||
|
</ul>
|
||||||
|
{{ end }}
|
||||||
|
</div>
|
||||||
|
{{ end }}
|
||||||
|
{{ end }}
|
||||||
{{ $colors := slice "cyan" "yellow" "pink"}}
|
{{ $colors := slice "cyan" "yellow" "pink"}}
|
||||||
{{ $opts := len $colors }}
|
{{ $opts := len $colors }}
|
||||||
{{ range $i, $page := .Pages.ByDate.Reverse }}
|
{{ range $i, $page := .Pages.ByDate.Reverse }}
|
||||||
{{ $opt := mod $i $opts }}
|
{{ $opt := mod $i $opts }}
|
||||||
<div class="card" style="border-color: {{ index $colors $opt }}">
|
<div class="card" style="border-color: {{ index $colors $opt }}">
|
||||||
<a href="{{ anchorize .Page.Name }}">
|
<a href="{{ anchorize .Page.Name }}">
|
||||||
<h5 class="card-header postcard card-title">{{ .Title }}</h5>
|
<h5 class="card-header postcard card-title">{{ .Title }}</h5>
|
||||||
</a>
|
</a>
|
||||||
<div class="card-body postcard">
|
<div class="card-body postcard">
|
||||||
{{ if .Page.Params.Article }}
|
{{ if .Page.Params.Article }}
|
||||||
<p class="card-text">{{ .Description }}</p>
|
<p class="card-text">{{ .Description }}</p>
|
||||||
{{ else }}
|
{{ else }}
|
||||||
<p class="card-text">{{ .Content }}</p>
|
<p class="card-text">{{ .Content }}</p>
|
||||||
{{ end }}
|
{{ end }}
|
||||||
{{ if .Page.Params.Thumbnail }}
|
{{ if .Page.Params.Thumbnail }}
|
||||||
<a href="{{ .Params.Thumbnail }}">
|
<a href="{{ .Params.Thumbnail }}">
|
||||||
<img class="card-img" src="{{ .Params.Thumbnail }}">
|
<img class="card-img" src="{{ .Params.Thumbnail }}">
|
||||||
</a>
|
</a>
|
||||||
{{ end }}
|
{{ end }}
|
||||||
|
</div>
|
||||||
|
<div class="card-footer text-muted postcard">
|
||||||
|
{{ .Date | time.Format ":date_short" }} {{ .Date | time.Format ":time_long"}}
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="card-footer text-muted postcard">
|
|
||||||
{{ .Date | time.Format ":date_short" }} {{ .Date | time.Format ":time_long"}}
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
{{ end }}
|
{{ end }}
|
||||||
{{ end }}
|
{{ end }}
|
||||||
|
Loading…
Reference in New Issue
Block a user