Skip to content

Commit

Permalink
Merge pull request #11 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 36076b6 + dfcc3d8 commit 4f3fae1
Show file tree
Hide file tree
Showing 15 changed files with 66 additions and 67 deletions.
8 changes: 4 additions & 4 deletions archives.ftl
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<#include "default.ftl">
<@default title="文章归档 | ${options.blog_title!}" keyword="${options.seo_keywords!}" desc="${options.seo_description!}" canonical="${context!}/archives" body_class="page-template">
<@default title="文章归档 | ${blog_title!}" canonical="${archives_url!}" body_class="page-template">

<#-- The tag above means: insert everything in this file
into the {body} of the default.hbs template -->
Expand Down Expand Up @@ -33,7 +33,7 @@ into the {body} of the default.hbs template -->
<@categoryTag method="list">
<#list categories as category>
<li>
<a href="${context!}/categories/${category.slugName}">${category.name}(${category.postCount!0})</a>
<a href=${category.fullPath!}>${category.name}(${category.postCount!0})</a>
</li>
</#list>
</@categoryTag>
Expand All @@ -44,7 +44,7 @@ into the {body} of the default.hbs template -->
<@tagTag method="list">
<#list tags as tag>
<li>
<a href="${context!}/tags/${tag.slugName}">${tag.name}(${tag.postCount!0})</a>
<a href="${tag.fullPath!}">${tag.name}(${tag.postCount!0})</a>
</li>
</#list>
</@tagTag>
Expand All @@ -57,7 +57,7 @@ into the {body} of the default.hbs template -->
<ul class="listing">
<#list archive.posts?sort_by("createTime")?reverse as post>
<li>
${post.createTime?string('MM月dd日')}:<a href="${context!}/archives/${post.url!}">${post.title}</a>
${post.createTime?string('MM月dd日')}:<a href="${post.fullPath!}">${post.title!}</a>
</li>
</#list>
</ul>
Expand Down
8 changes: 4 additions & 4 deletions category.ftl
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
<#include "default.ftl">
<#include "partials/post-card.ftl">
<@default title="分类:${category.name!} | ${options.blog_title!}" keyword="${options.seo_keywords!}" desc="${options.seo_description!}" canonical="${context!}/categories/${category.name}" body_class="tag-template">
<@default title="分类:${category.name!} | ${blog_title!}" canonical="${category.fullPath!}" body_class="tag-template">
<#-- The tag above means - insert everything in this file into the {body} of the default.hbs template -->
<#-- The big featured header, it uses blog cover image as a BG if available -->
<header class="site-header outer <#if settings.cover?default('${static!}/assets/images/blog-cover.jpg') != ''>" style="background-image: url(${settings.cover?default('${static!}/assets/images/blog-cover.jpg')})<#else>no-cover</#if>">
<header class="site-header outer <#if settings.cover?default('${theme_base!}/assets/images/blog-cover.jpg') != ''>" style="background-image: url(${settings.cover?default('${theme_base!}/assets/images/blog-cover.jpg')})<#else>no-cover</#if>">
<div class="inner">
<#include "partials/site-nav.ftl">
<div class="site-header-content">
<h1 class="site-title">分类:${category.name}</h1>
<h2 class="site-description">
<#if category.description?? && (category.description!'')!=''>
<#if category.description?? && category.description!=''>
${category.description}
<#else>
${posts.totalElements!0}篇文章
Expand Down Expand Up @@ -39,6 +39,6 @@
// we reached the last page already.
var maxPages = parseInt('${posts.totalPages}');
</script>
<script src="${static!}/assets/built/infinitescroll.js"></script>
<script src="${theme_base!}/assets/built/infinitescroll.js"></script>
</#if>
</@scripts>
35 changes: 17 additions & 18 deletions default.ftl
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
<#macro default title,keyword,desc,canonical,body_class>
<#import "/common/macro/common_macro.ftl" as common>
<#macro default title,canonical,body_class>
<!DOCTYPE html>
<html lang="zh-CN">
<head>
Expand All @@ -14,35 +13,35 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0" />

<#-- Styles'n'Scripts -->
<link rel="stylesheet" type="text/css" href="${static!}/assets/built/screen.css" />
<link rel="stylesheet" type="text/css" href="${theme_base!}/assets/built/screen.css" />

<#-- This tag outputs SEO meta+structured data and other important settings -->
<meta name="keywords" content="${keyword}" />
<meta name="description" content="${desc}" />
<@common.globalHeader />
<meta name="keywords" content="${meta_keywords!}" />
<meta name="description" content="${meta_description!}" />
<@global.head />
<link rel="canonical" href="${canonical}" />
<meta name="referrer" content="no-referrer-when-downgrade" />

