feat(home): improve default behavior of hiddenFromHomePage
This commit is contained in:
@@ -1,8 +1,8 @@
|
||||
<article class="single summary" itemscope itemtype="http://schema.org/Article">
|
||||
{{- /* Featured image */ -}}
|
||||
{{- with .Params.featured_image -}}
|
||||
{{- with .Params.featuredImage -}}
|
||||
<div class="featured-image-preview">
|
||||
{{- $image := $.Params.featured_image_preview | default . -}}
|
||||
{{- $image := $.Params.featuredImagePreview | default . -}}
|
||||
{{- partial "hook/image" $image -}}
|
||||
</div>
|
||||
{{- end -}}
|
||||
@@ -15,8 +15,8 @@
|
||||
{{- /* Meta */ -}}
|
||||
<div class="meta">
|
||||
{{- $author := .Params.author | default .Site.Author.name -}}
|
||||
{{- $author_link := .Params.author_link | default .Site.Author.link | default .Site.BaseURL -}}
|
||||
<a class="author" href="{{ $author_link }}" rel="author" target="_blank">
|
||||
{{- $authorLink := .Params.authorLink | default .Site.Author.link | default .Site.BaseURL -}}
|
||||
<a class="author" href="{{ $authorLink }}" rel="author" target="_blank">
|
||||
<i class="fas fa-user-circle fa-fw"></i>{{ $author }}
|
||||
</a>
|
||||
|
||||
@@ -39,13 +39,7 @@
|
||||
|
||||
{{- /* Summary content */ -}}
|
||||
<div class="content">
|
||||
{{- if .Params.description_as_summary -}}
|
||||
<p>
|
||||
{{- .Params.description -}}
|
||||
</p>
|
||||
{{- else -}}
|
||||
{{- partial "hook/content.html" .Summary | safeHTML -}}
|
||||
{{- end -}}
|
||||
{{- partial "hook/content.html" .Summary | safeHTML -}}
|
||||
</div>
|
||||
|
||||
{{- /* Footer */ -}}
|
||||
|
||||
@@ -9,7 +9,11 @@
|
||||
{{- if .Site.Params.home.posts.enable -}}
|
||||
{{- /* Paginate */ -}}
|
||||
{{- $paginator := where .Site.RegularPages "Type" "posts" -}}
|
||||
{{- $paginator = where $paginator "Params.show_in_homepage" "!=" false -}}
|
||||
{{- if ne .Site.Params.home.posts.mode.defaultHiddenFromHomePage false -}}
|
||||
{{- $paginator = where $paginator "Params.hiddenfromhomepage" "!=" true -}}
|
||||
{{- else -}}
|
||||
{{- $paginator = where $paginator "Params.hiddenfromhomepage" false -}}
|
||||
{{- end -}}
|
||||
{{- with .Site.Params.home.posts.paginate -}}
|
||||
{{- $paginator = $.Paginate $paginator . -}}
|
||||
{{- else -}}
|
||||
|
||||
@@ -64,7 +64,7 @@
|
||||
|
||||
{{- /* Share on Weibo */ -}}
|
||||
{{- if .Params.Share.Weibo | default .Site.Params.Share.Weibo | eq true -}}
|
||||
<a href="//service.weibo.com/share/share.php?url={{ .Permalink }}&appkey=&title={{ .Title }}{{ with $.Params.featured_image }}&pic={{ . }}{{- end -}}" target="_blank" title="{{ T "share" }} Weibo">
|
||||
<a href="//service.weibo.com/share/share.php?url={{ .Permalink }}&appkey=&title={{ .Title }}{{ with $.Params.featuredImage }}&pic={{ . }}{{- end -}}" target="_blank" title="{{ T "share" }} Weibo">
|
||||
<i class="fab fa-weibo fa-fw"></i>
|
||||
</a>
|
||||
{{- end -}}
|
||||
|
||||
@@ -9,8 +9,8 @@
|
||||
<div class="meta">
|
||||
<div class="meta-line">
|
||||
{{- $author := .Params.author | default .Site.Author.name -}}
|
||||
{{- $author_link := .Params.author_link | default .Site.Author.link | default .Site.BaseURL -}}
|
||||
<a class="author" href="{{ $author_link }}" rel="author" target="_blank">
|
||||
{{- $authorLink := .Params.authorLink | default .Site.Author.link | default .Site.BaseURL -}}
|
||||
<a class="author" href="{{ $authorLink }}" rel="author" target="_blank">
|
||||
<i class="fas fa-user-circle fa-fw"></i>{{ $author }}
|
||||
</a>
|
||||
{{- with .Params.categories -}}
|
||||
@@ -39,7 +39,7 @@
|
||||
</div>
|
||||
|
||||
{{- /* Featured image */ -}}
|
||||
{{- with .Params.featured_image -}}
|
||||
{{- with .Params.featuredImage -}}
|
||||
<div class="featured-image">
|
||||
{{- partial "hook/image" . -}}
|
||||
</div>
|
||||
@@ -49,8 +49,8 @@
|
||||
{{- if or .Params.toc (and .Site.Params.toc (ne .Params.toc false)) -}}
|
||||
<div class="post-toc" id="post-toc">
|
||||
<h2 class="post-toc-title">{{ T "toc" }}</h2>
|
||||
{{- $globalAutoCollapseToc := .Site.Params.auto_collapse_toc | default true }}
|
||||
<div class="post-toc-content{{ if not (and $globalAutoCollapseToc (ne .Params.auto_collapse_toc false)) }} always-active{{ end }}">
|
||||
{{- $globalAutoCollapseToc := .Site.Params.autoCollapseToc | default true }}
|
||||
<div class="post-toc-content{{ if not (and $globalAutoCollapseToc (ne .Params.autoCollapseToc false)) }} always-active{{ end }}">
|
||||
{{- .TableOfContents -}}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user