mirror of
https://github.com/Mabbs/mabbs.github.io
synced 2026-01-11 14:01:46 +08:00
Update 3 files
- /_posts/2025-06-02-optimize.md - /assets/js/main.js - /index.html
This commit is contained in:
85
_posts/2025-06-02-optimize.md
Normal file
85
_posts/2025-06-02-optimize.md
Normal file
File diff suppressed because one or more lines are too long
@ -47,6 +47,10 @@ $(function () {
|
|||||||
});
|
});
|
||||||
|
|
||||||
function getSearchJSON(callback) {
|
function getSearchJSON(callback) {
|
||||||
|
if (typeof Storage == 'undefined') {
|
||||||
|
$.getJSON("/search.json", callback);
|
||||||
|
return;
|
||||||
|
}
|
||||||
var searchData = JSON.parse(localStorage.getItem("blog_" + lastUpdated.valueOf()));
|
var searchData = JSON.parse(localStorage.getItem("blog_" + lastUpdated.valueOf()));
|
||||||
if (!searchData) {
|
if (!searchData) {
|
||||||
for (var i = 0; i < localStorage.length; i++) {
|
for (var i = 0; i < localStorage.length; i++) {
|
||||||
|
|||||||
@ -3,7 +3,7 @@ layout: default
|
|||||||
title: 首页 - 我的文章
|
title: 首页 - 我的文章
|
||||||
---
|
---
|
||||||
{% if paginator.page == 1 %}<div class="hslice" id="LatestPost">{% endif %}
|
{% if paginator.page == 1 %}<div class="hslice" id="LatestPost">{% endif %}
|
||||||
<h1 class="entry-title" style="display:inline"> 首页 - 我的文章 </h1><small><a href="/archives.html">Archives</a> <!--[if !IE]> --> | <a href="javascript:getSearchJSON(function(data){window.location = data[Math.floor(Math.random()*data.length)].url})">Random</a> <!-- <![endif]--> </small><br /><br />
|
<h1 class="entry-title" style="display:inline"> 首页 - 我的文章 </h1><small><a href="/archives.html">Archives</a> | <a href="javascript:getSearchJSON(function(data){window.location = data[Math.floor(Math.random()*data.length)].url})">Random</a></small><br /><br />
|
||||||
|
|
||||||
<hr />
|
<hr />
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user