Skip to content

Commit

Permalink
Merge pull request #15 from halo-dev/require-1.3.0
Browse files Browse the repository at this point in the history
Require 1.3.0
  • Loading branch information
ruibaby committed Mar 25, 2020
2 parents 0787a69 + 7e42711 commit f56919b
Show file tree
Hide file tree
Showing 27 changed files with 234 additions and 233 deletions.
44 changes: 33 additions & 11 deletions archives.ftl
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<#include "layout/_layout.ftl">
<#include "layout/_macro/post-collapse.ftl">
<#include "layout/_macro/sidebar.ftl">
<@html title="归档 | ${options.blog_title!'Next'}" keywords="${options.seo_keywords!'Next'}" desc="${options.seo_description!'Next'}" ogtype="website" url="${context!}/archives">page-archive</@html>
<@html title="归档 | ${blog_title!}" ogtype="website" url="${archives_url!}">page-archive</@html>

<@main>
<div id="content" class="content">
Expand All @@ -25,18 +25,40 @@
</#if> 目前共计 ${count} 篇日志。 继续努力。
</@postTag>
</span>
<@postTag method="archiveYear">
<#list archives as archive>
<div class="collection-title">
<<#if settings.seo!false>h2<#else>h1</#if> class="archive-year" id="archive-year-${archive.year?c}">${archive.year?c}</<#if settings.seo!false>h2<#else>h1</#if>>
</div>
<@post_collapase archive.posts></@post_collapase>
</#list>
</@postTag>
</div>
<@postTag method="archiveYear">
<#list archives as archive>
<div class="collection-title">
<<#if settings.seo!false>h2<#else>h1</#if> class="archive-year" id="archive-year-${archive.year?c}">${archive.year?c}</<#if settings.seo!false>h2<#else>h1</#if>>
</div>
<@post_collapase archive.posts></@post_collapase>
</#list>
</@postTag>
</div>
</div>
<#if posts.totalPages gt 1>
<nav class="pagination">
<@paginationTag method="archives" page="${posts.number}" total="${posts.totalPages}" display="3">
<#if pagination.hasPrev>
<a class="extend prev" rel="prev" href="${pagination.prevPageFullPath!}">
<i class="fa fa-angle-left" aria-label="Previous page"></i>
</a>
</#if>
<#list pagination.rainbowPages as number>
<#if number.isCurrent>
<span class="page-number current">${number.page!}</span>
<#else>
<a class="page-number" href="${number.fullPath!}">${number.page!}</a>
</#if>
</#list>
<#if pagination.hasNext>
<a class="extend next" rel="next" href="${pagination.nextPageFullPath!}">
<i class="fa fa-angle-right" aria-label="Next page"></i>
</a>
</#if>
</@paginationTag>
</nav>
</#if>
</div>
<#--<#include "layout/_partials/pagination.ftl">-->
</@main>

<@sidebar>
Expand Down
8 changes: 4 additions & 4 deletions categories.ftl
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<#include "layout/_macro/sidebar.ftl">
<#include "layout/_partials/page-header.ftl">

<@html title="分类 | ${options.blog_title!'Next'}" keywords="${options.seo_keywords!'Next'}" desc="${options.seo_description!'Next'}" ogtype="website" url="${context!}/categories"></@html>
<@html title="分类 | ${blog_title!}" ogtype="website" url="${categories_url!}"></@html>

<@main>
<div id="content" class="content">
Expand All @@ -24,10 +24,10 @@
<ul class="category-list">
<@categoryTag method="list">
<#if categories?? && categories?size gt 0>
<#list categories as cate>
<#list categories as category>
<li class="category-list-item">
<a class="category-list-link" href="${context!}/categories/${cate.slugName}/">${cate.name}</a>
<span class="category-list-count">${cate.postCount!0}</span>
<a class="category-list-link" href="${category.fullPath!}">${category.name}</a>
<span class="category-list-count">${category.postCount!0}</span>
</li>
</#list>
</#if>
Expand Down
48 changes: 22 additions & 26 deletions category.ftl
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<#include "layout/_macro/post-collapse.ftl">
<#include "layout/_macro/sidebar.ftl">

