Skip to content

Commit

Permalink
Merge pull request #3 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 authored Mar 25, 2020
2 parents ecb89fe + e03fd09 commit 03bf8e0
Show file tree
Hide file tree
Showing 18 changed files with 98 additions and 89 deletions.
14 changes: 8 additions & 6 deletions archives.ftl
Original file line number Diff line number Diff line change
@@ -1,15 +1,14 @@
<#include "layout/_include/head.ftl">
<@head title="归档 - ${options.blog_title!}" keywords="${options.seo_keywords!}" description="${options.seo_description!}"></@head>
<@head title="归档 - ${blog_title!}"></@head>
<#include "layout/_include/container_head.ftl">
<#include "layout/_include/single_column_head.ftl">
<#include "layout/_include/side_nav.ftl">
<#include "layout/_include/extra_nav.ftl">
<@extra_nav true '${context!}/archives/'/>
<@extra_nav true '${archives_url!}/'/>
<div ref="streamContainer" class="stream-container">
<div class="post-list-container post-list-container-shadow">

<#list posts.content as post>
<a href="${context!}/archives/${post.url!}" class="a-block">
<a href="${post.fullPath!}" class="a-block">
<div class="post-item-wrapper">
<div class="post-item post-item-no-gaps">
<div class="post-item-info-wrapper">
Expand All @@ -25,8 +24,11 @@
</a>
</#list>
</div>
<#include "layout/_include/pagination.ftl">
<@pagination url="${context!}/archives/"></@pagination>
<#if posts?? && posts.totalPages gt 1>
<@paginationTag method="archives" page="${posts.number}" total="${posts.totalPages}" display="3">
<#include "layout/_include/pagination.ftl">
</@paginationTag>
</#if>

<#include "layout/_include/single_column_footer.ftl">
</div>
Expand Down
4 changes: 2 additions & 2 deletions categories.ftl
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<#include "layout/_include/head.ftl">
<@head title="分类 - ${options.blog_title!}" keywords="${options.seo_keywords!}" description="${options.seo_description!}"></@head>
<@head title="分类 - ${blog_title!}"></@head>
<#include "layout/_include/container_head.ftl">
<#include "layout/_include/single_column_head.ftl">
<#include "layout/_include/side_nav.ftl">
Expand All @@ -20,7 +20,7 @@
</a>
<@categoryTag method="list">
<#list categories as category>
<a href="${context!}/categories/${category.slugName!}" class="a-block">
<a href="${category.fullPath!}" class="a-block">
<div class="post-item-wrapper">
<div class="post-item post-item-no-gaps">
<div class="post-item-info-wrapper">
Expand Down
15 changes: 9 additions & 6 deletions category.ftl
Original file line number Diff line number Diff line change
@@ -1,23 +1,23 @@
<#include "layout/_include/head.ftl">
<@head title="分类: ${category.name} - ${options.blog_title!}" keywords="${options.seo_keywords!}" description="${options.seo_description!}"></@head>
<@head title="分类: ${category.name} - ${blog_title!}"></@head>
<#include "layout/_include/container_head.ftl">
<#include "layout/_include/single_column_head.ftl">
<#include "layout/_include/side_nav.ftl">
<#include "layout/_include/extra_nav.ftl">
<@extra_nav true '${context!}/categories/${category.slugName}/'/>
<@extra_nav true '${category.fullPath!}/'/>
<div ref="streamContainer" class="stream-container">
<div class="post-list-container post-list-container-shadow">
<div class="post-item-wrapper post-item-wrapper-no-hover">
<div class="post-item post-item-no-gaps">
<div class="post-item-info-wrapper">
<div class="post-item-title post-item-title-small">
<a href="${context!}/categories">分类</a> / ${category.name!}
<a href="${categories_url!}">分类</a> / ${category.name!}
</div>
</div>
</div>
</div>
<#list posts.content as post>
<a href="${context!}/archives/${post.url!}" class="a-block">
<a href="${post.fullPath!}" class="a-block">
<div class="post-item-wrapper">
<div class="post-item post-item-no-gaps">
<div class="post-item-info-wrapper">
Expand All @@ -32,8 +32,11 @@
</div>
</a>
</#list>
<#include "layout/_include/pagination.ftl">
<@pagination url="${context!}/categories/${category.slugName}/"></@pagination>
<#if posts?? && posts.totalPages gt 1>
<@paginationTag method="categoryPosts" page="${posts.number}" total="${posts.totalPages}" display="3" slug="${category.slug}">
<#include "layout/_include/pagination.ftl">
</@paginationTag>
</#if>
</div>
<#include "layout/_include/single_column_footer.ftl">
</div>
Expand Down
13 changes: 8 additions & 5 deletions index.ftl
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
<#include "layout/_include/head.ftl">
<@head title="${options.blog_title!}" keywords="${options.seo_keywords!}" description="${options.seo_description!}" />
<@head title="${blog_title!}"/>
<#include "layout/_include/container_head.ftl">
<#include "layout/_include/single_column_head.ftl">
<#include "layout/_include/side_nav.ftl">
<#include "layout/_include/extra_nav.ftl">
<@extra_nav true '${context!}/'/>
<@extra_nav true '${context!}'/>
<div ref="streamContainer" class="stream-container">
<div class="post-list-container post-list-container-no-background">
<#list posts.content as post>
<a href="${context!}/archives/${post.url!}" class="a-block">
<a href="${post.fullPath!}" class="a-block">
<div class="post-item-wrapper">
<div class="post-item post-item-no-divider">
<div class="post-item-info-wrapper">
Expand All @@ -31,8 +31,11 @@
</div>
</a>
</#list>
<#include "layout/_include/pagination.ftl">
<@pagination url="${context!}/"></@pagination>
<#if posts?? && posts.totalPages gt 1>
<@paginationTag method="index" page="${posts.number}" total="${posts.totalPages}" display="3">
<#include "layout/_include/pagination.ftl">
</@paginationTag>
</#if>
</div>
<#include "layout/_include/single_column_footer.ftl">
</div>
Expand Down
2 changes: 1 addition & 1 deletion journals.ftl
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<#include "layout/_include/head.ftl">
<@head title="Journals - ${options.blog_title!}" keywords="${options.seo_keywords!}" description="${options.seo_description!}"></@head>
<@head title="Journals - ${blog_title!}"></@head>
<#include "layout/_include/container_head.ftl">
<#include "layout/_include/single_column_head.ftl">
<#include "layout/_include/side_nav.ftl">
Expand Down
4 changes: 2 additions & 2 deletions layout/_include/body_includes.ftl
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@
integrity="sha256-chlNFSVx3TdcQ2Xlw7SvnbLAavAQLO0Y/LBiWX04viY=" crossorigin="anonymous"></script>
<script src="//cdn.jsdelivr.net/npm/[email protected]/dist/smooth-scroll.polyfills.min.js"
integrity="sha256-CI4Gq5E0io1Pv0xM3qPM+NUIOhbIBvC3GiN1Y4KhXpw=" crossorigin="anonymous"></script>
<script src="${static!}/source/js/journal.js"></script>
<script src="${theme_base!}/source/js/journal.js"></script>

