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
|
opengraph = true # Enable OpenGraph if true
|
||||||
twitter_cards = true # Enable Twitter Cards if true
|
twitter_cards = true # Enable Twitter Cards if true
|
||||||
cardsPerRow = 2 # Possible values: 1, 2, 3
|
cardsPerRow = 2 # Possible values: 1, 2, 3
|
||||||
|
#mainSections = ["post"] # Set main page sections
|
||||||
#dateFormat = "2006-01-02" # change the format of dates
|
#dateFormat = "2006-01-02" # change the format of dates
|
||||||
|
|
||||||
[outputFormats]
|
[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