Skip to content

Commit

Permalink
close #548: 报纸样式驾到
Browse files Browse the repository at this point in the history
  • Loading branch information
yihui committed Jul 10, 2017
1 parent 4e8d408 commit c7b4344
Show file tree
Hide file tree
Showing 18 changed files with 36 additions and 137 deletions.
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[submodule "themes/hugo-xmag"]
path = themes/hugo-xmag
url = https://github.com/yihui/hugo-xmag.git
58 changes: 17 additions & 41 deletions config.toml
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
baseurl = "https://cosx.org/"
languageCode = "zh-CN"
title = "统计之都"
theme = "hugo-steam-cos"
theme = "hugo-xmag"
disqusShortname = ""
googleAnalytics = "UA-1988641-11"
paginate = 10
paginate = 12
ignoreFiles = ["\\.Rmd$", "_files$", "_cache$"]
hasCJKLanguage = true
enableEmoji = true
Expand All @@ -27,46 +27,22 @@ footnotereturnlinkcontents = "↩"
url = "https://d.cosx.org"
weight = 3

[params]
logoFull = "![统计之都标志](/img/logo-full.png)"
subtitle = ""
copyright = "版权所有"

# You can choose between green, orange, red and blue.
themecolor = "red"
[params.banner]
src = "/img/logo-full.png"
alt = "统计之都 标志"

# Link custom assets relative to /static
favicon = "favicon.ico"
customCSS = ["css/fonts.css"]
customJS = []
[params.text]
back = "← 返回首页"
edit = "编辑本页 →"
more = "阅读全文 →"
tags = "关键词:"
comment = "发表/查看评论"

# To provide some metadata for search engines and the about section in the footer
# feel free to add a few information about you and your website.
name = "统计之都"
bio = "专业、人本、正直的统计学网站"
[params]
copyright = "统计之都 版权所有 2006 - 2017"
description = "中国统计学门户网站,免费统计学服务平台"

# Link your social networks (optional)
location = "中国,北京"
twitter = "cos_name"
linkedin = "../groups/4564122"
googleplus = "110727350576315935180"
facebook = ""
instagram = ""
github = "cosname"
gitlab = ""
bitbucket = ""

# Customize or translate the strings
keepReadingStr = "阅读全文"
backtotopStr = "返回顶端"
shareStr = "分享"
pageNotFoundTitle = "404 - 页面不存在"

useSummaryIfNoDescription = true

postCopyrightStr = "敬告各位友媒,如需转载,请与统计之都小编联系(直接留言或发至邮箱:[email protected]),获准转载的请在显著位置注明作者和出处(转载自:统计之都),并在文章结尾处附上统计之都二维码。"
postCopyrightImgAddr = "https://uploads.cosx.org/images/wechat-qrcode.png"
commentStr = "参与本文讨论请访问"
commentForumStr = "统计之都论坛"
commentForumURL = "https://d.cosx.org/d/"
summary_length = 200
github_edit = "https://github.com/cosname/cosx.org/edit/master/content/"
comment_url = "https://d.cosx.org/d/"
footer = "© [统计之都](https://cosx.org) 2006 - 2017 | [新浪微博](http://weibo.com/cosname) | [Github](https://github.com/cosname) | [Twitter](https://twitter.com/cos_name) | [Google+](https://plus.google.com/110727350576315935180) | [LinkedIn](https://www.linkedin.com/groups/4564122)"
2 changes: 1 addition & 1 deletion content/search.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ menu: main
<div class="input-group">
<input type="text" class="form-control" id="q" />
<span class="input-group-btn">
<button onclick='search.helper.search();'><i class="fa fa-search"></i></button>
<button onclick='search.helper.search();'>搜索</button>
</span>
</div>
</div>
Expand Down
5 changes: 5 additions & 0 deletions layouts/partials/comments.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{{ if and .Params.forum_id .Site.Params.comment_url }}
<section class="comments">
<p><a href="{{ .Site.Params.comment_url }}{{ .Params.forum_id }}">{{ default "View Comments" .Site.Params.text.comment }}</a></p>
</section>
{{ end }}
4 changes: 4 additions & 0 deletions layouts/partials/info.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<section class="article-meta article-footer">
<p>敬告各位友媒,如需转载,请与统计之都小编联系(直接留言或发至邮箱:[email protected]),获准转载的请在显著位置注明作者和出处(转载自:统计之都),并在文章结尾处附上统计之都微信二维码。</p>
<p><img src="https://uploads.cosx.org/images/wechat-qrcode.png" style="max-width:200px;" /></p>
</section>
40 changes: 0 additions & 40 deletions static/css/fonts.css

