文章页优化

This commit is contained in:
2026-06-18 14:40:31 +08:00 Unverified
parent 9d6de3158e
commit 39b15b4be9
12 changed files with 1015 additions and 9 deletions
+76 -3
View File
@@ -9,6 +9,7 @@ interface Props {
const siteTitle = "Bi's Blog";
const { title = siteTitle, description = 'Personal blog by biss.' } = Astro.props;
const pageTitle = title === siteTitle ? siteTitle : `${title} | ${siteTitle}`;
const currentYear = new Date().getFullYear();
---
<!doctype html>
@@ -36,9 +37,81 @@ const pageTitle = title === siteTitle ? siteTitle : `${title} | ${siteTitle}`;
<main>
<slot />
</main>
<footer class="site-footer">
<span>© {new Date().getFullYear()} Bi's Blog</span>
<a href="/rss.xml">RSS</a>
<footer class="site-footer" aria-label="站点页脚">
<div class="footer-inner">
<section class="footer-top" aria-label="站点信息">
<a class="footer-brand" href="/" aria-label="Bi's Blog 首页">
<img src="/images/Bi.ico" alt="" loading="lazy" />
<span>Bi's Blog</span>
</a>
<p class="footer-slogan">好奇心转化为代码的空间。</p>
</section>
<section class="footer-contact" aria-label="联系方式">
<p>联系方式</p>
<div class="footer-socials">
<a href="mailto:bishsh2006@gmail.com" aria-label="发送邮件" title="发送邮件">
<svg aria-hidden="true" viewBox="0 0 24 24">
<path d="M4 6h16v12H4z" />
<path d="m4 7 8 6 8-6" />
</svg>
</a>
<a href="/rss.xml" aria-label="订阅 RSS" title="订阅 RSS">
<svg aria-hidden="true" viewBox="0 0 24 24">
<path d="M6 17h.01" />
<path d="M6 7a11 11 0 0 1 11 11" />
<path d="M6 12a6 6 0 0 1 6 6" />
</svg>
</a>
<a href="https://github.com/bishshi" target="_blank" rel="noreferrer" aria-label="GitHub" title="GitHub">
<svg aria-hidden="true" viewBox="0 0 24 24">
<path d="M12 3a9 9 0 0 0-3 17c.5.1.7-.2.7-.5v-1.8c-2.8.6-3.4-1.2-3.4-1.2-.4-1.1-1-1.4-1-1.4-.9-.6.1-.6.1-.6 1 0 1.5 1 1.5 1 .9 1.5 2.3 1.1 2.9.8.1-.6.3-1.1.6-1.3-2.2-.2-4.5-1.1-4.5-4.8 0-1.1.4-1.9 1-2.6-.1-.3-.4-1.3.1-2.6 0 0 .8-.3 2.7 1a9 9 0 0 1 4.9 0c1.8-1.3 2.6-1 2.6-1 .5 1.3.2 2.3.1 2.6.6.7 1 1.6 1 2.6 0 3.7-2.3 4.5-4.5 4.8.4.3.7 1 .7 2v2.5c0 .3.2.6.7.5A9 9 0 0 0 12 3Z" />
</svg>
</a>
</div>
<nav class="footer-contact-links" aria-label="页脚链接">
<a href="/archives/">发展历程</a>
<span aria-hidden="true">|</span>
<a href="/privacy/">隐私政策</a>
</nav>
</section>
<section class="footer-bottom" aria-label="版权信息">
<div>
<p>© 2025 - {currentYear} Bi's Blog</p>
<p>blog.biss.click | 内容采用 CC BY-NC-SA 4.0 协议</p>
</div>
<div class="footer-meta">
<p>本站已苟活:<span id="site-runtime">计算中...</span></p>
<p>
<a href="https://edgeone.ai/" target="_blank" rel="noreferrer">EdgeOne</a>
<span aria-hidden="true">|</span>
<a href="https://astro.build/" target="_blank" rel="noreferrer">ASTRO</a>
</p>
</div>
</section>
</div>
</footer>
<script is:inline>
(() => {
const runtime = document.getElementById('site-runtime');
if (!runtime) return;
const start = new Date('2025-01-01T00:00:00+08:00').getTime();
const pad = (value) => String(value).padStart(2, '0');
function updateRuntime() {
const diff = Math.max(0, Date.now() - start);
const days = Math.floor(diff / 86400000);
const hours = Math.floor((diff / 3600000) % 24);
const minutes = Math.floor((diff / 60000) % 60);
const seconds = Math.floor((diff / 1000) % 60);
runtime.textContent = `${days} 天 ${pad(hours)} 时 ${pad(minutes)} 分 ${pad(seconds)} 秒`;
}
updateRuntime();
window.setInterval(updateRuntime, 1000);
})();
</script>
</body>
</html>