diff options
author | uvok cheetah | 2025-09-01 19:48:08 +0200 |
---|---|---|
committer | uvok cheetah | 2025-09-01 19:48:08 +0200 |
commit | aa43ecca893ebda91df538c73b311d141e8d9168 (patch) | |
tree | 3f6ac88e205ac03cb028d7d688df90e7b3fe7d53 /_layouts | |
parent | c029e3e7595f0f2cb6f54337c29cd80baf04cfa8 (diff) |
Remove newsbanner inline script
Diffstat (limited to '_layouts')
-rw-r--r-- | _layouts/postlist.html | 29 |
1 files changed, 1 insertions, 28 deletions
diff --git a/_layouts/postlist.html b/_layouts/postlist.html index b6b29ef..24909d1 100644 --- a/_layouts/postlist.html +++ b/_layouts/postlist.html @@ -57,31 +57,4 @@ layout: default </div> -<script> - document.addEventListener("DOMContentLoaded", function() { - {%- 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") { - currentBanner.style.display = "none"; - } - - function closeBanner(evt) { - currentBanner.style.display = "none"; - const storId = evt.currentTarget.closeArg + "closed"; - localStorage.setItem(storId, "true"); - } - - closeLink.closeArg=currId; - closeLink.addEventListener("click", closeBanner); - } - - }); -</script> +<script src="/assets/js/newsbanner.js"></script> |