2023-09-23 08:44:56 +00:00
|
|
|
{{ define "main" }}
|
2023-09-24 22:49:10 +00:00
|
|
|
{{ partial "minimal-navbar.html" }}
|
2023-10-02 04:57:49 +00:00
|
|
|
{{ $path := "" }}
|
|
|
|
{{ with .File }}
|
|
|
|
{{ $path = .Path }}
|
|
|
|
{{ if eq .Dir "feed/" }}
|
|
|
|
<h5>/feed</h5>
|
|
|
|
{{ else if eq .Dir "dev/" }}
|
|
|
|
<h5>/dev</h5>
|
2024-02-20 01:14:24 +00:00
|
|
|
{{ else if eq .Dir "files/" }}
|
|
|
|
<h5>/files</h5>
|
2023-10-02 04:57:49 +00:00
|
|
|
{{ end }}
|
2023-10-02 04:45:41 +00:00
|
|
|
{{ end }}
|
2023-11-09 08:13:23 +00:00
|
|
|
<p>{{ .Content }}</p>
|
2024-02-20 01:14:24 +00:00
|
|
|
{{ 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 }}
|
2023-09-24 22:42:46 +00:00
|
|
|
{{ $colors := slice "cyan" "yellow" "pink"}}
|
|
|
|
{{ $opts := len $colors }}
|
|
|
|
{{ range $i, $page := .Pages.ByDate.Reverse }}
|
2024-02-20 01:14:24 +00:00
|
|
|
{{ $opt := mod $i $opts }}
|
|
|
|
<div class="card" style="border-color: {{ index $colors $opt }}">
|
|
|
|
<a href="{{ anchorize .Page.Name }}">
|
|
|
|
<h5 class="card-header postcard card-title">{{ .Title }}</h5>
|
|
|
|
</a>
|
|
|
|
<div class="card-body postcard">
|
|
|
|
{{ if .Page.Params.Article }}
|
|
|
|
<p class="card-text">{{ .Description }}</p>
|
|
|
|
{{ else }}
|
|
|
|
<p class="card-text">{{ .Content }}</p>
|
|
|
|
{{ end }}
|
|
|
|
{{ if .Page.Params.Thumbnail }}
|
|
|
|
<a href="{{ .Params.Thumbnail }}">
|
|
|
|
<img class="card-img" src="{{ .Params.Thumbnail }}">
|
|
|
|
</a>
|
|
|
|
{{ end }}
|
|
|
|
</div>
|
|
|
|
<div class="card-footer text-muted postcard">
|
|
|
|
{{ .Date | time.Format ":date_short" }} {{ .Date | time.Format ":time_long"}}
|
|
|
|
</div>
|
2023-09-23 08:44:56 +00:00
|
|
|
</div>
|
|
|
|
{{ end }}
|
|
|
|
{{ end }}
|