mirror of
https://github.com/Vimux/Binario.git
synced 2024-12-22 12:39:07 +00:00
Add main index page
The main index page shows only `mainSections` ("post" by default). You can set sections with "mainSections" config parameter.
This commit is contained in:
parent
37b761904a
commit
0ed9f70323
2 changed files with 15 additions and 0 deletions
|
@ -29,6 +29,7 @@ description = "John Doe's Personal blog about everything" # Description of your
|
|||
opengraph = true # Enable OpenGraph if true
|
||||
twitter_cards = true # Enable Twitter Cards if true
|
||||
cardsPerRow = 2 # Possible values: 1, 2, 3
|
||||
#mainSections = ["post"] # Set main page sections
|
||||
#dateFormat = "2006-01-02" # change the format of dates
|
||||
|
||||
[outputFormats]
|
||||
|
|
14
layouts/index.html
Normal file
14
layouts/index.html
Normal file
|
@ -0,0 +1,14 @@
|
|||
{{ partial "header.html" . }}
|
||||
<div class="main">
|
||||
<div class="cards">
|
||||
{{ $mainSections := .Site.Params.mainSections | default (slice "post") }}
|
||||
{{ $paginator := .Paginate ( where .Data.Pages "Section" "in" $mainSections ) }}
|
||||
{{ range $paginator.Pages }}
|
||||
<div class="card{{ with .Site.Params.cardsPerRow }} card--{{ . }}col{{ else }} card--2col{{ end }}">
|
||||
{{ .Render "summary" }}
|
||||
</div>
|
||||
{{ end }}
|
||||
</div>
|
||||
{{ partial "pagination.html" . }}
|
||||
</div>
|
||||
{{ partial "footer.html" . }}
|
Loading…
Reference in a new issue