ソースを参照

feat(shortcode): show summaries by default in `list_children`

George Cushen 4 年 前
コミット
9872428a3f
1 ファイル変更5 行追加1 行削除
  1. 5 1
      wowchemy/layouts/shortcodes/list_children.html

+ 5 - 1
wowchemy/layouts/shortcodes/list_children.html

@@ -1,7 +1,11 @@
+{{ $show_summary := ne (.Get "show_summary") "false" }}
 {{ if gt (len $.Page.Pages) 0}}
   <ul class="list-unstyled">
     {{ range $.Page.Pages }}
-      <li><h5><a href="{{.RelPermalink}}">{{.LinkTitle}}</a></h5> {{with .Params.summary}}<p>{{. | plainify | emojify}}</p>{{end}}</li>
+      <li>
+        <h5><a href="{{.RelPermalink}}">{{.LinkTitle}}</a></h5>
+        {{if $show_summary | and .Summary}}<p>{{.Summary | plainify | emojify}}</p>{{end}}
+      </li>
     {{end}}
   </ul>
 {{end}}