summaryrefslogtreecommitdiff
path: root/_layouts
diff options
context:
space:
mode:
authoruvok cheetah2025-03-04 18:16:08 +0100
committeruvok cheetah2025-03-04 18:16:08 +0100
commitba05942282b5029e95bdbfbc4c2bd78cb20b6a24 (patch)
treea72a5d64955f527f28b951fe245d4b9e20525c64 /_layouts
parentfcca46593170a5067eb6d2b18a0a83769e253bf8 (diff)
Use jsonify instead
Diffstat (limited to '_layouts')
-rw-r--r--_layouts/postlist.html6
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;