<meta property="og:site_name" content="${title}" />
<meta property="og:type" content="website" />
<meta property="og:title" content="${title}" />
<meta property="og:description" content="${desc}" />
<meta property="og:description" content="${meta_description!}" />
<meta property="og:url" content="${canonical}" />
<meta property="og:image" content="${settings.cover!'${static!}/assets/images/blog-cover.jpg'}" />
<meta property="og:image" content="${settings.cover!'${theme_base!}/assets/images/blog-cover.jpg'}" />
<meta property="article:publisher" content="https://www.facebook.com/ghost" />
<meta name="twitter:card" content="summary_large_image" />
<meta name="twitter:title" content="${title}" />
<meta name="twitter:description" content="${desc}" />
<meta name="twitter:description" content="${meta_description!}" />
<meta name="twitter:url" content="${canonical}" />
<meta name="twitter:image" content="${settings.cover!'${static!}/assets/images/blog-cover.jpg'}" />
<meta name="twitter:image" content="${settings.cover!'${theme_base!}/assets/images/blog-cover.jpg'}" />
<meta name="twitter:site" content="@tryghost" />
<meta property="og:image:width" content="2000" />
<meta property="og:image:height" content="666" />
<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 post??>
<link rel="stylesheet" type="text/css" href="${static!}/assets/prism/css/prism-${settings.code_pretty!'Default'}.css" />
<script type="text/javascript" src="${static!}/assets/prism/js/prism.js"></script>
<link rel="stylesheet" type="text/css" href="${theme_base!}/assets/prism/css/prism-${settings.code_pretty!'Default'}.css" />
<script type="text/javascript" src="${theme_base!}/assets/prism/js/prism.js"></script>
</#if>

</head>
Expand All @@ -56,11 +55,11 @@
<footer class="site-footer outer">
<div class="site-footer-content inner">
<section class="copyright">
<a href="${context!}">${options.blog_title!}</a> &copy; ${.now?string('yyyy')}
<@common.footer_info />
<a href="${blog_url!}">${blog_title!}</a> &copy; ${.now?string('yyyy')}
<@global.footer_info />
</section>
<nav class="site-footer-nav">
<a href="${context!}">Latest Posts</a>
<a href="${blog_url!}">Latest Posts</a>
<a href="https://www.facebook.com/ghost" target="_blank" rel="noopener">Facebook</a>
<a href="https://twitter.com/tryghost" target="_blank" rel="noopener">Twitter</a>
<a href="https://ghost.org" target="_blank" rel="noopener">Ghost</a>
Expand Down Expand Up @@ -91,12 +90,12 @@
integrity="sha256-hwg4gsxgFZhOsEEamdOYGBf13FyQuiTwlAQgxVSNgt4="
crossorigin="anonymous">
</script>
<script type="text/javascript" src="${static!}/assets/built/jquery.fitvids.js"></script>
<script type="text/javascript" src="${theme_base!}/assets/built/jquery.fitvids.js"></script>
</#macro>

<#macro scripts>
<#nested >
<@common.statistics />
<@global.statistics />
</body>
</html>
</#macro>
13 changes: 6 additions & 7 deletions index.ftl
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
<#include "default.ftl">
<#include "partials/post-card.ftl">
<@default title="${options.blog_title!}" keyword="${options.seo_keywords!}" desc="${options.seo_description!}" canonical="${context!}" body_class="home-template">
<@default title="${blog_title!}" canonical="${blog_url!}" body_class="home-template">
<#-- The tag above means: insert everything in this file
into the {body} of the default.hbs template -->

<#-- The big featured header, it uses blog cover image as a BG if available -->
<header class="site-header outer <#if (settings.cover!'${static!}/assets/images/blog-cover.jpg') != ''>" style="background-image: url(${settings.cover!'${static!}/assets/images/blog-cover.jpg'})<#else>no-cover</#if>">
<header class="site-header outer <#if (settings.cover!'${theme_base!}/assets/images/blog-cover.jpg') != ''>" style="background-image: url(${settings.cover!'${theme_base!}/assets/images/blog-cover.jpg'})<#else>no-cover</#if>">
<div class="inner">
<div class="site-header-content">
<h1 class="site-title">
<#if options.blog_logo??>
<img class="site-logo" src="${options.blog_logo}" alt="${options.blog_title!}" />
<#if blog_logo?? && blog_logo!=''>
<img class="site-logo" src="${blog_logo!}" alt="${blog_title!}" />
<#else>
${options.blog_title!}
${blog_title!}
</#if>
</h1>
<h2 class="site-description">${user.description!}</h2>
Expand All @@ -27,7 +27,6 @@ into the {body} of the default.hbs template -->

