Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[_partial/archive.ejs]├── archive.ejs //文章归档,包括单个分类与单个标签,调用 _partial/…
…archive.ejs ├── categories.ejs //显示所有分类的布局, ├── category.ejs //单个分类显示的布局,调用 _partial/archive.ejs ├── tags.ejs //显示所有显示的布局,调用 _partial/archive.ejs, 调用_partial/tags.ejs
- Loading branch information
1 parent
5005553
commit 2183339
Showing
5 changed files
with
83 additions
and
132 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 |
---|---|---|
@@ -1,44 +1,45 @@ | ||
<div class="container"> | ||
<div class="row"> | ||
<div class="col-lg-8 col-lg-offset-2 col-md-10 col-md-offset-1"> | ||
<% | ||
var title = ''; | ||
if (page.category) title = page.category; | ||
if (page.tag) title = page.tag; | ||
if (page.archive) { | ||
if (page.year) title = page.year + (page.month ? '/' + page.month : ''); | ||
else title = __('archive_a'); | ||
} | ||
%> | ||
<h2 class="archive-title<% if (page.tag){ %> tag<% } else if (page.category){ %> category<% } %>"><%= title %></h2> | ||
<% if (pagination == 2){ %> | ||
<% page.posts.each(function(item){ %> | ||
<%- partial('article', {item: item, index: true}) %> | ||
<% }); %> | ||
<%- partial('pagination') %> | ||
<% } else { %> | ||
<% var this_year; %> | ||
<article class="archive"> | ||
<% page.posts.each(function(item){ %> | ||
<% var year = item.date.year(); %> | ||
<% if (this_year != year || !this_year){ %> | ||
<% if(this_year){ %> | ||
</div></ul> | ||
<% } %> | ||
<div class="archive-itme"><div id="<%= year %>" class="archive-year"><%= year %></div> | ||
<ul> | ||
<% this_year = year; } %> | ||
<li> | ||
<time datetime="<%= item.date.toDate().toISOString() %>"><%= item.date.format("MM-DD") %></time> | ||
<a href="<%- config.root %><%- item.path %>"><%= item.title %></a> | ||
</li> | ||
<% }); %> | ||
</article> | ||
<% } %> | ||
<div class="row"> | ||
<div class="col-lg-8 col-lg-offset-2 col-md-10 col-md-offset-1"> | ||
<% | ||
var title = ''; | ||
if (page.category) title = page.category; | ||
if (page.tag) title = page.tag; | ||
if (page.archive) { | ||
if (page.year) title = page.year + (page.month ? '/' + page.month : ''); | ||
else title = __('archive_a'); | ||
} | ||
%> | ||
<h2 class="archive-title<% if (page.tag){ %> tag<% } else if (page.category){ %> category<% } %>"> | ||
<%= title %> | ||
</h2> | ||
<% if (type == 'tags'){ %> | ||
<%- partial('tags') %> | ||
<% } else { %> | ||
<% var this_year; %> | ||
<article class="archive"> | ||
<% site.posts.each(function(item){ %> | ||
<% var year = item.date.year(); %> | ||
<% if (this_year != year || !this_year){ %> | ||
<% if(this_year){ %> | ||
</div></ul> | ||
<% } %> | ||
<div class="archive-time"> | ||
<span id="<%= year %>" class="archive-year fa fa-calendar-times-o listing-seperator"> | ||
<%= year %></span> | ||
<ul> | ||
<% this_year = year; } %> | ||
<li> | ||
<time datetime="<%= item.date.toDate().toISOString() %>"> | ||
<%= item.date.format("MM-DD") %> | ||
</time> | ||
<i class="fa fa-angle-double-right" aria-hidden="true"></i> | ||
<a href="<%- config.root %><%- item.path %>"> | ||
<%= item.title %></a> | ||
</li> | ||
<% }); %> | ||
</article> | ||
<% } %> | ||
</div> | ||
</div> | ||
</div> | ||
</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 @@ | ||
<!-- 标签云 --> | ||
<div id='tag_cloud' class="tags"> | ||
<% site.tags.map(function(tag){ %> | ||
<a href="#<%= tag.name %>" title="<%= tag.name %>" rel="<%= tag.length %>"><%= tag.name %></a> | ||
<% }) %> | ||
</div> | ||
|
||
<!-- 标签列表 --> | ||
|
||
<% site.tags.map(function(tag){ %> | ||
<div class="one-tag-list"> | ||
<span class="fa fa-tag listing-seperator" id="<%= tag.name %>"> | ||
<span class="tag-text"><%= tag.name %></span> | ||
</span> | ||
<% tag.posts.map(function(post){ %> | ||
<!-- <li class="listing-item"> | ||
<time datetime="{{ post.date | date:"%Y-%m-%d" }}">{{ post.date | date:"%Y-%m-%d" }}</time> | ||
<a href="{{ post.url }}" title="{{ post.title }}">{{ post.title }}</a> | ||
</li> --> | ||
<div class="post-preview"> | ||
<a href="<%- config.root %><%- post.path %>"> | ||
<h2 class="post-title"> | ||
<%- post.title || "Untitled" %> | ||
</h2> | ||
<% if (post.subtitle && post.subtitle.length) { %> | ||
<h3 class="post-subtitle"> | ||
<%- post.subtitle %> | ||
</h3> | ||
<% } %> | ||
</a> | ||
<!-- <p class="post-meta">{{ post.date | date:"%Y-%m-%d" }}</p> --> | ||
</div> | ||
<hr> | ||
<% }) %> | ||
</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
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 |
---|---|---|
@@ -1,4 +1,5 @@ | ||
--- | ||
layout: page | ||
--- | ||
<%- partial('_partial/archive', {pagination: config.category}) %> | ||
<%- partial('_partial/archive', {type: 'category'}) %> | ||
|
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 |
---|---|---|
@@ -1,48 +1,5 @@ | ||
--- | ||
layout: layout | ||
--- | ||
<!-- Main Content --> | ||
<div class="container"> | ||
<div class="row"> | ||
<div class="col-lg-8 col-lg-offset-2 col-md-10 col-md-offset-1"> | ||
<!-- 标签云 --> | ||
<div id='tag_cloud' class="tags"> | ||
<% site.tags.map(function(tag){ %> | ||
<a href="#<%= tag.name %>" title="<%= tag.name %>" rel="<%= tag.length %>"><%= tag.name %></a> | ||
<% }) %> | ||
</div> | ||
<%- partial('_partial/archive', {type: 'tags'}) %> | ||
|
||
<!-- 标签列表 --> | ||
|
||
<% site.tags.map(function(tag){ %> | ||
<div class="one-tag-list"> | ||
<span class="fa fa-tag listing-seperator" id="<%= tag.name %>"> | ||
<span class="tag-text"><%= tag.name %></span> | ||
</span> | ||
<% tag.posts.map(function(post){ %> | ||
<!-- <li class="listing-item"> | ||
<time datetime="{{ post.date | date:"%Y-%m-%d" }}">{{ post.date | date:"%Y-%m-%d" }}</time> | ||
<a href="{{ post.url }}" title="{{ post.title }}">{{ post.title }}</a> | ||
</li> --> | ||
<div class="post-preview"> | ||
<a href="<%- config.root %><%- post.path %>"> | ||
<h2 class="post-title"> | ||
<%- post.title || "Untitled" %> | ||
</h2> | ||
<% if (post.subtitle && post.subtitle.length) { %> | ||
<h3 class="post-subtitle"> | ||
<%- post.subtitle %> | ||
</h3> | ||
<% } %> | ||
</a> | ||
<!-- <p class="post-meta">{{ post.date | date:"%Y-%m-%d" }}</p> --> | ||
</div> | ||
<hr> | ||
<% }) %> | ||
</div> | ||
<% }) %> | ||
|
||
|
||
</div> | ||
</div> | ||
</div> |