feat: 页面模板差异化改进 + 配置优化 + 兼容清理 (#29)
- 首页判定:navigation 第一项 - 模板:page/projects/articles/bookmarks/search-results - bookmarks:update: YYYY-MM-DD | from: git|mtime - articles:RSS 聚合只读条目 + 分类聚合 + 影子写回结构 - projects:repo 卡片 + 可选热力图 + 自动抓取元信息 - 工作流:构建前 sync + schedule 定时刷新 - 移除兼容:config.yml/config.yaml、navigation.yml、home 特例 - 迁移说明:config/update-instructions.md
This commit is contained in:
@@ -1,14 +1,66 @@
|
||||
{{#ifEquals pageId @root.homePageId}}
|
||||
<div class="welcome-section">
|
||||
<h2 data-editable="profile-title">{{title}}</h2>
|
||||
<h3 data-editable="profile-subtitle">{{subtitle}}</h3>
|
||||
{{!-- articles.hbs - 文章页面:恢复分类展示;Phase 2 优先展示文章条目(只读) --}}
|
||||
<div class="page-template page-template-articles">
|
||||
{{> page-header}}
|
||||
|
||||
{{#if articlesItems.length}}
|
||||
{{!-- Phase 2:按配置分类聚合展示文章条目(只读),保持与页面分类结构一致 --}}
|
||||
{{#if articlesCategories.length}}
|
||||
{{#each articlesCategories}}
|
||||
<section class="category category-level-1 category-readonly">
|
||||
<div class="category-header" data-toggle="category">
|
||||
<h2>
|
||||
<i class="{{#if icon}}{{icon}}{{else}}fas fa-rss{{/if}}"></i>
|
||||
{{name}}
|
||||
<span class="toggle-icon">
|
||||
<i class="fas fa-chevron-down"></i>
|
||||
</span>
|
||||
</h2>
|
||||
</div>
|
||||
<div class="category-content">
|
||||
{{#if items.length}}
|
||||
<div class="sites-grid">
|
||||
{{#each items}}
|
||||
{{> site-card type="article" style=@root.siteCardStyle}}
|
||||
{{/each}}
|
||||
</div>
|
||||
{{else}}
|
||||
<p class="empty-content">暂无文章</p>
|
||||
{{/if}}
|
||||
</div>
|
||||
</section>
|
||||
{{/each}}
|
||||
{{else}}
|
||||
{{!-- 兜底:无分类映射时展示为单一“最新文章”列表 --}}
|
||||
<section class="category category-level-1 category-readonly">
|
||||
<div class="category-header" data-toggle="category">
|
||||
<h2>
|
||||
<i class="fas fa-rss"></i>
|
||||
最新文章
|
||||
<span class="toggle-icon">
|
||||
<i class="fas fa-chevron-down"></i>
|
||||
</span>
|
||||
</h2>
|
||||
</div>
|
||||
<div class="category-content">
|
||||
<div class="sites-grid">
|
||||
{{#each articlesItems}}
|
||||
{{> site-card type="article" style=@root.siteCardStyle}}
|
||||
{{/each}}
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
{{/if}}
|
||||
|
||||
{{!-- 保留扩展可写回结构(隐藏),避免文章条目影响 DOM → IR → YAML --}}
|
||||
<div class="menav-extension-shadow" data-extension-shadow="true" data-search-exclude="true" aria-hidden="true">
|
||||
{{#each categories}}
|
||||
{{> category}}
|
||||
{{/each}}
|
||||
</div>
|
||||
{{else}}
|
||||
{{!-- Phase 1:来源站点入口(可写回) --}}
|
||||
{{#each categories}}
|
||||
{{> category}}
|
||||
{{/each}}
|
||||
{{/if}}
|
||||
</div>
|
||||
{{else}}
|
||||
<div class="welcome-section">
|
||||
<h2 data-editable="page-title">{{title}}</h2>
|
||||
<p class="subtitle" data-editable="page-subtitle">{{subtitle}}</p>
|
||||
</div>
|
||||
{{/ifEquals}}
|
||||
{{#each categories}}
|
||||
{{> category}}
|
||||
{{/each}}
|
||||
|
||||
Reference in New Issue
Block a user