<div class="post-feed">
<#list posts.content as post>

<#-- The tag below includes the markup for each post - partials/post-card.hbs -->
<@post_card post></@post_card>
</#list>
Expand All @@ -44,7 +43,7 @@ into the {body} of the default.hbs template -->
// we reached the last page already.
var maxPages = parseInt('${posts.totalPages}');
</script>
<script src="${static!}/assets/built/infinitescroll.js"></script>
<script src="${theme_base!}/assets/built/infinitescroll.js"></script>
</#if>
<#-- Ghost outputs important scripts and data with this tag - it should always be the very last thing before the closing body tag -->
<#-- {{ghost_foot}} -->
Expand Down
2 changes: 1 addition & 1 deletion links.ftl
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<#include "default.ftl">
<@default title="友情链接 | ${options.blog_title!}" keyword="${options.seo_keywords!}" desc="${options.seo_description!}" canonical="${context!}/links" body_class="page-template">
<@default title="友情链接 | ${blog_title!}" canonical="${links_url!}" body_class="page-template">

<#-- The tag above means: insert everything in this file
into the {body} of the default.hbs template -->
Expand Down
6 changes: 3 additions & 3 deletions partials/byline-single.ftl
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,15 @@
</span>
</#if>
<section class="author-card-content">
<h4 class="author-card-name"><a href="${context!}">${user.nickname!}</a></h4>
<h4 class="author-card-name"><a href="${blog_url!}">${user.nickname!}</a></h4>
<#if user.description??>
<p>${user.description}</p>
<#else>
<p>Read <a href="${context!}">more posts</a> by this author.</p>
<p>Read <a href="${blog_url!}">more posts</a> by this author.</p>
</#if>
</section>
</section>
<div class="post-full-footer-right">
<a class="author-card-button" href="${context!}">Read More</a>
<a class="author-card-button" href="${blog_url!}">Read More</a>
</div>

12 changes: 6 additions & 6 deletions partials/floating-header.ftl
Original file line number Diff line number Diff line change
@@ -1,22 +1,22 @@
<#macro floating_header title>
<div class="floating-header">
<div class="floating-header-logo">
<a href="${context!}">
<#if options.blog_logo??>
<img src="${options.blog_logo}" alt="${options.blog_title!} icon" />
<a href="${blog_url!}">
<#if blog_logo?? && blog_logo!=''>
<img src="${blog_logo!}" alt="${blog_title!} icon" />
</#if>
<span>${options.blog_title!}</span>
<span>${blog_title!}</span>
</a>
</div>
<span class="floating-header-divider">&mdash;</span>
<div class="floating-header-title">${title}</div>
<div class="floating-header-share">
<div class="floating-header-share-label">Share this <#include "icons/point.ftl"></div>
<a class="floating-header-share-tw" href="https://twitter.com/share?text=${title}&amp;url=${context!}"
<a class="floating-header-share-tw" href="https://twitter.com/share?text=${title}&amp;url=${blog_url!}"
onclick="window.open(this.href, 'share-twitter', 'width=550,height=235');return false;">
<#include "icons/twitter.ftl">
</a>
<a class="floating-header-share-fb" href="https://www.facebook.com/sharer/sharer.php?u=${context!}"
<a class="floating-header-share-fb" href="https://www.facebook.com/sharer/sharer.php?u=${blog_url!}"
onclick="window.open(this.href, 'share-facebook','width=580,height=296');return false;">
<#include "icons/facebook.ftl">
</a>
Expand Down
10 changes: 5 additions & 5 deletions partials/post-card.ftl
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
<#macro post_card post>
<article class="post-card post">
<#if post.thumbnail?? && post.thumbnail!=''>
<a class="post-card-image-link" href="${context!}/archives/${post.url!}">
<a class="post-card-image-link" href="${post.fullPath!}">
<div class="post-card-image" style="background-image: url(${post.thumbnail!})"></div>
</a>
</#if>
<div class="post-card-content">
<a class="post-card-content-link" href="${context!}/archives/${post.url!}">
<a class="post-card-content-link" href="${post.fullPath!}">
<header class="post-card-header">
<#if post.categories?? && post.categories?size gt 0>
<span class="post-card-tags">${post.categories[0].name}</span>
</#if>
<h2 class="post-card-title">${post.title}</h2>
<h2 class="post-card-title">${post.title!}</h2>
</header>
<section class="post-card-excerpt">
<p>${post.summary!}</p>
Expand All @@ -27,9 +27,9 @@
</div>

