diff options
author | mayx | 2025-03-30 13:47:42 +0000 |
---|---|---|
committer | mayx | 2025-03-30 13:47:42 +0000 |
commit | 7785bc18c726c2757965874696fd0279cca57d2b (patch) | |
tree | 213dc83c3ff835b58d803d460b37755b8cf7230b /_layouts/default.html | |
parent | 9a0af3f555a0b37e05bdf68a75b6eabb44c3b249 (diff) |
Update 2 files
- /_layouts/default.html - /index.html
Diffstat (limited to '_layouts/default.html')
-rw-r--r-- | _layouts/default.html | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/_layouts/default.html b/_layouts/default.html index 3669255..ded6615 100644 --- a/_layouts/default.html +++ b/_layouts/default.html @@ -31,7 +31,12 @@ function getSearchJSON(callback) { var searchData = JSON.parse(localStorage.getItem("blog_" + lastUpdated.valueOf())); if (!searchData) { - localStorage.clear(); + for (var i = 0; i < localStorage.length; i++) { + var key = localStorage.key(i); + if (key.startsWith('blog_')) { + localStorage.removeItem(key); + } + } $.getJSON("/search.json", function (data) { localStorage.setItem("blog_" + lastUpdated.valueOf(), JSON.stringify(data)); callback(data); |