-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
70 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
--- | ||
title: 博客 | ||
ksio_slot_banner: _ksio/pages/posts/banner | ||
ksio_slot_content: _ksio/pages/posts/content | ||
ksio_slot_footer: _ksio/pages/posts/footer | ||
ksio_asset_css: | ||
- stylesheets/pages/posts | ||
--- |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
<% const banner_url = url_for('images/ksio/banners/blog.jpg') %> | ||
<div class="Page-banner is-translucent hidden-xs" style="background-image: url('<%= banner_url %>');"> | ||
<figure class="sr-only"> | ||
<img src="<%= banner_url %>" alt="博客文章"> | ||
<figcaption>博客文章</figcaption> | ||
</figure> | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
<% const posts = site.posts.data || site.posts %> | ||
<% if (posts.length > 0) { %> | ||
<% const first_post = posts[0] %> | ||
<% const author = first_post.author || config.author %> | ||
<!-- 最新文章 --> | ||
<p>最近的一篇文章发表于 <time datetime="<%= date_xml(first_post.date) %>" class="u-bold"><%= date(first_post.date, 'YYYY 年 M 月 D 日') %></time>——</p> | ||
<blockquote> | ||
<p><%= truncate(escape_html(trim(strip_html(markdown(first_post.content)))), 100) %></p> | ||
<footer><%= author.name || author %></footer> | ||
</blockquote> | ||
<p>想看完整内容?快戳《<a href="<%= config.root || '/' %><%= first_post.path %>"><%= first_post.title %></a>》!(((o(*゚▽゚*)o)))</p> | ||
<% if (site.categories.length > 0) { %> | ||
<!-- 主打分类 --> | ||
<p>本站主打三类文章,以下为快速通道:</p> | ||
<nav class="MainCategories LightBox"> | ||
<ul></ul> | ||
</nav> | ||
<% } %> | ||
<!-- 文章列表 --> | ||
<div class="ArticleList"> | ||
<% const current_year = date(Date.now(), 'YYYY') %> | ||
<% const year_duration = 10 %> | ||
<% let prev_post = null %> | ||
<% posts.forEach(post => { %> | ||
<% const prev_year = prev_post ? date(prev_post.date, 'YYYY') : '' %> | ||
<% const year = date(post.date, 'YYYY') %> | ||
<% if (current_year - year < year_duration) { %> | ||
<% if (prev_post === null || year !== prev_year) { %> | ||
<h2 class="ArticleList-heading"><%= year %></h2> | ||
<% } %> | ||
<div class="ArticleList-item"><time datetime="<%= date_xml(post.date) %>"><%= date(post.date, 'YYYY-MM-DD') %></time><i class="fa fa-pencil"></i><a href="<%= config.root || '/' %><%= post.path %>"><%= post.title %></a></div> | ||
<% } %> | ||
<% }) %> | ||
</div> | ||
<% } else {%> | ||
<p>暂无文章</p> | ||
<% } %> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
<% if (site.posts.length > 0 && site.categories.length > 0) { %> | ||
<aside class="Widget Widget--hotCategories"> | ||
<div class="Widget-body"> | ||
<p>文章类别<a href="/categories/{{ c }}/">{{ categories[c].name }}</a>下有<span>{{ cat[1].size }}</span>篇文章,其他热门类别有</p> | ||
<ul> | ||
</ul> | ||
</div> | ||
</aside> | ||
<% } %> | ||
<%- partial('_ksio/widgets/share') %> | ||
<%- partial('_ksio/widgets/toc') %> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
@import "../ksio/pages/posts"; |