<@html title="分类: ${category.name!} | ${options.blog_title!'Next'}" keywords="${options.seo_keywords!'Next'}" desc="${options.seo_description!'Next'}" ogtype="website" url="${context!}/categories/${category.slugName!}">
<@html title="分类: ${category.name!} | ${blog_title!}" ogtype="website" url="${category.fullPath!}">
</@html>

<@main>
Expand All @@ -19,31 +19,27 @@
</div>
</div>
<#if posts.totalPages gt 1>
<nav class="pagination">
<#if posts.hasPrevious()>
<#if posts.number == 1>
<a class="extend prev" rel="prev" href="${context!}/categories/${category.slugName}">
<i class="fa fa-angle-left" aria-label="Previous page"></i>
</a>
<#else>
<a class="extend prev" rel="prev" href="${context!}/categories/${category.slugName}/page/${posts.number}">
<i class="fa fa-angle-left" aria-label="Previous page"></i>
</a>
</#if>
</#if>
<#list rainbow as r>
<#if r == posts.number+1>
<span class="page-number current">${posts.number+1}</span>
<#else>
<a class="page-number" href="${context!}/categories/${category.slugName}/page/${r}">${r}</a>
</#if>
</#list>
<#if posts.hasNext()>
<a class="extend next" rel="next" href="${context!}/categories/${category.slugName}/page/${posts.number+2}/">
<i class="fa fa-angle-right" aria-label="Next page"></i>
</a>
</#if>
</nav>
<nav class="pagination">
<@paginationTag method="categoryPosts" page="${posts.number}" total="${posts.totalPages}" display="3" slug="${category.slug!}">
<#if pagination.hasPrev>
<a class="extend prev" rel="prev" href="${pagination.prevPageFullPath!}">
<i class="fa fa-angle-left" aria-label="Previous page"></i>
</a>
</#if>
<#list pagination.rainbowPages as number>
<#if number.isCurrent>
<span class="page-number current">${number.page!}</span>
<#else>
<a class="page-number" href="${number.fullPath!}">${number.page!}</a>
</#if>
</#list>
<#if pagination.hasNext>
<a class="extend next" rel="next" href="${pagination.nextPageFullPath!}">
<i class="fa fa-angle-right" aria-label="Next page"></i>
</a>
</#if>
</@paginationTag>
</nav>
</#if>
</div>
</@main>
Expand Down
49 changes: 23 additions & 26 deletions index.ftl
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<#include "layout/_macro/post.ftl">
<#include "layout/_macro/sidebar.ftl">

<@html title="${options.blog_title!'NexT'}" keywords="${options.seo_keywords!'Next'}" desc="${options.seo_description!'Next'}" ogtype="website" url="${context!}"></@html>
<@html title="${blog_title!}" ogtype="website" url="${blog_url!}"></@html>

<@main>
<div id="content" class="content">
Expand All @@ -13,32 +13,29 @@
</#list>
</#if>
</section>

