Skip to content

Commit

Permalink
Merge pull request #7 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 1bc17be + f193500 commit bfaacfd
Show file tree
Hide file tree
Showing 10 changed files with 66 additions and 40 deletions.
2 changes: 1 addition & 1 deletion _includes/external.ftl
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
<script type="text/javascript" src="//cdn.jsdelivr.net/npm/jquery@1.11.3/dist/jquery.min.js"></script>
<script type="text/javascript" src="${static!}/js/main.js"></script>
<script type="text/javascript" src="${theme_base!}/js/main.js"></script>
14 changes: 7 additions & 7 deletions _includes/read-more.ftl
Original file line number Diff line number Diff line change
@@ -1,23 +1,23 @@
<section class="read-more">
<#if prePost??>
<#if prevPost??>
<div class="read-more-item">
<span class="read-more-item-dim">最近的文章</span>
<h2 class="post-list__post-title post-title"><a href="${context!}/archives/${prePost.url!}" title="link to ${prePost.title!}">${prePost.title!}</a></h2>
<p class="excerpt">${prePost.summary!}&hellip;</p>
<h2 class="post-list__post-title post-title"><a href="${prevPost.fullPath!}" title="link to ${prevPost.title!}">${prevPost.title!}</a></h2>
<p class="excerpt">${prevPost.summary!}&hellip;</p>
<div class="post-list__meta">
<time datetime="${prePost.createTime}" class="post-list__meta--date date">${prePost.createTime?string("yyyy-MM-dd")}</time>
<a class="btn-border-small" href="${context!}/archives/${prePost.url!}">继续阅读</a></div>
<time datetime="${prevPost.createTime}" class="post-list__meta--date date">${prevPost.createTime?string("yyyy-MM-dd")}</time>
<a class="btn-border-small" href="${prevPost.fullPath!}">继续阅读</a></div>
</div>
</#if>

<#if nextPost??>
<div class="read-more-item">
<span class="read-more-item-dim">更早的文章</span>
<h2 class="post-list__post-title post-title"><a href="${context!}/archives/${nextPost.url!}" title="link to ${nextPost.title!}">${nextPost.title!}</a></h2>
<h2 class="post-list__post-title post-title"><a href="${nextPost.fullPath!}" title="link to ${nextPost.title!}">${nextPost.title!}</a></h2>
<p class="excerpt">${nextPost.summary!}&hellip;</p>
<div class="post-list__meta">
<time datetime="${nextPost.createTime}" class="post-list__meta--date date">${nextPost.createTime?string("yyyy-MM-dd")}</time>
<a class="btn-border-small" href="${context!}/archives/${nextPost.url!}">继续阅读</a>
<a class="btn-border-small" href="${nextPost.fullPath!}">继续阅读</a>
</div>
</div>
</#if>
Expand Down
8 changes: 4 additions & 4 deletions _includes/side-panel.ftl
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
<header class="panel-cover <#if is_post?? || is_sheet??>panel-cover--collapsed</#if>" style="background-image: url('${settings.cover_image!"${static!}/assets/images/background-cover.jpg"}')">
<header class="panel-cover <#if is_post?? || is_sheet??>panel-cover--collapsed</#if>" style="background-image: url('${settings.cover_image!"${theme_base!}/assets/images/background-cover.jpg"}')">
<div class="panel-main">

<div class="panel-main__inner panel-inverted">
<div class="panel-main__content">

<a href="${context!}/#blog" title="前往 ${options.blog_title!} 的主页" class="blog-button"><img src="${user.avatar!}" width="80" alt="${options.blog_title!} logo" class="panel-cover__logo logo" /></a>
<h1 class="panel-cover__title panel-title"><a href="${context!}/#blog" title="link to homepage for ${options.blog_title!}" class="blog-button">${options.blog_title!}</a></h1>
<a href="${blog_url!}/#blog" title="前往 ${blog_title!} 的主页" class="blog-button"><img src="${user.avatar!}" width="80" alt="${blog_title!} logo" class="panel-cover__logo logo" /></a>
<h1 class="panel-cover__title panel-title"><a href="${blog_url!}/#blog" title="link to homepage for ${blog_title!}" class="blog-button">${blog_title!}</a></h1>
<#if settings.subtitle?? && settings.subtitle!=''>
<span class="panel-cover__subtitle panel-subtitle">${settings.subtitle!}</span>
</#if>
Expand All @@ -21,7 +21,7 @@
<div>
<nav class="cover-navigation cover-navigation--primary">
<ul class="navigation">
<li class="navigation__item"><a href="${context!}/#blog" title="${settings.blog_button_description!}" class="blog-button">${settings.blog_button_title!}</a></li>
<li class="navigation__item"><a href="${blog_url!}/#blog" title="${settings.blog_button_description!}" class="blog-button">${settings.blog_button_title!}</a></li>
<@menuTag method="list">
<#list menus?sort_by('priority') as menu>
<li class="navigation__item"><a href="${menu.url}" target="${menu.target!}" title="${menu.name}">${menu.name}</a></li>
Expand Down
2 changes: 1 addition & 1 deletion _includes/social.ftl
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
<#if settings.rss!true>
<!-- RSS -->
<li class="navigation__item">
<a href="${context!}/feed.xml" rel="author" title="RSS" target="_blank">
<a href="${rss_url!}" rel="author" title="RSS" target="_blank">
<i class='social fa fa-rss'></i>
<span class="label">RSS</span>
</a>
Expand Down
19 changes: 10 additions & 9 deletions _layouts/default.ftl
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<#macro default title keywords description canonical>
<#macro default title canonical>
<!DOCTYPE html>
<html>

