Sorry, your browser cannot access this site
This page requires browser support (enable) JavaScript
Learn more >

理论上适用於所有网站,请自行修改

正文

目录结构

1
2
3
4
5
|--memos
|--memos.html
|--src
|--2024.json
...

代码

1
2
3
<span id="memos"></div>
<script>async function fetchmemos(e){try{const t=await fetch(`/src/${e}.json`);if(!t.ok)throw new Error;const n=await t.json(),r=document.getElementById("memos"),o=Object.entries(n).sort(((e,t)=>new Date(t[0])-new Date(e[0])));for(const[e,t]of o){const n=document.createElement("div");n.className="entry",n.innerHTML=`<strong>${e}:</strong> ${t}`,r.appendChild(n)}}catch(e){return}}const currentYear=(new Date).getFullYear();fetchmemos(currentYear);</script>
<style>#memos {max-width: 600px;margin: 20px auto;padding: 10px;background: #fff;box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);border-radius: 8px;}.entry {border-bottom: 1px solid #ddd;padding: 10px 0;}</style>


Uses Volantis as theme. You can find source in https://github.com/volantis-x/volantis-docs.

萌ICP备20235354号

Feed(Atom)