From 0ed9f7032373153d4515e1afe602bcb5ae665f7d Mon Sep 17 00:00:00 2001 From: vimux Date: Wed, 23 May 2018 09:37:31 +0300 Subject: [PATCH] Add main index page The main index page shows only `mainSections` ("post" by default). You can set sections with "mainSections" config parameter. --- README.md | 1 + layouts/index.html | 14 ++++++++++++++ 2 files changed, 15 insertions(+) create mode 100644 layouts/index.html diff --git a/README.md b/README.md index b7239fb..c3b600a 100644 --- a/README.md +++ b/README.md @@ -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] diff --git a/layouts/index.html b/layouts/index.html new file mode 100644 index 0000000..3eb665b --- /dev/null +++ b/layouts/index.html @@ -0,0 +1,14 @@ +{{ partial "header.html" . }} +
+
+ {{ $mainSections := .Site.Params.mainSections | default (slice "post") }} + {{ $paginator := .Paginate ( where .Data.Pages "Section" "in" $mainSections ) }} + {{ range $paginator.Pages }} +
+ {{ .Render "summary" }} +
+ {{ end }} +
+ {{ partial "pagination.html" . }} +
+{{ partial "footer.html" . }} \ No newline at end of file