<#if user.avatar??>
<a href="${context!}" class="static-avatar"><img class="author-profile-image" src="${user.avatar}" alt="${user.nickname!}" /></a>
<a href="${blog_url!}" class="static-avatar"><img class="author-profile-image" src="${user.avatar}" alt="${user.nickname!}" /></a>
<#else>
<a href="${context!}" class="static-avatar author-profile-image">
<a href="${blog_url!}" class="static-avatar author-profile-image">
<#include "../partials/icons/avatar.ftl">
</a>
</#if>
Expand Down
2 changes: 1 addition & 1 deletion partials/post-copyright.ftl
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
</li>
<li class="post-copyright-link" style="margin: 0">
<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" style="margin: 0">
<strong>版权声明:</strong>
Expand Down
8 changes: 4 additions & 4 deletions partials/site-nav.ftl
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
<nav class="site-nav">
<div class="site-nav-left">
<#if !is_index??>
<#if options.blog_logo??>
<a class="site-nav-logo" href="${context!}"><img src="${options.blog_logo!}" alt="${options.blog_title!}" /></a>
<#if blog_logo?? && blog_logo!=''>
<a class="site-nav-logo" href="${blog_url!}"><img src="${blog_logo!}" alt="${blog_title!}" /></a>
<#else>
<a class="site-nav-logo" href="${context!}">${options.blog_title!}</a>
<a class="site-nav-logo" href="${blog_url!}">${blog_title!}</a>
</#if>
</#if>
<@menuTag method="list">
Expand Down Expand Up @@ -85,7 +85,7 @@
</#if>
</div>
<#if settings.rss!true>
<a class="rss-button" href="/feed.xml" target="_blank" rel="noopener">
<a class="rss-button" href="${rss_url!}" target="_blank" rel="noopener">
<#include "../partials/icons/rss.ftl">
</a>
</#if>
Expand Down
8 changes: 4 additions & 4 deletions post.ftl
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<#include "default.ftl">
<#include "partials/post-card.ftl">
<#include "partials/floating-header.ftl">
<@default title="${post.title} | ${options.blog_title!}" keyword="${options.seo_keywords!},${tagWords!}" desc="${post.summary!}" canonical="${context!}/archives/${post.url!}" body_class="post-template">
<@default title="${post.title!} | ${blog_title!}" canonical="${post.fullPath!}" body_class="post-template">

<#-- The tag above means: insert everything in this file
into the {body} of the default.hbs template -->
Expand All @@ -23,10 +23,10 @@ into the {body} of the default.hbs template -->
<section class="post-full-meta">
<time class="post-full-meta-date" datetime="${post.createTime?string('yyyy-MM-dd')}">${post.createTime?string('d MMM,yyyy')}</time>
<#if post.categories?? && post.categories?size gt 0>
<span class="date-divider">/</span> <a href="${context!}/categories/${post.categories[0].slugName}">${post.categories[0].name}</a>
<span class="date-divider">/</span> <a href="${post.categories[0].fullPath!}">${post.categories[0].name}</a>
</#if>
</section>
<h1 class="post-full-title">${post.title}</h1>
<h1 class="post-full-title">${post.title!}</h1>
</header>

<#if post.thumbnail?? && post.thumbnail!=''>
Expand Down Expand Up @@ -117,7 +117,7 @@ into the {body} of the default.hbs template -->
</aside>

<#-- Floating header which appears on-scroll, included from includes/floating-header.hbs -->
<@floating_header title="${post.title}"></@floating_header>
<@floating_header title="${post.title!}"></@floating_header>

</@default>
<@scripts>
Expand Down
4 changes: 2 additions & 2 deletions sheet.ftl
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<#include "default.ftl">
<@default title="${post.title} | ${options.blog_title!}" keyword="${options.seo_keywords!}" desc="${post.summary!}" canonical="${context!}/s/${post.url!}" body_class="page-template">
<@default title="${post.title!} | ${blog_title!}" canonical="${sheet.fullPath!}" body_class="page-template">

<#-- The tag above means: insert everything in this file
into the {body} of the default.hbs template -->
Expand All @@ -18,7 +18,7 @@ into the {body} of the default.hbs template -->
<article class="post-full post page <#if !post.thumbnail??>no-image</#if>">

<header class="post-full-header">
<h1 class="post-full-title">${post.title}</h1>
<h1 class="post-full-title">${post.title!}</h1>
</header>

<#if post.thumbnail?? && post.thumbnail!=''>
Expand Down
Loading

0 comments on commit 4f3fae1

Please sign in to comment.