Expand All @@ -8,33 +8,34 @@
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">

<title>${title!}</title>
<meta name="description" content="${description!}">
<meta name="keywords" content="${meta_keywords!}">
<meta name="description" content="${meta_description!}">
<meta name="author" content="Wei Wang">

<meta name="twitter:card" content="summary">
<meta name="twitter:title" content="${title!}">
<meta name="twitter:description" content="${description!}">
<meta name="twitter:description" content="${meta_description!}">

<meta property="og:type" content="article">
<meta property="og:title" content="${title!}">
<meta property="og:description" content="${description!}">
<meta property="og:description" content="${meta_description!}">

<@global.head/>

<link rel="stylesheet" href="${static!}/css/main.css">
<link rel="stylesheet" href="${theme_base!}/css/main.css">
<link href="//cdn.jsdelivr.net/npm/font-awesome@4.1.0/css/font-awesome.min.css" rel="stylesheet">

<script src="//cdn.jsdelivr.net/npm/jquery@3.4.1/dist/jquery.min.js"></script>

<link rel="canonical" href="${canonical!}">
<link rel="alternate" type="application/rss+xml" title="${options.blog_title!}" href="${context!}/feed.xml">
<link rel="alternate" type="application/rss+xml" title="${blog_title!}" href="${rss_url!}">


