Update the blog list layout
This commit is contained in:
parent
2ebd743ce5
commit
3fb0ef35fe
4 changed files with 130 additions and 44 deletions
39
layouts/blog/list.html
Normal file
39
layouts/blog/list.html
Normal file
|
@ -0,0 +1,39 @@
|
|||
{{ define "header" }}
|
||||
{{ partial "header.html" . }}
|
||||
{{ end }}
|
||||
|
||||
{{ define "main" }}
|
||||
{{ $pages := union .RegularPages .Sections }}
|
||||
{{ if .IsHome }}
|
||||
{{ $pages = where site.RegularPages "Type" "in" site.Params.mainSections }}
|
||||
{{ end }}
|
||||
|
||||
{{ .Content }}
|
||||
|
||||
{{ range .Pages.ByDate.GroupByDate "2006" }}
|
||||
<h2>{{ .Key }}</h2>
|
||||
<ul class="post-list">
|
||||
{{ range .Pages }}
|
||||
{{ if or (not .Draft) (and .Draft (not hugo.IsProduction)) }}
|
||||
<li>
|
||||
<h1>
|
||||
<a href="{{ .Permalink }}">{{ .Title }}</a>
|
||||
{{ partial "development/draft_tag.html" . }}
|
||||
</h1>
|
||||
<time class="nobreak" datetime="{{ .Date | time.Format "2006-01-02" }}">{{ .Date | time.Format "January" }}</time>
|
||||
<time class="nobreak" datetime="{{ .Date | time.Format "2006-01-02" }}">{{ .Date | time.Format "2" }}</time>
|
||||
<b></b>
|
||||
</li>
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
</ul>
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
|
||||
{{ define "footer" }}
|
||||
{{ partial "footer.html" . }}
|
||||
{{ end }}
|
||||
|
||||
{{ define "styles" }}
|
||||
<link rel="preload stylesheet" as="style" href="{{ `/styles/main.css` | absURL }}">
|
||||
{{ end }}
|
Loading…
Add table
Add a link
Reference in a new issue