Blue green deployments and a better way of getting real files links into hugo
This commit is contained in:
@@ -12,31 +12,22 @@
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
<p>{{ .Content }}</p>
|
||||
{{ $colors := slice "cyan" "yellow" "pink"}}
|
||||
{{ 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 }}
|
||||
{{ range $folder, $files := .Params.folders }}
|
||||
{{ $opt := mod (len $folder) (len $colors) }}
|
||||
<div class="card" style="border-color: {{ index $colors $opt }}">
|
||||
<h5 class="card-header postcard card-title">{{ $folder }}</h5>
|
||||
{{ range $file := $files }}
|
||||
<ul>
|
||||
<a href="{{ print "/files/" $top.Name "/" $file.Name }}">
|
||||
{{ print $file.Name }}
|
||||
</a>
|
||||
<a href={{ print "/files/" $folder "/" $file }}>{{ $file}}</a>
|
||||
</ul>
|
||||
{{ end }}
|
||||
</div>
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
{{ $colors := slice "cyan" "yellow" "pink"}}
|
||||
{{ $opts := len $colors }}
|
||||
{{ range $i, $page := .Pages.ByDate.Reverse }}
|
||||
{{ $opt := mod $i $opts }}
|
||||
{{ $opt := mod $i (len $colors) }}
|
||||
<div class="card" style="border-color: {{ index $colors $opt }}">
|
||||
<a href="{{ anchorize .Page.Name }}">
|
||||
<h5 class="card-header postcard card-title">{{ .Title }}</h5>
|
||||
|
||||
Reference in New Issue
Block a user