<#if posts.totalPages gt 1>
<nav class="pagination">
<#if posts.hasPrevious()>
<#if posts.number == 1>
<a class="extend prev" rel="prev" href="${context!}/">
<i class="fa fa-angle-left" aria-label="Previous page"></i>
</a>
<#else>
<a class="extend prev" rel="prev" href="${context!}/page/${posts.number}">
<i class="fa fa-angle-left" aria-label="Previous page"></i>
</a>
</#if>
</#if>
<#list rainbow as r>
<#if r == posts.number+1>
<span class="page-number current">${posts.number+1}</span>
<#else>
<a class="page-number" href="${context!}/page/${r}">${r}</a>
</#if>
</#list>
<#if posts.hasNext()>
<a class="extend next" rel="next" href="${context!}/page/${posts.number+2}/">
<i class="fa fa-angle-right" aria-label="Next page"></i>
</a>
</#if>
</nav>
<nav class="pagination">
<@paginationTag method="index" page="${posts.number}" total="${posts.totalPages}" display="3">
<#if pagination.hasPrev>
<a class="extend prev" rel="prev" href="${pagination.prevPageFullPath!}">
<i class="fa fa-angle-left" aria-label="Previous page"></i>
</a>
</#if>
<#list pagination.rainbowPages as number>
<#if number.isCurrent>
<span class="page-number current">${number.page!}</span>
<#else>
<a class="page-number" href="${number.fullPath!}">${number.page!}</a>
</#if>
</#list>
<#if pagination.hasNext>
<a class="extend next" rel="next" href="${pagination.nextPageFullPath!}">
<i class="fa fa-angle-right" aria-label="Next page"></i>
</a>
</#if>
</@paginationTag>
</nav>
</#if>
</div>
</@main>
Expand Down
7 changes: 3 additions & 4 deletions layout/_layout.ftl
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
<#include "/common/macro/common_macro.ftl">
<#macro html title,keywords,desc,ogtype,url>
<#macro html title,ogtype,url>
<!DOCTYPE html>

<html class="theme-next ${(settings.scheme!'Muse')?lower_case} <#if settings.motion_enable!true>use-motion</#if>"
lang="zh-Hans">
<html class="theme-next ${(settings.scheme!'Muse')?lower_case} <#if settings.motion_enable!true>use-motion</#if>" lang="zh-Hans">
<head>
<#include "_partials/head.ftl">
<@head title,keywords,desc,ogtype,url></@head>
<@head title,ogtype,url></@head>
<title>${title}</title>
</head>