<!-- Import prettify js -->
<#if settings.prettify_enable!false>
<#if is_post?? || is_sheet??>
<script src="${static!}/source/js/prettify.min.js"></script>
<script src="${theme_base!}/source/js/prettify.min.js"></script>
<script>
$(function() {
$('pre').addClass('prettyprint linenums').attr('style', 'overflow:auto;');
Expand Down
18 changes: 9 additions & 9 deletions layout/_include/head.ftl
Original file line number Diff line number Diff line change
@@ -1,35 +1,35 @@
<#macro head title,keywords,description>
<#macro head title>
<!DOCTYPE html>
<html lang="zh" xmlns:v-bind="http://www.w3.org/1999/xhtml">
<head>
<title>${title!}</title>
<meta charset="utf-8">
<meta name="X-UA-Compatible" content="IE=edge">
<meta name="author" content="${user.nickname!}">
<meta name="description" content="${description!}">
<meta name="keywords" content="${keywords!}">
<link rel="alternate" type="application/atom+xml" title="ATOM 1.0" href="${context!}/atom.xml">
<meta name="description" content="${meta_description!}">
<meta name="keywords" content="${meta_keywords!}">
<link rel="alternate" type="application/atom+xml" title="ATOM 1.0" href="${atom_url!}">
<meta charset="utf-8">
<meta name="X-UA-Compatible" content="IE=edge">
<meta content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0" name="viewport">
<meta content="telephone=no" name="format-detection">
<meta name="renderer" content="webkit">
<meta name="theme-color" content="#ffffff">
<link rel="stylesheet" href="//cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" integrity="sha256-eSi1q2PG6J7g7ib17yAaWMcrr5GrtohYChqibrV7PBE=" crossorigin="anonymous">
<link rel="stylesheet" href="${static!}/source/css/journal.min.css">
<link rel="stylesheet" href="${theme_base!}/source/css/journal.min.css">
<@global.head />
<script src="${static!}/source/js/loadCSS.js"></script>
<script src="${theme_base!}/source/js/loadCSS.js"></script>

<!-- Import prettify css -->
<#if settings.prettify_enable!false>
<#if is_post?? || is_sheet??>
<link rel="stylesheet" href="${static!}/source/css/prettify.min.css">
<link rel="stylesheet" href="${static!}/source/css/prettify/${settings.prettify_theme!}.min.css">
<link rel="stylesheet" href="${theme_base!}/source/css/prettify.min.css">
<link rel="stylesheet" href="${theme_base!}/source/css/prettify/${settings.prettify_theme!}.min.css">
</#if>
</#if>

<script>
loadCSS("https://fonts.googleapis.com/css?family=Lora|Montserrat|Fira+Mono|Material+Icons");
loadCSS("https://fonts.loli.net/css?family=Lora|Montserrat|Fira+Mono|Material+Icons");
<#-- (function (d) {
var config = {
kitId: 'dwg1tuc',
Expand Down
57 changes: 27 additions & 30 deletions layout/_include/pagination.ftl
Original file line number Diff line number Diff line change
@@ -1,31 +1,28 @@
<#macro pagination url="">
<#if posts?? && posts.totalPages gt 1>
<div class="pagination <#if is_index??>index-page</#if>">
<#if posts.hasPrevious()>
<#if posts.number == 1>
<a class="pagination-action" href="${url}" style="opacity: 1">
<#else>
<a class="pagination-action" href="${url}page/${posts.number}" style="opacity: 1">
</#if>
<#else>
<a class="pagination-action" style="opacity: 0">
</#if>
<i class="material-icons pagination-action-icon">
chevron_left
</i>
</a>
<div class="pagination-indicator">
<span>${posts.number+1}/${posts.totalPages!}</span>
</div>
<#if posts.hasNext()>
<a class="pagination-action" href="${url}page/${posts.number+2}" style="opacity: 1">
<#else>
<a class="pagination-action" style="opacity: 0">
</#if>
<i class="material-icons pagination-action-icon">
chevron_right
</i>
</a>
</div>

<div class="pagination <#if is_index??>index-page</#if>">
<#if pagination.hasPrev>
<a class="pagination-action" href="${pagination.prevPageFullPath!}" style="opacity: 1">
<#else>
<a class="pagination-action" style="opacity: 0">
</#if>
</#macro>
<i class="material-icons pagination-action-icon">
chevron_left
</i>
</a>
<div class="pagination-indicator">
<#list pagination.rainbowPages as number>
<#if number.isCurrent>
<span>${number.page!}/${posts.totalPages!}</span>
</#if>
</#list>
</div>
<#if pagination.hasNext>
<a class="pagination-action" href="${pagination.nextPageFullPath!}" style="opacity: 1">
<#else>
<a class="pagination-action" style="opacity: 0">
</#if>
<i class="material-icons pagination-action-icon">
chevron_right
</i>
</a>
</div>
8 changes: 4 additions & 4 deletions layout/_include/post_pagination.ftl
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
<nav class="post-pagination">
<#if prePost??>
<a class="newer-posts" href="${context!}/archives/${prePost.url}">
上一篇<br>${prePost.title}
<#if prevPost??>
<a class="newer-posts" href="${prevPost.fullPath!}">
上一篇<br>${prevPost.title}
</a>
</#if>
<span class="page-number"></span>
<#if nextPost??>
<a class="older-posts" href="${context!}/archives/${nextPost.url}">
<a class="older-posts" href="${nextPost.fullPath!}">
下一篇<br>${nextPost.title}
</a>
</#if>
Expand Down
8 changes: 4 additions & 4 deletions layout/_include/side_nav.ftl
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<div ref="sideContainer" class="side-container">
<a class="a-block nav-head <#if is_index??>active</#if>" href="${context!}">
<a class="a-block nav-head <#if is_index??>active</#if>" href="${blog_url!}">
<div class="nav-title">
${(settings.sidebar_title?? && settings.sidebar_title!='')?string('${settings.sidebar_title!}','${options.blog_title!}')}
${(settings.sidebar_title?? && settings.sidebar_title!='')?string('${settings.sidebar_title!}','${blog_title!}')}
</div>
<div class="nav-subtitle">
${(settings.sidebar_subtitle?? && settings.sidebar_subtitle!='')?string('${settings.sidebar_subtitle!}','')}
Expand All @@ -19,7 +19,7 @@
</@menuTag>

<#if settings.sidebar_rss!true>
<a class="a-block no-tint nav-link-item" href="${context!}/atom.xml">
<a class="a-block no-tint nav-link-item" href="${atom_url!}">
RSS
</a>
</#if>
Expand All @@ -31,7 +31,7 @@
<#-- Please keep the section below and do not make modifications. -->
Theme <a href="https://github.com/SumiMakito/hexo-theme-journal/" target="_blank" rel="noreferrer noopener">Journal.</a> by <a href="https://mak1t0.cc/" target="_blank" rel="noreferrer noopener">Makito</a><br>
<#-- Please keep the section below and do not make modifications. -->
&copy; ${.now?string('yyyy')} <a href="${context!}">${options.blog_title!}</a>
&copy; ${.now?string('yyyy')} <a href="${blog_url!}">${blog_title!}</a>
<@global.footer_info />
</div>
</div>
2 changes: 1 addition & 1 deletion layout/_include/single_column_footer.ftl
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@
<#-- Please keep the section below and do not make modifications. -->
Theme <a href="https://github.com/SumiMakito/hexo-theme-journal/" target="_blank" rel="noreferrer noopener">Journal.</a> by <a href="https://mak1t0.cc/" target="_blank" rel="noreferrer noopener">Makito</a><br>
<#-- Please keep the section below and do not make modifications. -->
&copy; ${.now?string('yyyy')} <a href="${context!}">${options.blog_title!}</a>
&copy; ${.now?string('yyyy')} <a href="${blog_url!}">${blog_title!}</a>
<@global.footer_info />
</div>
10 changes: 5 additions & 5 deletions layout/_include/single_column_head.ftl
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
</@menuTag>

<#if settings.sidebar_rss!true>
<a class="a-block drawer-menu-item" href="${context!}/atom.xml">
<a class="a-block drawer-menu-item" href="${atom_url!}">
RSS
</a>
</#if>
Expand All @@ -29,15 +29,15 @@
menu
</i>
</button>
<a ref="navTitle" class="navbar-brand" href="${context!}">
${options.blog_title!}
<a ref="navTitle" class="navbar-brand" href="${blog_url!}">
${blog_title!}
</a>
</div>
</nav>
<div class="single-column-header-container" ref="pageHead"
v-bind:style="{ transform: 'translateZ(0px) translateY('+.3*scrollY+'px)', opacity: 1-navOpacity }">
<a href="${context!}">
<div class="single-column-header-title">${options.blog_title!}</div>
<a href="${blog_url!}">
<div class="single-column-header-title">${blog_title!}</div>
<div class="single-column-header-subtitle">${user.description!}</div>
</a>
</div>
2 changes: 1 addition & 1 deletion links.ftl
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<#include "layout/_include/head.ftl">
<@head title="友情链接 - ${options.blog_title!}" keywords="${options.seo_keywords!}" description="${options.seo_description!}"></@head>
<@head title="友情链接 - ${blog_title!}"></@head>
<#include "layout/_include/container_head.ftl">
<#include "layout/_include/single_column_head.ftl">
<#include "layout/_include/side_nav.ftl">
Expand Down
6 changes: 3 additions & 3 deletions post.ftl
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<#include "layout/_include/head.ftl">
<@head title="${post.title!} - ${options.blog_title!}" keywords="${post.title!},${options.seo_keywords!},${tagWords!}" description="${post.summary!}"></@head>
<@head title="${post.title!} - ${blog_title!}"></@head>
<#include "layout/_include/container_head.ftl">
<#include "layout/_include/single_column_head.ftl">
<#include "layout/_include/side_nav.ftl">
Expand All @@ -20,15 +20,15 @@
<#assign categoriesCount = categories?size />
<i class="material-icons" style="">folder</i>
<#list categories as category>
<a href='${context!}/categories/${category.slugName!}'>${category.name!}</a>${(categoriesCount != category_index+1)?string(', ','')}
<a href='${category.fullPath!}'>${category.name!}</a>${(categoriesCount != category_index+1)?string(', ','')}
</#list>
</#if>

<#if tags?? && tags?size gt 0>
<#assign tagsCount = tags?size />
<i class="material-icons" style="">label</i>
<#list tags as tag>
<a href='${context!}/tags/${tag.slugName!}'>${tag.name!}</a>${(tagsCount != tag_index+1)?string(', ','')}
<a href='${tag.fullPath!}'>${tag.name!}</a>${(tagsCount != tag_index+1)?string(', ','')}
</#list>
</#if>
</div>
Expand Down
2 changes: 1 addition & 1 deletion sheet.ftl
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<#include "layout/_include/head.ftl">
<@head title="${sheet.title!} - ${options.blog_title!}" keywords="${options.seo_keywords!}" description="${options.seo_description!}"></@head>
<@head title="${sheet.title!} - ${blog_title!}"></@head>
<#include "layout/_include/container_head.ftl">
<#include "layout/_include/single_column_head.ftl">
<#include "layout/_include/side_nav.ftl">
Expand Down
Loading

0 comments on commit 03bf8e0

Please sign in to comment.