Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Patch 1:Codeblocks self-adaption on mobile devices #13

Open
wants to merge 131 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
131 commits
Select commit Hold shift + click to select a range
a8c0b4b
主要功能完善
tufu9441 May 25, 2015
bee60e8
归档页面年份显示
tufu9441 May 25, 2015
4f6c005
fix bug
tufu9441 May 25, 2015
19554b5
进一步完善
tufu9441 May 25, 2015
50c4b62
修正多说评论文章url的bug
tufu9441 May 26, 2015
9de1098
去除个人信息
tufu9441 May 26, 2015
0068e92
添加代码高亮主题
tufu9441 May 28, 2015
9f6712a
修正BUG,增加disqus功能
tufu9441 Jun 21, 2015
d54a4c8
更改归档显示顺序为常见形式
tufu9441 Jun 22, 2015
0125870
完善侧边栏最近评论显示功能
tufu9441 Jun 22, 2015
091afb4
增加Swiftype功能
tufu9441 Jul 7, 2015
8a521ec
添加标签云小工具
tufu9441 Jul 7, 2015
b2464f3
文章末尾添加显示分类信息
tufu9441 Jul 7, 2015
ca94cc6
显示评论数
tufu9441 Jul 7, 2015
625a315
显示评论数CSS优化
tufu9441 Jul 8, 2015
d4397cc
修复Fancybox显示效果
tufu9441 Jul 8, 2015
9d54b45
增加tinysou站内搜索功能
tufu9441 Jul 9, 2015
d9b1031
bug fixed
tufu9441 Jul 10, 2015
ac72728
bug fixed
tufu9441 Jul 23, 2015
2236877
duoshuo bug fixed
tufu9441 Aug 17, 2015
e4d253d
完善fancy box功能,并可以在部分图片上禁用fancybox
tufu9441 Oct 11, 2015
9adcae2
修复apple-touch-icon不显示的bug
tufu9441 Oct 11, 2015
6d9cf2e
更新README
tufu9441 Oct 12, 2015
2b10b96
添加Read More按钮
tufu9441 Oct 15, 2015
bb5c6df
optimized
tufu9441 Oct 15, 2015
054da54
README updated
tufu9441 Oct 15, 2015
d211f62
README updated
tufu9441 Oct 16, 2015
414e285
css optimized
tufu9441 Oct 16, 2015
c969fe0
README updated
tufu9441 Oct 16, 2015
295d291
fix languages/en.yml html tags
v123582 Oct 23, 2015
b8ae66b
fix layout/post.jade condition
v123582 Oct 23, 2015
e0c5fc3
Merge pull request #1 from v123582/master
tufu9441 Oct 23, 2015
b67c07b
优化英文界面
tufu9441 Oct 23, 2015
c84d1a3
README updated
tufu9441 Oct 24, 2015
4f81110
Update preview image
tufu9441 Oct 24, 2015
7f1eb11
Footer information updated
tufu9441 Oct 25, 2015
90c475a
文章后添加多说分享按钮
tufu9441 Oct 25, 2015
95ac23a
优化多说评论框样式,统一时间格式
tufu9441 Oct 25, 2015
8b681c9
优化文章中分类显示
tufu9441 Oct 25, 2015
9dab461
A bug fixed and README updated
tufu9441 Oct 26, 2015
0b3761c
整合highlight css,使用hexo自带代码高亮功能
tufu9441 Oct 26, 2015
4c1c26c
优化代码高亮样式
tufu9441 Oct 26, 2015
3174f76
添加IcoMoon字体图标
tufu9441 Oct 27, 2015
ad2e716
README updated
tufu9441 Oct 27, 2015
54e97f9
Wrong file paths when the site is in a subdirectory bug fixed
jvalen Oct 28, 2015
b67f654
Merge pull request #4 from jvalen/master
tufu9441 Oct 28, 2015
7ffd458
README updated
tufu9441 Oct 28, 2015
dfb144f
Post-navigator added, instead of page-navigator in posts.
tufu9441 Oct 28, 2015
95f14bc
a minor bug fixed
tufu9441 Oct 28, 2015
aa3424c
a font bug fixed
tufu9441 Oct 28, 2015
0706700
TOC function is supported now.
tufu9441 Oct 31, 2015
3b2b2ee
TOC optimized and README updated
tufu9441 Nov 1, 2015
35143ab
README updated
tufu9441 Nov 1, 2015
b9d45c5
A minor optimization.
tufu9441 Nov 1, 2015
14fdbf7
bug fixed
tufu9441 Nov 1, 2015
52374f4
Some minor optimizations.
tufu9441 Nov 2, 2015
e97c667
Simplify the method of editing blogroll
tufu9441 Nov 2, 2015
484e91f
improve disqus usage
tufu9441 Nov 3, 2015
2db7289
README and LICENSE updated
tufu9441 Nov 3, 2015
ade0ae7
README updated
tufu9441 Nov 3, 2015
a32d21e
a bug fixed
tufu9441 Nov 3, 2015
3a681bd
a bug fixed
tufu9441 Nov 3, 2015
378bf11
fix a bug
tufu9441 Nov 3, 2015
7e660df
Modify the style.css and fix some bugs.
Nov 3, 2015
094c934
Merge pull request #6 from ArtinHuang/master
tufu9441 Nov 4, 2015
2d7238b
remove sharethis because of too many unnecessary js, and improve the …
tufu9441 Nov 4, 2015
f1ec634
Add other search engines and optimize search-form css
tufu9441 Nov 5, 2015
bb1be8c
no message
tufu9441 Nov 5, 2015
39e6f72
no message
tufu9441 Nov 5, 2015
e63eb7e
integrate menu settings to _config.yml
tufu9441 Nov 6, 2015
806dd4c
fix a bug
tufu9441 Nov 6, 2015
ccbde5c
Optimization of fancybox and css
tufu9441 Nov 7, 2015
582405d
fancybox coding optimized
tufu9441 Nov 9, 2015
4742c77
html coding optimized
tufu9441 Nov 9, 2015
8930240
A bug fixed
tufu9441 Nov 11, 2015
59861c7
fix table invisible
v123582 Nov 13, 2015
d7658f8
post.excerpt bug fixed
tufu9441 Nov 14, 2015
ac72a10
fix code section error
v123582 Nov 24, 2015
fb9dee6
Update style.scss
v123582 Nov 25, 2015
8553982
Merge pull request #9 from v123582/master
tufu9441 Nov 25, 2015
e4257a3
table style optimized
tufu9441 Nov 25, 2015
5df89f2
minor improvements
tufu9441 Nov 26, 2015
0ffb585
A bug fixed
tufu9441 Nov 26, 2015
bd690e1
text align justify
tufu9441 Nov 29, 2015
c39e695
fixed a bug in English display
tufu9441 Dec 2, 2015
43337c2
Merge branch 'master' of https://github.com/icylogic/maupassant-hexo
tufu9441 Dec 3, 2015
624f9fe
nothing important
tufu9441 Dec 3, 2015
8b79610
Optimization of google site search.
tufu9441 Dec 3, 2015
4331ef7
syntax highlighting theme changed to a light style
tufu9441 Dec 3, 2015
37aa0bc
a minor typo fixed
tufu9441 Dec 3, 2015
93d8623
新增繁體中文語系
nfs1a Dec 5, 2015
b970762
Merge pull request #18 from nfs1a/master
tufu9441 Dec 6, 2015
0145a5e
highlight css updated
tufu9441 Dec 6, 2015
e5f0a44
bugs fixed
tufu9441 Dec 6, 2015
9d4a692
a bug fixed
tufu9441 Dec 6, 2015
f0f029e
表格内文字居中
tufu9441 Dec 6, 2015
580a418
Create es-ES.yml
okelet Dec 9, 2015
eed1344
Merge pull request #19 from okelet/patch-1
tufu9441 Dec 10, 2015
261c3d9
highlight and table style updated
tufu9441 Dec 10, 2015
9c504a6
add google analytics support
sabrinaluo Dec 11, 2015
83c1b6f
Merge pull request #22 from sabrinaluo/patch-1
tufu9441 Dec 12, 2015
303c7ab
Some improvements
tufu9441 Dec 12, 2015
5b9d7f9
bug fix for google analytics
sabrinaluo Dec 12, 2015
1c2a951
Merge pull request #23 from sabrinaluo/patch-1
tufu9441 Dec 12, 2015
58a8d85
fix bad title href when site is in a subdirectory
suiteki Dec 15, 2015
eb77db9
Merge pull request #24 from hythyt9898/patch-1
tufu9441 Dec 15, 2015
7c54e0c
baidu analytics added
tufu9441 Dec 17, 2015
d563f10
fix title href when site's root is /
AbandonZHANG Dec 18, 2015
2d03ba2
Merge pull request #27 from AbandonZHANG/tufu9441-update
tufu9441 Dec 21, 2015
881d7be
css update
tufu9441 Dec 23, 2015
cac171d
css update
tufu9441 Dec 23, 2015
4d95cd8
function optimized
tufu9441 Dec 25, 2015
4eb47bf
table css updated
tufu9441 Dec 25, 2015
91f5ca6
Remove redundant prefix slashes
Dec 29, 2015
e0a8672
Some hack to make 'home' links actually work ...
Dec 29, 2015
096e233
Use url_for() helper required by offical doc
Dec 29, 2015
13275ac
Self-adaptive RSS feed header
Dec 29, 2015
ccb44e8
Merge pull request #31 from alemonmk/hack-and-patch
tufu9441 Dec 30, 2015
7205c12
back-to-top optimized
tufu9441 Dec 30, 2015
839b256
Make comment feature default on for pages while controllable by front…
7ffe Dec 30, 2015
e69fd38
Merge pull request #32 from handsdirty/master
tufu9441 Dec 30, 2015
e154ce0
minor improvements
tufu9441 Dec 30, 2015
2b0e347
fix issue #33
tufu9441 Dec 31, 2015
a12e028
highlight css updated
tufu9441 Jan 8, 2016
52d249a
highlight css updated
tufu9441 Jan 12, 2016
4a0264a
css updated
tufu9441 Jan 13, 2016
608297f
a bug fixed
tufu9441 Jan 14, 2016
3751a8d
README updated
tufu9441 Jan 23, 2016
2c4a3b1
Codeblocks resize on mobile devices
tufu9441 Jan 24, 2016
471fbef
Codeblocks resize on mobile devices
mekhi Jan 24, 2016
1a8aaeb
Codeblocks self-adaption on mobile devices
mekhi Jan 24, 2016
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
language: node_js
node_js:
- "4.1"
install:
npm install
7 changes: 7 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
Copyright (c) 2015 tufu9441

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
125 changes: 111 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,32 +1,129 @@
maupassant
==========
# Maupassant