Expand Down
4 changes: 2 additions & 2 deletions layout/_macro/post-collapse.ftl
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
<article class="post post-type-normal" itemscope itemtype="http://schema.org/Article">
<header class="post-header">
<<#if settings.seo!false>h2<#else>h1</#if> class="post-title">
<a class="post-title-link" href="${context!}/archives/${post.url}" itemprop="url">
<span itemprop="name">${post.title}</span>
<a class="post-title-link" href="${post.fullPath!}" itemprop="url">
<span itemprop="name">${post.title!}</span>
</a>
</<#if settings.seo!false>h2<#else>h1</#if>>
<div class="post-meta">
Expand Down
2 changes: 1 addition & 1 deletion layout/_macro/post-copyright.ftl
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
</li>
<li class="post-copyright-link">
<strong>本文链接:</strong>
<a href="${context!}/archives/${post.url!}" title="${post.title!}">${context!}/archives/${post.url!}</a>
<a href="${post.fullPath!}" title="${post.title!}">${post.fullPath!}</a>
</li>
<li class="post-copyright-license">
<strong>版权声明:</strong>
Expand Down
42 changes: 19 additions & 23 deletions layout/_macro/post.ftl
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
<#macro post_template post>
<article class="post post-type-normal" itemscope="" itemtype="http://schema.org/Article">
<div class="post-block">
<link itemprop="mainEntityOfPage" href="${context!}/archives/${post.url}">
<link itemprop="mainEntityOfPage" href="${post.fullPath!}">
<span hidden="" itemprop="author" itemscope="" itemtype="http://schema.org/Person">
<meta itemprop="name" content="${user.nickname!}">
<meta itemprop="description" content="${post.summary!}">
<meta itemprop="image" content="${user.avatar!}">
</span>
<span hidden="" itemprop="publisher" itemscope="" itemtype="http://schema.org/Organization">
<meta itemprop="name" content="${options.blog_title!}">
<meta itemprop="name" content="${blog_title!}">
</span>
<header class="post-header">
<<#if settings.seo!false>h2<#else>h1</#if> class="post-title" itemprop="name headline">
<a class="post-title-link" href="${context!}/archives/${post.url}" itemprop="url">${post.title}</a>
<a class="post-title-link" href="${post.fullPath!}" itemprop="url">${post.title!}</a>
</<#if settings.seo!false>h2<#else>h1</#if>>
<div class="post-meta">
<span class="post-time">
Expand All @@ -32,7 +32,7 @@
</span>
<span class="post-meta-item-text">分类于</span>
<span itemprop="about" itemscope="" itemtype="http://schema.org/Thing">
<a href="${context!}/categories/${post.categories[0].slugName}/" itemprop="url" rel="index">
<a href="${post.categories[0].fullPath!}" itemprop="url" rel="index">
<span itemprop="name">${post.categories[0].name}</span>
</a>
</span>
Expand All @@ -43,16 +43,12 @@
<span class="post-meta-item-icon">
<i class="fa fa-comment-o"></i>
</span>
<a href="${context!}/archives/${post.url}#comments" itemprop="discussionUrl">
<span class="valine-comment-count" data-xid="${context!}/archives/${post.url}/" itemprop="commentsCount">
<#if is_index??>
${post.commentCount!0}
<#elseif is_post?? || is_sheet?? >
${comments.getTotalElements()!0}
</#if>
<a href="${post.fullPath!}#comments" itemprop="discussionUrl">
<span class="valine-comment-count" data-xid="${post.fullPath!}" itemprop="commentsCount">
${post.commentCount!0}
</span>
</a>
<span id="${context!}/archives/${post.url}/" class="leancloud_visitors" data-flag-title="${post.title}">
<span id="${post.fullPath!}" class="leancloud_visitors" data-flag-title="${post.title!}">
<span class="post-meta-divider">|</span>
<span class="post-meta-item-icon">
<i class="fa fa-eye"></i>
Expand All @@ -68,13 +64,13 @@
${post.summary}
<!--noindex-->
<div class="post-button text-center">
<a class="btn" href="${context!}/archives/${post.url}/" rel="contents">
<a class="btn" href="${post.fullPath!}" rel="contents">
阅读全文 »
</a>
</div>
<!--/noindex-->
<#else>
${post.formatContent}
${post.formatContent!}
</#if>
</div>
<#if (settings.wechat_subscriber_enable!false) && (!is_index??) && (!is_search??)>
Expand All @@ -97,29 +93,29 @@
<#if (!is_index??) && (!is_search??)>
<#if tags?size gt 0>
<#list tags as tag>
<a href="${context!}/tags/${tag.slugName}" rel="tag"># ${tag.name}</a>
<a href="${tag.fullPath!}" rel="tag"># ${tag.name}</a>
</#list>
</#if>
</#if>
</div>
<#if (nextPost?? || prePost??) && (!is_index??) && (!is_search??)>
<#if (nextPost?? || prevPost??) && (!is_index??) && (!is_search??)>
<div class="post-nav">

<div class="post-nav-next post-nav-item">
<#if nextPost??>
<a href="${context!}/archives/${nextPost.url}" rel="next" title="${nextPost.title}">
<i class="fa fa-chevron-left"></i> ${nextPost.title}
</a>
<a href="${nextPost.fullPath!}" rel="next" title="${nextPost.title}">
<i class="fa fa-chevron-left"></i> ${nextPost.title}
</a>
</#if>
</div>

<span class="post-nav-divider"></span>

<div class="post-nav-prev post-nav-item">
<#if prePost??>
<a href="${context!}/archives/${prePost.url}" rel="prev" title="${prePost.title}">
${prePost.title} <i class="fa fa-chevron-right"></i>
</a>
<#if prevPost??>
<a href="${prevPost.fullPath!}" rel="prev" title="${prevPost.title}">
${prevPost.title} <i class="fa fa-chevron-right"></i>
</a>
</#if>
</div>
</div>
Expand Down
Loading

0 comments on commit f56919b

Please sign in to comment.