mirror of
https://github.com/flysnow-org/maupassant-hugo.git
synced 2026-08-24 15:28:55 +00:00
同时兼容content/post和content/posts目录作为文章内容
This commit is contained in:
@@ -11,6 +11,7 @@
|
||||
<div class="title404">
|
||||
<p>每一个平凡的日常<br/>都是连续发生中的奇迹</p>
|
||||
</div>
|
||||
{{ partial "related" . }}
|
||||
<a rel="nofollow" href="{{ .Site.BaseURL }}" class="index404">回首页看看</a>
|
||||
</section>
|
||||
</div>
|
||||
|
||||
@@ -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">
|
||||
|
||||
@@ -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
@@ -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">
|
||||
|
||||
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user