A simple Hexo template with great performance on different devices.
[![Build Status](https://travis-ci.org/tufu9441/maupassant-hexo.svg?branch=master)](https://travis-ci.org/tufu9441/maupassant-hexo) [![GitHub license](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/tufu9441/maupassant-hexo/blob/master/LICENSE)

![template preview](https://ddydeg.by3302.livefilestore.com/y2p1ZgHER4eIFaEHhwaf96MvZH4_iLufEIDj7o8acDgI1GXFDtPI-eRAgvokFoR9irbz738gMmWc_N7yexG6uhB1Dcmelb0cXg8HexpiAdZ5HQ/m.png "Maupassant template preview")
> 大道至简

## Install
[Preview](https://www.haomwei.com)|[中文文档](https://www.haomwei.com/technology/maupassant-hexo.html)

- install renderers
A simple Hexo template with great performance on different devices, ported from a Typecho theme by [Cho](https://github.com/pagecho/maupassant/), forked and modified from [icylogic](https://github.com/icylogic/maupassant-hexo/).

![template preview](http://ooo.0o0.ooo/2015/10/24/562b5be12177e.jpg
"Maupassant template preview")

## Installation
Install theme and renderers:

```
git clone https://github.com/icylogic/maupassant-hexo.git themes/maupassant
git clone https://github.com/tufu9441/maupassant-hexo.git themes/maupassant
npm install hexo-renderer-sass --save
npm install hexo-renderer-jade --save
```

- Edit _config.yml in hexo root, change `theme` to `maupassant`
Then change your `theme` setting in `_config.yml` to `maupassant`.

## Configuration
Default config:

```
fancybox: true ## If you want to use fancybox please set the value to true
duoshuo: ## Your duoshuo_shortname, e.g. haomwei
disqus: ## Your disqus_shortname, e.g. haomwei
google_search: true ## Use Google search, true/false
baidu_search: ## Use Baidu search, true/false
swiftype: ## Your swiftype_key, e.g. m7b11ZrsT8Me7gzApciT
tinysou: ## Your tinysou_key, e.g. 4ac092ad8d749fdc6293
google_analytics: ## Your Google Analytics tracking id, e.g. UA-42425684-2
baidu_analytics: ## Your Baidu Analytics tracking id, e.g. 8006843039519956000

menu:
- page: home
directory: .
icon: icon-home
- page: archive
directory: archives/
icon: icon-archive
- page: about
directory: about/
icon: icon-about
- page: rss
directory: atom.xml
icon: icon-rss

widgets: ## Six widgets in sidebar provided: search, category, tag, recent_posts, rencent_comments and links.
- search
- category
- tag
- recent_posts
- recent_comments
- links

links:
- title: site-name1
url: http://www.example1.com/
- title: site-name2
url: http://www.example2.com/
- title: site-name3
url: http://www.example3.com/
```
- fancybox - Enable [Fancybox](http://fancyapps.com/fancybox/)
- duoshuo - [Duoshuo](http://duoshuo.com) shortname
- disqus - [Disqus](https://disqus.com) shortname
- google_search - Default search engine
- baidu_search - Search engine for users in China
- swiftype - [Swiftype Search](https://swiftype.com) key
- tinysou - [Tiny Search](http://tinysou.com) key
- google_analytics - [Google Analytics](https://www.google.com/analytics/) tracking id
- baidu_analytics - [Baidu Analytics](http://tongji.baidu.com) tracking id
- menu - Customize your menu of pages here, just follow the format of existied items. Don't forget to create corresponding folders inlcuding `index.md` in `source` folder to ensure the pages will correctly display. [IcoMoon](https://icomoon.io) icon fonts have been integrated, and you can choose other icons you like [here](https://icomoon.io/app/#/select) and use them according to the [instruction](https://icomoon.io/#docs)
- widgets - Choose and arrange the widgets in sidebar here
- links - Edit your blogroll here

##Features
#### Logo
You can set a **favicon.ico** for your website, please put it into `source` folder of hexo directory, recommended size: 32px*32px.

You can add a website logo for apple devices, please put an image named **apple-touch-icon.png** into `source` folder of hexo directory, recommended size: 114px*114px.

#### Abstract
You can control the abstract of a post shown at index, by either filling a `description:` item in `front-matter` of the `post.md`, or just inserting a `<!--more-->` before your hidden content.

#### Table of Contents
TOC in a post can be enabled by adding a `toc: true` item in `front-matter`.

#### Comments
Comment feature of each post and page can be enabled (default) and disabled by adding a `comments: true` or `comments: false` in `front-matter`. This could be useful when you want comment feature for guestbook page, but don't want comment feature for about page.

#### Syntax Highlighting
Highlighted code showcase is supported, please set the `highlight` option in `_config.yml` of hexo directory like this:

```
highlight:
enable: true
auto_detect: true
line_number: true
tab_replace:
```

#### Languages
Four languages are available for this theme currently: Simplified Chinese (zh-CN), Traditional Chinese (zh-TW), English (en) and Spanish (es-ES). Contributions of translating to other languages will be highly appreciated.

## Solutions
- Check whether your Terminal's current directory is in hexo's root directory which contains `source/`, `themes/`, etc.

## Probable solutions
- If you have any trouble in using this theme, please feel free to open an [issue](https://github.com/tufu9441/maupassant-hexo/issues).

- Check version of hexo and review ![Migrating from 2.x to 3.0](https://github.com/hexojs/hexo/wiki/Migrating-from-2.x-to-3.0)
- Check if your terminal's current directory is hexo's root directory which contains `source/`, `themes/`, etc.
- Feel free to open an [issue](https://github.com/icylogic/maupassant-hexo/issues/new)
## Contributing
All kinds of contributions (enhancements, new features, documentation & code improvements, issues & bugs reporting) are welcome.

## Maupassant on different platform:
Looking forward to your pull request.

## Acknowledgements
Thank [JamesPan](http://blog.jamespan.me) for his help to improve this theme
.
## Maupassant on other platforms:
+ Typecho:https://github.com/pagecho/maupassant/
+ Octopress:https://github.com/pagecho/mewpassant/
+ Farbox:https://github.com/pagecho/Maupassant-farbox/
+ Wordpress:https://github.com/iMuFeng/maupassant/
+ Hexo: https://github.com/icylogic/maupassant-hexo/
+ Ghost: https://github.com/LjxPrime/maupassant/
41 changes: 39 additions & 2 deletions _config.yml
Original file line number Diff line number Diff line change
@@ -1,2 +1,39 @@
fancybox: true
duoshuo: # your duoshuo id
fancybox: true ## If you want to use fancybox please set the value to true
duoshuo: ## Your duoshuo_shortname, e.g. haomwei
disqus: ## Your disqus_shortname, e.g. haomwei
google_search: true ## Use Google search, true/false
baidu_search: ## Use Baidu search, true/false
swiftype: ## Your swiftype_key, e.g. m7b11ZrsT8Me7gzApciT
tinysou: ## Your tinysou_key, e.g. 4ac092ad8d749fdc6293
google_analytics: ## Your Google Analytics tracking id, e.g. UA-42425684-2
baidu_analytics: ## Your Baidu Analytics tracking id, e.g. 8006843039519956000

menu:
- page: home
directory: .
icon: icon-home
- page: archive
directory: archives/
icon: icon-archive
- page: about
directory: about/
icon: icon-about
- page: rss
directory: atom.xml
icon: icon-rss

widgets: ## Six widgets in sidebar provided: search, category, tag, recent_posts, rencent_comments and links.
- search
- category
- tag
- recent_posts
- recent_comments
- links

links:
- title: site-name1
url: http://www.example1.com/
- title: site-name2
url: http://www.example2.com/
- title: site-name3
url: http://www.example3.com/
16 changes: 13 additions & 3 deletions languages/en.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,21 @@
reading_label: currently reading articles under <b>%s</b>
reading_label: Reading articles in %s
blog: Blog
albums: Albums
categories: Categories
tags: Tags
archive: Archive
links: Links
about: About
recent: Recent
previous: Previous
next: Next
no-title: No Title
previous: Previous
notitle: No Title
blogroll: Blogroll
history: History
rss: RSS
guestbook: Guestbook
home: Home
recent_comments: Recent Comments
Readmore: Read More
belongsto: Categorized in
contents: Contents
21 changes: 21 additions & 0 deletions languages/es-ES.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
reading_label: Leyendo artículos en %s
blog: Blog
albums: Álbums
categories: Categorías
tags: Etiquetas
archive: Archivo
links: Enlaces
about: Acerca de
recent: Recientes
next: Siguiente
previous: Anterior
notitle: Sin título
blogroll: Blogroll
history: Historial
rss: RSS
guestbook: Libro de visitas
home: Inicio
recent_comments: Comentarios recientes
Readmore: Leer más
belongsto: Guardado en
contents: Contenidos
12 changes: 11 additions & 1 deletion languages/zh-CN.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,20 @@ reading_label: 正在查看 %s 下的文章
blog: 博客
albums: 相册
categories: 分类
tags: 标签
archive: 归档
links: 链接
about: 关于
recent: 最新文章
next: 下一页
previous: 上一页
no-title: 无题
notitle: 无题
blogroll: 友情链接
history: 历史
rss: 订阅
guestbook: 留言
home: 首页
recent_comments: 最近评论
Readmore: 阅读更多
belongsto: 分类于
contents: 文章目录
21 changes: 21 additions & 0 deletions languages/zh-TW.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
reading_label: 正在查看 %s 下的文章
blog: 部落格
albums: 相簿
categories: 分類
tags: 標籤
archive: 所有文章
links: 連結
about: 關於
recent: 最新文章
next: 下一頁
previous: 上一頁
notitle: 無標題
blogroll: 友站連結
history: 歷史紀錄
rss: 訂閱
guestbook: 留言
home: 首頁
recent_comments: 最近評論
Readmore: 閱讀更多
belongsto: 分類於
contents: 文章目錄
61 changes: 61 additions & 0 deletions layout/_partial/after_footer.jade
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
!= js(url_for('js/codeblock-resizer.js'))

if theme.fancybox
!= js([url_for('js/fancybox.pack.js'), url_for('js/jquery.fancybox.js')])
!= css(url_for('css/jquery.fancybox.css'))

if theme.duoshuo
script.
var duoshuoQuery = {short_name:'#{theme.duoshuo}'};
(function() {
var ds = document.createElement('script');
ds.type = 'text/javascript';ds.async = true;
ds.src = (document.location.protocol == 'https:' ? 'https:' : 'http:') + '//static.duoshuo.com/embed.js';
ds.charset = 'UTF-8';
(document.getElementsByTagName('head')[0]
|| document.getElementsByTagName('body')[0]).appendChild(ds);
})();

if theme.tinysou
script.
var option = {
engineKey: '#{theme.tinysou}'
};
(function(w,d,t,u,n,s,e){
s = d.createElement(t);
s.src = u;
s.async = 1;
w[n] = function(r){
w[n].opts = r;
};
e = d.getElementsByTagName(t)[0];
e.parentNode.insertBefore(s, e);
})(window,document,'script','//tinysou-cdn.b0.upaiyun.com/ts.js','_ts');
_ts(option);

if theme.swiftype
script.
(function(w,d,t,u,n,s,e){w['SwiftypeObject']=n;w[n]=w[n]||function(){
(w[n].q=w[n].q||[]).push(arguments);};s=d.createElement(t);
e=d.getElementsByTagName(t)[0];s.async=1;s.src=u;e.parentNode.insertBefore(s,e);
})(window,document,'script','//s.swiftypecdn.com/install/v2/st.js','_st');

_st('install','#{theme.swiftype}','2.0.0');

if theme.google_analytics
script.
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','https://www.google-analytics.com/analytics.js','ga');
ga('create','#{theme.google_analytics}','auto');ga('send','pageview');

if theme.baidu_analytics
script.
var _hmt = _hmt || [];
(function() {
var hm = document.createElement("script");
hm.src = "//hm.baidu.com/hm.js?#{theme.baidu_analytics}";
var s = document.getElementsByTagName("script")[0];
s.parentNode.insertBefore(hm, s);
})();
26 changes: 14 additions & 12 deletions layout/_partial/comments.jade
Original file line number Diff line number Diff line change
@@ -1,14 +1,16 @@
if theme.duoshuo
.ds-thread(data-thread-key=page.path, date-title=page.title, data-url=url_for(page.path))
script.
var duoshuoQuery = {short_name:"!{theme.duoshuo}"};
(function() {
var ds = document.createElement('script');
ds.type = 'text/javascript';ds.async = true;
ds.src = (document.location.protocol == 'https:' ? 'https:' : 'http:') + '//static.duoshuo.com/embed.js';
ds.charset = 'UTF-8';
(document.getElementsByTagName('head')[0]
|| document.getElementsByTagName('body')[0]).appendChild(ds);
})();

.ds-thread(data-thread-key=page.path, data-title=page.title, data-url=page.permalink, data-author-key='1')

if theme.disqus
#disqus_thread
script.
var disqus_shortname = '#{theme.disqus}';
var disqus_identifier = '#{page.path}';
var disqus_title = '#{page.title}';
var disqus_url = '#{config.url}/#{page.path}';
(function() {
var dsq = document.createElement('script'); dsq.type = 'text/javascript'; dsq.async = true;
dsq.src = '//' + disqus_shortname + '.disqus.com/embed.js';
(document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(dsq);
})();
script(id='dsq-count-scr' src='//#{theme.disqus}.disqus.com/count.js' async)
8 changes: 5 additions & 3 deletions layout/_partial/helpers.jade
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
mixin a_with_current(href, content, id)
- var url = url_for(href)
if (href == '/' && (is_home() || is_post())) || is_current(href)
a.current(id=id, href=url)= content
if (href == '.' && (is_home() || is_post())) || is_current(href)
a.current(href=url)
i(class=id)= ' ' + content
else
a(id=id, href=url)= content
a(href=url)
i(class=id)= ' ' + content

mixin title(page)
if page
Expand Down
Loading