feat: 调整页面顶部区域&重构项目页热力图&优化markdown内容页

This commit is contained in:
rbetree
2026-01-20 19:20:34 +08:00
parent 280d376bac
commit 1625f7342c
14 changed files with 807 additions and 92 deletions

View File

@@ -0,0 +1,40 @@
<section class="category category-level-1 gh-heatmap-category" data-type="heatmap">
<div class="category-header">
<div class="gh-heatmap-header">
<h2>
<i class="fab fa-github"></i>
<span class="gh-text-desktop">GitHub Contributions</span>
<span class="gh-text-mobile">Contributions</span>
<span class="gh-heatmap-username">@{{username}}</span>
</h2>
<div class="gh-legend" aria-hidden="true">
<span>
<span class="gh-text-desktop">Less</span>
<span class="gh-text-mobile">L</span>
</span>
<div class="gh-legend-item level-0"></div>
<div class="gh-legend-item level-1"></div>
<div class="gh-legend-item level-2"></div>
<div class="gh-legend-item level-3"></div>
<div class="gh-legend-item level-4"></div>
<span>
<span class="gh-text-desktop">More</span>
<span class="gh-text-mobile">M</span>
</span>
</div>
</div>
</div>
<div class="category-content">
<div class="gh-heatmap-wrapper">
<div class="calendar gh-calendar" data-github-username="{{username}}" id="github-calendar-{{username}}">
{{#if html}}
{{{html}}}
{{else}}
Loading data...
{{/if}}
</div>
</div>
</div>
</section>

View File

@@ -1,5 +1,5 @@
{{!-- page-header.hbs - 统一页面标题区(可选显示书签页内容更新时间) --}}
<div class="welcome-section{{#ifCond projectsMeta '&&' projectsMeta.heatmap}} welcome-section-with-side{{/ifCond}}">
<div class="welcome-section">
<div class="welcome-section-main">
{{#ifEquals pageId @root.homePageId}}
<h2 data-editable="profile-title">{{title}}</h2>
@@ -19,18 +19,5 @@
{{/ifEquals}}
</div>
{{#if projectsMeta}}
{{#if projectsMeta.heatmap}}
<div class="welcome-section-side">
<div class="heatmap-container" title="我的 GitHub 贡献热力图">
<a href="{{safeUrl projectsMeta.heatmap.profileUrl}}" target="_blank" rel="noopener">
<img class="heatmap-img"
src="{{projectsMeta.heatmap.imageUrl}}"
alt="Github Chart"
loading="lazy" />
</a>
</div>
</div>
{{/if}}
{{/if}}
</div>

View File

@@ -53,7 +53,9 @@
})();
</script>
<link rel="stylesheet" href="style.css">
{{!-- github-calendar 已迁移为构建期抓取并注入(避免 runtime 依赖 unpkg + 代理服务) --}}
<link rel="preconnect" href="https://cdnjs.cloudflare.com" crossorigin>
<link rel="preload" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.7.2/css/all.min.css" as="style" onload="this.onload=null;this.rel='stylesheet'">
<noscript><link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.7.2/css/all.min.css"></noscript>
</head>
@@ -215,6 +217,7 @@
{{{configJSON}}}
</script>
<script src="pinyin-match.js"></script>
{{!-- github-calendar 已迁移为构建期抓取并注入(避免 runtime 依赖 unpkg + 代理服务) --}}
<script src="script.js"></script>
</body>
</html>

View File

@@ -2,7 +2,9 @@
<div class="page-template page-template-{{pageId}} page-template-content">
{{> page-header}}
<article class="content-page" data-content-file="{{contentFile}}">
{{{contentHtml}}}
</article>
<div class="category content-category">
<article class="content-page" data-content-file="{{contentFile}}">
{{{contentHtml}}}
</article>
</div>
</div>

View File

@@ -2,6 +2,12 @@
<div class="page-template page-template-projects">
{{> page-header}}
{{#if projectsMeta}}
{{#if projectsMeta.heatmap}}
{{> github-heatmap username=projectsMeta.heatmap.username html=projectsMeta.heatmap.html}}
{{/if}}
{{/if}}
{{#each categories}}
{{> category}}
{{/each}}