<#if settings.prettify_enable!false>
<#if is_post?? || is_sheet??>
<script src="${static!}/lib/prettify/js/prettify.min.js"></script>
<link rel="stylesheet" href="${static!}/lib/prettify/css/prettify.min.css">
<link rel="stylesheet" href="${static!}/lib/prettify/css/${settings.prettify_theme!}.min.css">
<script src="${theme_base!}/lib/prettify/js/prettify.min.js"></script>
<link rel="stylesheet" href="${theme_base!}/lib/prettify/css/prettify.min.css">
<link rel="stylesheet" href="${theme_base!}/lib/prettify/css/${settings.prettify_theme!}.min.css">
<script>
$(function() {
$('pre').addClass('prettyprint linenums').attr('style', 'overflow:auto;');
Expand Down
24 changes: 18 additions & 6 deletions index.ftl
Original file line number Diff line number Diff line change
@@ -1,28 +1,40 @@
<#include "_layouts/default.ftl">
<#include "_includes/pagination.ftl">
<@default title="${options.blog_title!}" keywords="${options.seo_keywords!}" description="${options.seo_description!}" canonical="${context!}">
<@default title="${blog_title!}" canonical="${blog_url!}">
<div class="main-post-list hidden">

<ol class="post-list">
<#list posts.content as post>
<li>
<h2 class="post-list__post-title post-title"><a href="${context!}/archives/${post.url!}" title="访问 ${post.title!}">${post.title!}</a></h2>
<h2 class="post-list__post-title post-title"><a href="${post.fullPath!}" title="访问 ${post.title!}">${post.title!}</a></h2>
<p class="excerpt">${post.summary!}&hellip;</p>
<div class="post-list__meta">
<time datetime="${post.createTime}" class="post-list__meta--date date">${post.createTime?string("yyyy-MM-dd")}</time>
<span class="post-list__meta--tags tags">
<#if post.tags?? && post.tags?size gt 0>
<#list post.tags as tag>
&#8226;
<a href="${context!}/tags/${tag.slugName}#blog">${tag.name}</a>&nbsp
<a href="${tag.fullPath!}#blog">${tag.name}</a>&nbsp
</#list>
</#if>
</span>
<a class="btn-border-small" href="${context!}/archives/${post.url}">继续阅读</a></div>
<a class="btn-border-small" href="${post.fullPath!}">继续阅读</a></div>
<hr class="post-list__divider" />
</li>
</#list>
</ol>
<@nav url = "${context!}/"></@nav>
<hr class="post-list__divider " />
<nav class="pagination" role="navigation">
<#if posts.totalPages gt 1>
<@paginationTag method="index" page="${posts.number}" total="${posts.totalPages}" display="3">
<#if pagination.hasPrev>
<a class="newer-posts pagination__newer btn btn-small btn-tertiary" href="${pagination.prevPageFullPath!}#blog">&larr; 最近</a>
</#if>
<span class="pagination__page-number">${posts.number+1} / ${posts.totalPages}</span>
<#if pagination.hasNext>
<a class="older-posts pagination__older btn btn-small btn-tertiary" href="${pagination.nextPageFullPath!}#blog">更早 &rarr;</a>
</#if>
</@paginationTag>
</#if>
</nav>
</div>
</@default>
8 changes: 4 additions & 4 deletions post.ftl
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<#include "_layouts/default.ftl">
<#include "_includes/comments.ftl">
<@default title="${post.title!} - ${options.blog_title!}" keywords="${options.seo_keywords!}" description="${post.summary!}" canonical="${context!}/archives/${post.url}">
<@default title="${post.title!} - ${blog_title!}" canonical="${post.fullPath!}">
<article class="post-container post-container--single" itemscope itemtype="http://schema.org/BlogPosting">
<header class="post-header">
<div class="post-meta">
Expand All @@ -9,16 +9,16 @@
<#if tags?? && tags?size gt 0>
<#list tags as tag>
&#8226;
<a href="${context!}/tags/${tag.slugName}#blog">${tag.name}</a>&nbsp;
<a href="${tag.fullPath!}#blog">${tag.name}</a>&nbsp;
</#list>
</#if>
</span>
</div>
<h1 class="post-title">${post.title}</h1>
<h1 class="post-title">${post.title!}</h1>
</header>

<section class="post">
${post.formatContent}
${post.formatContent!}
</section>
</article>

Expand Down
2 changes: 1 addition & 1 deletion sheet.ftl
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<#include "_layouts/default.ftl">
<#include "_includes/comments.ftl">
<@default title="${sheet.title!} - ${options.blog_title!}" keywords="${options.seo_keywords!}" description="${options.seo_description!}" canonical="${context!}/s/${sheet.url}">
<@default title="${sheet.title!} - ${blog_title!}" canonical="${sheet.fullPath!}">
<article class="post-container post-container--single" itemscope itemtype="http://schema.org/BlogPosting">
<header class="post-header">
<div class="post-meta">
Expand Down
24 changes: 18 additions & 6 deletions tag.ftl
Original file line number Diff line number Diff line change
@@ -1,27 +1,39 @@
<#include "_layouts/default.ftl">
<@default title="标签:${tag.name} - ${options.blog_title!}" keywords="${options.seo_keywords!}" description="${options.seo_description!}" canonical="${context!}/tags/${tag.slugName}">
<@default title="标签:${tag.name} - ${blog_title!}" canonical="${tag.fullPath!}">
<div class="main-post-list hidden">
<ol class="post-list">
<#list posts.content as post>
<li>
<h2 class="post-list__post-title post-title"><a href="${context!}/archives/${post.url}" title="访问 ${post.title}">${post.title}</a></h2>
<h2 class="post-list__post-title post-title"><a href="${post.fullPath!}" title="访问 ${post.title!}">${post.title!}</a></h2>
<p class="excerpt">${post.summary}...</p>
<div class="post-list__meta">
<time datetime="${post.createTime}" class="post-list__meta--date date">${post.createTime?string("yyyy-MM-dd")}</time>
<span class="post-list__meta--tags tags">
<#if post.tags?? && post.tags?size gt 0>
<#list post.tags as tag>
&#8226;
<a href="${context!}/tags/${tag.slugName}#blog">${tag.name}</a>&nbsp;
<a href="${tag.fullPath!}#blog">${tag.name}</a>&nbsp;
</#list>
</#if>
</span>
<a class="btn-border-small" href="${context!}/archives/${post.url}">继续阅读</a></div>
<a class="btn-border-small" href="${post.fullPath!}">继续阅读</a></div>
<hr class="post-list__divider" />
</li>
</#list>
</ol>
<#include "_includes/pagination.ftl">
<@nav url = "${context!}/tags/${tag.slugName}/"></@nav>
<hr class="post-list__divider " />
<nav class="pagination" role="navigation">
<#if posts.totalPages gt 1>
<@paginationTag method="tagPosts" page="${posts.number}" total="${posts.totalPages}" display="3" slug="${tag.slug!}">
<#if pagination.hasPrev>
<a class="newer-posts pagination__newer btn btn-small btn-tertiary" href="${pagination.prevPageFullPath!}#blog">&larr; 最近</a>
</#if>
<span class="pagination__page-number">${posts.number+1} / ${posts.totalPages}</span>
<#if pagination.hasNext>
<a class="older-posts pagination__older btn btn-small btn-tertiary" href="${pagination.nextPageFullPath!}#blog">更早 &rarr;</a>
</#if>
</@paginationTag>
</#if>
</nav>
</div>
</@default>
3 changes: 2 additions & 1 deletion theme.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,5 @@ description:
logo:
website: https://github.com/halo-dev/halo-theme-vno
repo: https://github.com/halo-dev/halo-theme-vno
version: 1.4
version: 1.4.1
require: 1.3.0

0 comments on commit bfaacfd

Please sign in to comment.