forked from halo-dev/theme-casper
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcategory.ftl
44 lines (43 loc) · 1.98 KB
/
category.ftl
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
<#include "default.ftl">
<#include "partials/post-card.ftl">
<@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">
<#-- 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 options.casper_general_cover?default('/${themeName}/assets/images/blog-cover.jpg') != ''>" style="background-image: url(${options.casper_general_cover?default('/${themeName}/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.cateName}</h1>
<h2 class="site-description">
<#if category.cateDesc?? && (category.cateDesc!'')!=''>
${category.cateDesc}
<#else>
${category.posts?size}篇文章
</#if>
</h2>
</div>
</div>
</header>
<#-- The main content area -->
<main id="site-main" class="site-main outer">
<div class="inner">
<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>
</div>
</div>
</main>
</@default>
<@scripts>
<#if posts.totalPages gt 1>
<script>
// maxPages is a global variable that is needed to determine
// if we need to load more pages for the infinitescroll, or if
// we reached the last page already.
var maxPages = parseInt('${posts.totalPages}');
</script>
<script src="/${themeName}/assets/built/infinitescroll.js"></script>
</#if>
</@scripts>