From 443d65ac50137666963a3c6b7445c4d40253a8c0 Mon Sep 17 00:00:00 2001 From: mayx Date: Fri, 4 Oct 2024 06:19:24 +0000 Subject: Update 4 files - /_layouts/default.html - /_layouts/post.html - /js/main.js - /_posts/2024-10-01-suggest.md--- _layouts/default.html | 4 ++-- _layouts/post.html | 26 +++++++++++++++++++++++++- 2 files changed, 27 insertions(+), 3 deletions(-) (limited to '_layouts') diff --git a/_layouts/default.html b/_layouts/default.html index 509ef6a..20595ac 100644 --- a/_layouts/default.html +++ b/_layouts/default.html @@ -28,11 +28,11 @@ gtag('config', '{{ site.google_analytics }}'); var lastUpdated = new Date("{{ site.time | date: "%FT%T%z" }}"); function getSearchJSON(callback) { - var searchData = JSON.parse(localStorage.getItem(lastUpdated)); + var searchData = JSON.parse(localStorage.getItem("blog_" + lastUpdated.valueOf())); if (!searchData) { localStorage.clear(); $.getJSON("/search.json", function (data) { - localStorage.setItem(lastUpdated, JSON.stringify(data)); + localStorage.setItem("blog_" + lastUpdated.valueOf(), JSON.stringify(data)); callback(data); }); } else { diff --git a/_layouts/post.html b/_layouts/post.html index 59835ee..2ad1fdd 100644 --- a/_layouts/post.html +++ b/_layouts/post.html @@ -82,7 +82,31 @@ layout: default {% endif %}

-

+

+