同时兼容content/post和content/posts目录作为文章内容

This commit is contained in:
飞雪无情
2018-10-11 01:08:57 +08:00
parent c11e60c985
commit 0e3989e0ee
5 changed files with 5 additions and 4 deletions
+1
View File
@@ -11,6 +11,7 @@
<div class="title404">
<p>每一个平凡的日常<br/>都是连续发生中的奇迹</p>
</div>
{{ partial "related" . }}
<a rel="nofollow" href="{{ .Site.BaseURL }}" class="index404">回首页看看</a>
</section>
</div>
+1 -1
View File
@@ -23,7 +23,7 @@
</h3>
{{ end }}
{{ range $index,$data := (where .Paginator.Pages "Type" "post") }}
{{ range $index,$data := (where .Paginator.Pages "Type" "in" (slice "post" "posts")) }}
<article class="post">
<header>
<h1 class="post-title">
+1 -1
View File
@@ -9,7 +9,7 @@
<div class="col-8" id="main">
<div class="post-archive">
{{ range (where (where .Site.Pages "Type" "post") "Kind" "page").GroupByDate "2006" }}
{{ range (where (where .Site.Pages "Type" "in" (slice "post" "posts")) "Kind" "page").GroupByDate "2006" }}
<h2>{{ .Key }}</h2>
<ul class="listing">
{{ range .Pages }}
+1 -1
View File
@@ -9,7 +9,7 @@
<div class="col-8" id="main">
<div class="res-cons">
{{ range $index,$data := (where .Paginator.Pages "Type" "post") }}
{{ range $index,$data := (where .Paginator.Pages "Type" "in" (slice "post" "posts")) }}
<article class="post">
<header>
<h1 class="post-title">
+1 -1
View File
@@ -6,7 +6,7 @@
<section class="widget">
<h3 class="widget-title">最近文章</h3>
<ul class="widget-list">
{{ range first 10 (where (where .Site.Pages "Type" "post") "Kind" "page") }}
{{ range first 10 (where (where .Site.Pages "Type" "in" (slice "post" "posts")) "Kind" "page") }}
<li>
<a href="{{ .Permalink }}" title="{{ .Title }}">{{ .Title }}</a>
</li>