Skip to content

Commit

Permalink
v1.4.1 标签云支持显示为独立页面
Browse files Browse the repository at this point in the history
  • Loading branch information
ddiu8081 committed May 25, 2018
1 parent 08d0bb0 commit 361f4da
Show file tree
Hide file tree
Showing 7 changed files with 52 additions and 40 deletions.
29 changes: 5 additions & 24 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,27 +27,6 @@ Ghost 0.x版本默认的 Casper 十分好看,可惜1.0版本之后就改成 cm

[Features Todo List](https://github.com/ddiu8081/ghost-theme-Moegi/issues/2)

### MarkDown
```
> 文字引用
```
> 文字引用
```
**文字加粗**
```
**文字加粗**

```
*文字倾斜*
```
*文字倾斜*

```
[超链接](http://ddiu.site)
```
[超链接](http://ddiu.site)

### Screenshot & Demo

![index](http://ostfcwjy3.bkt.clouddn.com/18-5-24/82860263.jpg)
Expand All @@ -62,6 +41,7 @@ Ghost 0.x版本默认的 Casper 十分好看,可惜1.0版本之后就改成 cm
* 2018.05.23 v1.2.0 使用[Typo.css](https://typo.sofi.sh/)重构了页面的行距等样式;代码高亮更换为[Highlight.js](https://highlightjs.org/);背景改为#ffffff;超链接、强调色、引用等其他样式更改
* 2018.05.24 v1.3.0 添加归档页;细节优化
* 2018.05.24 v1.4.0 添加文章目录
* 2018.05.25 v1.4.1 标签云支持显示为独立页面

## 下载与使用

Expand All @@ -72,9 +52,10 @@ Ghost 0.x版本默认的 Casper 十分好看,可惜1.0版本之后就改成 cm
### 注意事项

1. 归档页的使用:在 Ghost 后台新建独立页面(勾选`Turn this post into a page`),标题随意(如`归档`),页面地址为`archives`,在设置中添加指向该地址的菜单即可。
2. 主题免费使用,但请勿修改底部版权信息(虽然颜色已经调得快看不见了😂)。
3. 该主题仅适用于 Ghost 1.0 及以上版本,0.x版本不支持。
4. 欢迎 Fork 本项目并修改成自己喜欢的样子。
2. 标签云的使用:默认显示在首页底部。如要做成单独页面方法同上,在 后台新建独立页面,页面地址为`tags`,最后修改菜单即可。
3. 主题免费使用,但请勿修改底部版权信息(虽然颜色已经调得快看不见了😂)。
4. 该主题仅适用于 Ghost 1.0 及以上版本,0.x版本不支持。
5. 欢迎 Fork 本项目并修改成自己喜欢的样子。欢迎提 issue。

## 其他

Expand Down
14 changes: 9 additions & 5 deletions assets/css/moegi.css
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ a:hover {

/* INDEX */

.tag-cloud {
.index-tag-cloud {
margin-top: 1.2rem;
line-height: 2;
max-width: 90%;
Expand Down Expand Up @@ -109,6 +109,10 @@ a:hover {
color: #86B81B;
}

.post-meta .tags {
margin-left: 0.6em;
}

.index-post {
padding: 1.6em 0;
border-bottom: #EBF2F6 1px solid;
Expand All @@ -117,10 +121,6 @@ a:hover {

/* TAGS */

.tags {
margin-left: 0.6em;
}

.tags a {
position: relative;
padding: 0.1em 0.6em;
Expand All @@ -144,6 +144,10 @@ a:hover {
margin: 4em 0.6em 1em 0;
}

.tag-cloud {
line-height: 2;
}


/* READ MORE */

Expand Down
4 changes: 3 additions & 1 deletion index.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@
{{! The tag below includes the post loop - partials/loop.hbs }}
{{> "loop"}}

{{> "tag-cloud"}}
<div class="index-tag-cloud center">
{{> "tag-cloud"}}
</div>

</main>
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "Moegi",
"description": "A simple & pure Ghost theme.",
"version": "1.4.0",
"description": "An elegant Ghost theme.",
"version": "1.4.1",
"engines": {
"ghost": ">=1.0.0"
},
Expand Down
26 changes: 26 additions & 0 deletions page-tags.hbs
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
{{!< default}}

{{#post}}
<header>
<div class="post-blog-title"><a href="{{@blog.url}}"><i class="iconfont icon-back"></i>&nbsp;{{@blog.title}}</a></div>
</header>

<main role="main">
<article class="page-archives">
<header class="post-header short-diver">
<h1 class="post-title">标签</h1>
<section class="post-meta">
{{#get "tags" as |tags postTags|}}
共有{{postTags.total}}个标签
{{/get}}
</section>
</header>

<div class="left">
{{> "tag-cloud"}}
</div>

</article>
</main>

{{/post}}
2 changes: 1 addition & 1 deletion partials/tag-cloud.hbs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{{! Tag Cloud }}
<div class="tag-cloud tags center">
<div class="tag-cloud tags">
{{#get "tags" limit="all" include="count.posts" order="count.posts desc" }}
{{#foreach tags}}
<a href="/tag/{{slug}}" class="tag-item">{{name}} ({{count.posts}})</a>
Expand Down
13 changes: 6 additions & 7 deletions partials/toc.hbs
Original file line number Diff line number Diff line change
@@ -1,15 +1,14 @@
{{!-- <div id="toc-panel">
<ul data-toc="div.container" data-toc-headings="h2,h3,h4"></ul>
</div> --}}
<div id="toc"></div>

{{!-- <script src="{{asset "js/jquery.toc.js"}}"></script> --}}
{{!-- 引入 支持文件 及 Tocify 插件 --}}
<script src="https://cdn.bootcss.com/jqueryui/1.12.1/jquery-ui.min.js"></script>
<script src="https://cdn.bootcss.com/jquery.tocify/1.9.0/javascripts/jquery.tocify.min.js"></script>

{{!-- 配置及生成目录 --}}
<script>
var toc = $("#toc").tocify({
selectors: "h2,h3,h4,h5",
extendPage: false,
highlightDefault: false
selectors: "h2,h3,h4,h5", // 选择要筛选的标题
extendPage: false, // 页面不够长时拉长页面,这里选择关闭因为感觉留出大片空白不好看- -
highlightDefault: false // 自动高亮第一条
});
</script>

0 comments on commit 361f4da

Please sign in to comment.