Skip to content

Commit 7f97c01

Browse files
committed
finish
1 parent e8d78be commit 7f97c01

25 files changed

+463
-274
lines changed

README-zh_CN.md

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
<h1><a href="#" target="_blank">Casper-Halo</a></h1>
2+
3+
> 一款Halo的主题,瀑布流式主题。
4+
5+
## 说明
6+
7+
该主题的原作者为[Ghost](https://github.com/TryGhost),非常感谢做出这么优秀的主题。
8+
9+
原主题地址:[https://github.com/TryGhost/Casper](https://github.com/TryGhost/Casper)
10+
11+
## 预览截图
12+
13+
![](screenshots/index.png)
14+
15+
![](screenshots/option.png)
16+
17+
## 预览地址
18+
19+
[Ghost](https://demo.ghost.io)
20+
21+
## 注意
22+
23+
该主题能渲染`首页(/)``文章页(/archives/${postUrl})``归档(/archives)``友情链接(/links)``自定义页面(/p/${postUrl})``分类(/categories/${cateUrl})``标签(/tags/${tagUrl})`
24+
25+
## 使用方法
26+
27+
1. 克隆或者[下载](https://github.com/ruibaby/casper-halo/releases)
28+
2. 将文件夹名改为`casper`,将文件夹名改为`casper`,将文件夹名改为`casper`!!!
29+
3. 压缩为zip压缩包之后在后台的主题设置直接上传即可使用。
30+

README.md

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
<h1><a href="#" target="_blank">Casper-Halo</a></h1>
2+
3+
> A Halo theme, waterfall streaming theme.
4+
5+
## Description
6+
7+
The original author of this theme is [Ghost](https://github.com/TryGhost),Thanks very much for making such a great theme.
8+
9+
Original subject address:[https://github.com/TryGhost/Casper](https://github.com/TryGhost/Casper)
10+
11+
## Preview screenshot
12+
13+
![](screenshots/index.png)
14+
15+
![](screenshots/option.png)
16+
17+
## Preview address
18+
19+
[Ghost](https://demo.ghost.io)
20+
21+
## Attention
22+
23+
This theme can renders `Home(/)`,`Article page(/archives/${postUrl})`,`Archives(/archives)`,`Links(/links)`,`Custom page(/p/${postUrl})`,`Category(/categories/${cateUrl})`,`Tag(/tags/${tagUrl})`.
24+
25+
## Instructions
26+
27+
1. Clone or [download](https://github.com/ruibaby/casper-halo/releases).
28+
2. Change the folder name to `casper`!!!
29+
3. After compressing to a zip archive, you can use it directly in the background settings of the background.
30+

archives.ftl

Lines changed: 83 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
1+
<#include "default.ftl">
2+
<@default title="文章归档 | ${options.blog_title}" keyword="${options.seo_keywords}" desc="${options.seo_desc?if_exists}" canonical="${options.blog_url}/archives" body_class="page-template">
3+
4+
<#-- The tag above means: insert everything in this file
5+
into the {body} of the default.hbs template -->
6+
7+
<#-- The big featured header, it uses blog cover image as a BG if available -->
8+
<header class="site-header outer">
9+
<div class="inner">
10+
<#include "partials/site-nav.ftl">
11+
</div>
12+
</header>
13+
14+
<#-- Everything inside the #post tags pulls data from the post -->
15+
<main id="site-main" class="site-main outer">
16+
<div class="inner">
17+
18+
<article class="post-full post page <#if !options.casper_general_archives_cover??>no-image</#if>">
19+
20+
<header class="post-full-header">
21+
<h1 class="post-full-title">文章归档</h1>
22+
</header>
23+
24+
<#if options.casper_general_archives_cover??>
25+
<figure class="post-full-image" style="background-image: url(${options.casper_general_archives_cover})">
26+
</figure>
27+
</#if>
28+
29+
<section class="post-full-content">
30+
<div class="post-content">
31+
<h1>分类</h1>
32+
<ul>
33+
<@commonTag method="categories">
34+
<#list categories as category>
35+
<li>
36+
<a href="${options.blog_url}/categories/${category.cateUrl}">${category.cateName}(${category.posts?size})</a>
37+
</li>
38+
</#list>
39+
</@commonTag>
40+
</ul>
41+
42+
<h1>标签</h1>
43+
<ul>
44+
<@commonTag method="tags">
45+
<#list tags as tag>
46+
<li>
47+
<a href="${options.blog_url}/tags/${tag.tagUrl}">${tag.tagName}(${tag.posts?size})</a>
48+
</li>
49+
</#list>
50+
</@commonTag>
51+
</ul>
52+
53+
<h1>归档</h1>
54+
<@articleTag method="archives">
55+
<#list archives as archive>
56+
<h2>${archive.year}${archive.month}月</h2>
57+
<ul class="listing">
58+
<#list archive.posts?sort_by("postDate")?reverse as post>
59+
<li>
60+
${post.postDate?string('MM月dd日')}:<a href="${options.blog_url}/archives/${post.postUrl}">${post.postTitle}</a>
61+
</li>
62+
</#list>
63+
</ul>
64+
</#list>
65+
</@articleTag>
66+
</div>
67+
</section>
68+
69+
</article>
70+
71+
</div>
72+
</main>
73+
74+
<#-- The #contentFor helper here will send everything inside it up to the matching #block helper found in default.hbs -->
75+
</@default>
76+
<@scripts>
77+
<script>
78+
$(function() {
79+
var $postContent = $(".post-full-content");
80+
$postContent.fitVids();
81+
});
82+
</script>
83+
</@scripts>

assets/js/infinitescroll.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,8 +84,14 @@ $(function ($) {
8484
// next page
8585
currentPage += 1;
8686

87+
if(pathname.charAt(pathname.length-1) != '/'){
88+
pathname = pathname+'/';
89+
}
90+
8791
// Load more
8892
var nextPage = pathname + 'page/' + currentPage + '/';
93+
console.log(pathname);
94+
console.log(nextPage);
8995

9096
$.get(nextPage, function (content) {
9197
var parse = document.createRange().createContextualFragment(content);

author.ftl

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
{{!< default}}
2+
{{!-- The tag above means - insert everything in this file into the {body} of the default.hbs template --}}
3+
4+
{{#author}}
5+
{{!-- Everything inside the #author tags pulls data from the author --}}
6+
<header class="site-header outer {{#if cover_image}}" style="background-image: url({{cover_image}}){{else}}no-cover{{/if}}">
7+
<div class="inner">
8+
{{> "site-nav"}}
9+
<div class="site-header-content">
10+
{{#if profile_image}}
11+
<img class="author-profile-image" src="{{profile_image}}" alt="{{name}}" />
12+
{{/if}}
13+
<h1 class="site-title">{{name}}</h1>
14+
{{#if bio}}
15+
<h2 class="author-bio">{{bio}}</h2>
16+
{{/if}}
17+
<div class="author-meta">
18+
{{#if location}}
19+
<div class="author-location">{{location}} <span class="bull">&bull;</span></div>
20+
{{/if}}
21+
<div class="author-stats">
22+
{{plural ../pagination.total empty='No posts' singular='% post' plural='% posts'}} <span class="bull">&bull;</span>
23+
</div>
24+
{{#if website}}
25+
<a class="social-link social-link-wb" href="{{website}}" target="_blank" rel="noopener">{{> "icons/website"}}</a>
26+
{{/if}}
27+
{{#if twitter}}
28+
<a class="social-link social-link-tw" href="{{twitter_url}}" target="_blank" rel="noopener">{{> "icons/twitter"}}</a>
29+
{{/if}}
30+
{{#if facebook}}
31+
<a class="social-link social-link-fb" href="{{facebook_url}}" target="_blank" rel="noopener">{{> "icons/facebook"}}</a>
32+
{{/if}}
33+
<a class="social-link social-link-rss" href="https://feedly.com/i/subscription/feed/{{url absolute="true"}}rss/" target="_blank" rel="noopener">{{> "icons/rss"}}</a>
34+
</div>
35+
</div>
36+
</div>
37+
</header>
38+
{{/author}}
39+
40+
{{!-- The main content area --}}
41+
<main id="site-main" class="site-main outer">
42+
<div class="inner">
43+
44+
<div class="post-feed">
45+
{{#foreach posts}}
46+
47+
{{!-- The tag below includes the markup for each post - partials/post-card.hbs --}}
48+
{{> "post-card"}}
49+
50+
{{/foreach}}
51+
</div>
52+
53+
</div>
54+
</main>

category.ftl

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
<#include "default.ftl">
2+
<#include "partials/post-card.ftl">
3+
<@default title="分类:${category.cateName} | ${options.blog_title}" keyword="${options.seo_keywords}" desc="${options.seo_desc}" canonical="${options.blog_url}/categories/${category.cateName}" body_class="tag-template">
4+
<#-- The tag above means - insert everything in this file into the {body} of the default.hbs template -->
5+
<#-- The big featured header, it uses blog cover image as a BG if available -->
6+
<header class="site-header outer <#if options.casper_general_cover?default('/casper/assets/images/blog-cover.jpg') != ''>" style="background-image: url(${options.casper_general_cover?default('/casper/assets/images/blog-cover.jpg')})<#else>no-cover</#if>">
7+
<div class="inner">
8+
<#include "partials/site-nav.ftl">
9+
<div class="site-header-content">
10+
<h1 class="site-title">分类:${category.cateName}</h1>
11+
<h2 class="site-description">
12+
<#if category.cateDesc?? && category.cateDesc?if_exists!=''>
13+
${category.cateDesc}
14+
<#else>
15+
${category.posts?size}篇文章
16+
</#if>
17+
</h2>
18+
</div>
19+
</div>
20+
</header>
21+
22+
<#-- The main content area -->
23+
<main id="site-main" class="site-main outer">
24+
<div class="inner">
25+
<div class="post-feed">
26+
<#list posts.content as post>
27+
<#-- The tag below includes the markup for each post - partials/post-card.hbs -->
28+
<@post_card post></@post_card>
29+
</#list>
30+
</div>
31+
</div>
32+
</main>
33+
</@default>
34+
<@scripts>
35+
<#if posts.totalPages gt 1>
36+
<script>
37+
// maxPages is a global variable that is needed to determine
38+
// if we need to load more pages for the infinitescroll, or if
39+
// we reached the last page already.
40+
var maxPages = parseInt('${posts.totalPages}');
41+
</script>
42+
<script src="/casper/assets/js/infinitescroll.js"></script>
43+
</#if>
44+
</@scripts>

default.ftl

Lines changed: 8 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -28,41 +28,16 @@
2828
<meta property="og:title" content="${title}" />
2929
<meta property="og:description" content="${desc}" />
3030
<meta property="og:url" content="${canonical}" />
31-
<meta property="og:image" content="https://demo.ghost.io/content/images/2017/07/blog-cover.jpg" />
31+
<meta property="og:image" content="${options.casper_general_cover?default('/casper/assets/images/blog-cover.jpg')}" />
3232
<meta property="article:publisher" content="https://www.facebook.com/ghost" />
3333
<meta name="twitter:card" content="summary_large_image" />
3434
<meta name="twitter:title" content="${title}" />
3535
<meta name="twitter:description" content="${desc}" />
3636
<meta name="twitter:url" content="${canonical}" />
37-
<meta name="twitter:image" content="https://demo.ghost.io/content/images/2017/07/blog-cover.jpg" />
37+
<meta name="twitter:image" content="${options.casper_general_cover?default('/casper/assets/images/blog-cover.jpg')}" />
3838
<meta name="twitter:site" content="@tryghost" />
3939
<meta property="og:image:width" content="2000" />
4040
<meta property="og:image:height" content="666" />
41-
42-
<script type="application/ld+json">
43-
{
44-
"@context": "https://schema.org",
45-
"@type": "WebSite",
46-
"publisher": {
47-
"@type": "Organization",
48-
"name": "Ghost",
49-
"logo": "https://demo.ghost.io/content/images/2014/09/Ghost-Transparent-for-DARK-BG.png"
50-
},
51-
"url": "https://demo.ghost.io/",
52-
"image": {
53-
"@type": "ImageObject",
54-
"url": "https://demo.ghost.io/content/images/2017/07/blog-cover.jpg",
55-
"width": 2000,
56-
"height": 666
57-
},
58-
"mainEntityOfPage": {
59-
"@type": "WebPage",
60-
"@id": "https://demo.ghost.io/"
61-
},
62-
"description": "The professional publishing platform"
63-
}
64-
</script>
65-
6641
<meta name="generator" content="Halo 0.0.7" />
6742
<link rel="alternate" type="application/rss+xml" title="${options.blog_title}" href="${options.blog_url}/feed.xml" />
6843

@@ -73,15 +48,16 @@
7348

7449
<#-- All the main content gets inserted here, index.hbs, post.hbs, etc -->
7550
<#nested >
76-
7751
<#-- The footer at the very bottom of the screen -->
52+
<#assign current="${.now}">
7853
<footer class="site-footer outer">
7954
<div class="site-footer-content inner">
80-
<section class="copyright"><a href="${options.blog_url}">${options.blog_title}</a> &copy; ${options.blog_start}</section>
55+
<section class="copyright"><a href="${options.blog_url}">${options.blog_title}</a> &copy; ${current?substring(0,4)}</section>
8156
<nav class="site-footer-nav">
8257
<a href="${options.blog_url}">Latest Posts</a>
83-
<a href="{{facebook_url @blog.facebook}}" target="_blank" rel="noopener">Facebook</a>
84-
<a href="{{twitter_url @blog.twitter}}" target="_blank" rel="noopener">Twitter</a>
58+
<a href="https://www.facebook.com/ghost" target="_blank" rel="noopener">Facebook</a>
59+
<a href="https://twitter.com/tryghost" target="_blank" rel="noopener">Twitter</a>
60+
<a href="https://ghost.org" target="_blank" rel="noopener">Ghost</a>
8561
<a href="https://github.com/ruibaby/halo" target="_blank" rel="noopener">Halo</a>
8662
</nav>
8763
</div>
@@ -105,7 +81,7 @@
10581

10682
<#-- jQuery + Fitvids, which makes all video embeds responsive -->
10783
<script
108-
src="https://code.jquery.com/jquery-3.2.1.min.js"
84+
src="//cdn.bootcss.com/jquery/3.2.1/jquery.min.js"
10985
integrity="sha256-hwg4gsxgFZhOsEEamdOYGBf13FyQuiTwlAQgxVSNgt4="
11086
crossorigin="anonymous">
11187
</script>

error-404.hbs

Lines changed: 0 additions & 56 deletions
This file was deleted.

0 commit comments

Comments
 (0)