重构打包

This commit is contained in:
2025-08-19 07:01:59 +08:00
parent 14fceea63c
commit 9a0a900d2e
2 changed files with 65 additions and 1 deletions

View File

@@ -2,6 +2,8 @@
<nav>
<a href="#雜談">雜談</a>
<a href="#學習">學習</a>
<a href="#課題">課題</a>
<a href="#gmssh">gmssh</a>
</nav>
@@ -27,7 +29,33 @@
</div>
<div id="課題" class="page">
<div id="body_color">
<h2>課題</h2>
<p>
关于pygame的学习
</p>
</div>
</div>
<div id="gmssh" class="page">
<div id="body_color">
<h2>gmssh</h2>
<li>gmssh官网
<a href="https://www.gmssh.com/">点击跳转</a>
</li>
<p>
关于gmssh的应用构建与学习
</p>
</div>
</div>
<style>
.page h2
{
text-align: center;
}
#body_color
/* 背景颜色 */
{
@@ -68,4 +96,35 @@
}
</style>
<!-- 伪页面跳转 -->
<!-- 伪页面跳转 -->
<script>
function updateTitle() {
let hash = window.location.hash;
// 获取基础的网站标题
const baseTitle = "ww3";
if (hash) {
// 移除哈希值前面的 #
let pageName = hash.substring(1);
// 解码URL
pageName = decodeURIComponent(pageName);
// 动态设置标题:自定义页面标题 | 网站标题
document.title = `${pageName} | ${baseTitle}`;
} else {
// 如果没有哈希值,可以设置一个默认的首页标题
document.title = `首页 | ${baseTitle}`;
}
}
// 1. 页面加载时执行一次
window.addEventListener('load', updateTitle);
// 2. 当URL的哈希值改变时执行
window.addEventListener('hashchange', updateTitle);
</script>