feature(config): add config for home profile/posts

This commit is contained in:
Dillon
2020-02-17 02:19:55 +08:00
parent d87af71176
commit 5a1e0b5d31
12 changed files with 319 additions and 288 deletions

View File

@@ -1,14 +1,16 @@
{{- define "content" -}}
<div class="page home">
{{- /* Home mode [post] */ -}}
{{- if eq .Site.Params.home_mode "post" -}}
{{- /* Profile */ -}}
{{- /* Profile */ -}}
{{- if .Site.Params.home.profile.enable -}}
{{- partial "home/profile.html" . -}}
{{- end -}}
{{- /* Posts */ -}}
{{- if .Site.Params.home.posts.enable -}}
{{- /* Paginate */ -}}
{{- $paginator := where .Site.RegularPages "Type" "posts" -}}
{{- $paginator = where $paginator "Params.show_in_homepage" "!=" false -}}
{{- with .Site.Params.home_paginate -}}
{{- with .Site.Params.home.posts.paginate -}}
{{- $paginator = $.Paginate $paginator . -}}
{{- else -}}
{{- $paginator = $.Paginate $paginator -}}
@@ -17,11 +19,6 @@
{{- .Render "summary" -}}
{{- end -}}
{{- partial "paginator.html" . -}}
{{- /* Home mode [other] */ -}}
{{- else -}}
{{- /* Profile */ -}}
{{- partial "home/profile.html" . -}}
{{- end -}}
</div>
{{- end -}}