diff options
Diffstat (limited to '_layouts/postlist.html')
-rw-r--r-- | _layouts/postlist.html | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/_layouts/postlist.html b/_layouts/postlist.html index 67a1d48..b6b29ef 100644 --- a/_layouts/postlist.html +++ b/_layouts/postlist.html @@ -39,6 +39,9 @@ layout: default {%- elsif site.show_excerpts -%} {{ post.excerpt }} {%- assign showsep = true -%} + {%- elsif post.description -%} + {{ post.description }} + {%- assign showsep = true -%} {%- endif -%} </div> </li> @@ -56,9 +59,14 @@ layout: default <script> document.addEventListener("DOMContentLoaded", function() { - const ids = [ "AdBlock", "news1" ]; + {%- assign news_ids = site.data.news | map: 'id' | jsonify %} + + const ids = {{ news_ids }}; for (currId of ids) { const currentBanner = document.getElementById(currId); + if (!currentBanner) { + continue; + } const closeLink = currentBanner.firstElementChild; const currentNewsClosed = localStorage.getItem(currId+"closed"); if (currentNewsClosed === "true") { |