Pārlūkot izejas kodu

post archive: display listings consistent with posts widget (Close #262)

George Cushen 7 gadi atpakaļ
vecāks
revīzija
f42cfe7d1a

+ 0 - 1
layouts/partials/post_li.html

@@ -1,5 +1,4 @@
 {{ $post := .post }}
-{{ $page := .page }}
 
 <div class="article-list-item" itemscope itemprop="blogPost">
   {{ $preview := $post.Params.header.preview | default true }}

+ 2 - 2
layouts/partials/widgets/posts.html

@@ -44,7 +44,7 @@
 
       {{ $show_post := $.Scratch.Get "show_post" }}
       {{ if ne $show_post "0" }}
-        {{ $params := dict "post" . "page" $page }}
+        {{ $params := dict "post" . }}
         {{ partial "post_li" $params }}
       {{end}}
 
@@ -71,7 +71,7 @@
 
       {{ $show_post := $.Scratch.Get "show_post" }}
       {{ if ne $show_post "0" }}
-        {{ $params := dict "post" . "page" $page }}
+        {{ $params := dict "post" . }}
         {{ partial "post_li" $params }}
       {{end}}
 

+ 2 - 18
layouts/section/post.html

@@ -13,24 +13,8 @@
 
   {{ $paginator := .Paginate .Data.Pages }}
   {{ range $paginator.Pages }}
-  <div>
-    {{ if .Params.image }}
-    <a href="{{ .Permalink }}">
-      <img src="{{ $.Site.BaseURL }}img/{{ .Params.image }}" class="article-banner">
-    </a>
-    {{end}}
-    <h2><a href="{{ .Permalink }}">{{ .Title }}</a></h2>
-    {{ partial "article_metadata" (dict "content" . "is_list" 1) }}
-    <div class="article-style"><p>
-      {{ if .Params.summary }}
-      {{ printf "%s" .Params.summary | markdownify }}
-      {{ else if .Truncated }}
-      {{ printf "%s" .Summary | markdownify }}
-      {{ else }}
-      {{ .Content }}
-      {{ end }}
-    </p></div>
-  </div>
+    {{ $params := dict "post" . }}
+    {{ partial "post_li" $params }}
   {{ end }}
 
   {{ partial "pagination" . }}