diff options
author | uvok cheetah | 2025-03-04 18:16:08 +0100 |
---|---|---|
committer | uvok cheetah | 2025-03-04 18:16:08 +0100 |
commit | ba05942282b5029e95bdbfbc4c2bd78cb20b6a24 (patch) | |
tree | a72a5d64955f527f28b951fe245d4b9e20525c64 | |
parent | fcca46593170a5067eb6d2b18a0a83769e253bf8 (diff) |
Use jsonify instead
-rw-r--r-- | _layouts/postlist.html | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/_layouts/postlist.html b/_layouts/postlist.html index cc344d3..ee9dde6 100644 --- a/_layouts/postlist.html +++ b/_layouts/postlist.html @@ -59,11 +59,9 @@ layout: default <script> document.addEventListener("DOMContentLoaded", function() { - {%- assign news_ids = site.data.news | map: 'id' -%} - {%- assign quot_news = news_ids | join: '", "' -%} - {%- assign js_news = '"' | append: quot_news | append: '"' %} + {%- assign news_ids = site.data.news | map: 'id' | jsonify %} - const ids = [ {{ js_news }} ]; + const ids = {{ news_ids }}; for (currId of ids) { const currentBanner = document.getElementById(currId); const closeLink = currentBanner.firstElementChild; |