This file was deleted.

Binary file removed static/fonts/merriweather-latin-700.woff
Binary file not shown.
Binary file removed static/fonts/merriweather-latin-700.woff2
Binary file not shown.
Binary file removed static/fonts/merriweather-latin-regular.woff
Binary file not shown.
Binary file removed static/fonts/merriweather-latin-regular.woff2
Binary file not shown.
Binary file removed static/fonts/open-sans-condensed-latin-300.woff
Binary file not shown.
Binary file removed static/fonts/open-sans-condensed-latin-300.woff2
Binary file not shown.
Binary file removed static/fonts/open-sans-latin-regular.woff
Binary file not shown.
Binary file removed static/fonts/open-sans-latin-regular.woff2
Binary file not shown.
Binary file removed static/fonts/roboto-slab-latin-regular.woff
Binary file not shown.
Binary file removed static/fonts/roboto-slab-latin-regular.woff2
Binary file not shown.
60 changes: 5 additions & 55 deletions static/js/search.js
Original file line number Diff line number Diff line change
@@ -1,18 +1,12 @@
/* global instantsearch */
(function() {

var search = instantsearch({
appId: 'VB9T8VTPNU',
apiKey: 'cb3265feef0bb0b4bc7f8a4a4986456a',
indexName: 'cosx.org',
urlSync: {},
searchFunction: function(helper) {
var searchResults = $('.search-results');
if (helper.state.query === '') {
searchResults.hide();
return;
}
helper.search();
searchResults.show();
if (helper.state.query !== '') helper.search();
}
});

Expand All @@ -23,12 +17,6 @@ search.addWidget(
})
);

// search.addWidget(
// instantsearch.widgets.stats({
// container: '#stats'
// })
// );

var hitTemplate =
'<article class="preview">' +
'<header>' +
Expand Down Expand Up @@ -56,53 +44,15 @@ search.addWidget(
item: hitTemplate
},
transformData: function(hit) {
if(!hit.description){
if (!hit.description){
hit.description = hit.content.slice(0,100).replace("\n","")+'...'
}
hit.date = hit.date.slice(0,10);
// hit.stars = [];
// for (var i = 1; i <= 5; ++i) {
// hit.stars.push(i <= hit.rating);
// }
console.log(hit)
return hit;
}
})
);

// search.addWidget(
// instantsearch.widgets.pagination({
// container: '#pagination',
// cssClasses: {
// root: 'pagination',
// active: 'active'
// }
// })
// );

// search.addWidget(
// instantsearch.widgets.refinementList({
// container: '#genres',
// attributeName: 'genre',
// operator: 'and',
// limit: 10,
// cssClasses: {
// list: 'nav nav-list',
// count: 'badge pull-right',
// active: 'active'
// }
// })
// );
//
// search.addWidget(
// instantsearch.widgets.starRating({
// container: '#ratings',
// attributeName: 'rating',
// cssClasses: {
// list: 'nav',
// count: 'badge pull-right'
// }
// })
// );

search.start();

})();
1 change: 1 addition & 0 deletions themes/hugo-xmag
Submodule hugo-xmag added at 27fdbe

0 comments on commit c7b4344

Please sign in to comment.