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

报纸样式驾到 #569

Merged
merged 7 commits into from
Jul 13, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
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
60 changes: 18 additions & 42 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,47 +27,23 @@ 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 = "编辑本页 →"
tags = "关键词:"
comment = "发表/查看评论"
truncated = "……"
uncategorized = "未分类"

# 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"
commentStr1 = "使用"
commentForumStr = "统计之都论坛"
commentStr2 = "账号发表评论"
commentForumURL = "https://d.cosx.org"
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 }}
3 changes: 3 additions & 0 deletions layouts/partials/head_custom.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
<link href="//cdn.bootcss.com/highlight.js/9.12.0/styles/github.min.css" rel="stylesheet">
<link href="{{ relURL "/css/custom.css" }}" rel="stylesheet">
<script async src="//yihui.name/js/no-highlight.js"></script>
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>
21 changes: 21 additions & 0 deletions static/css/custom.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
body { color: #333; }
a { color: #f05948; }
.article-list h1 {
font-size: 1.3em;
line-height: 1.3em;
}
.article-list a { color: #333; }
.categories a { color: #666; }
@media (min-width: 715px) {
.article-list h1 {
white-space: nowrap;
overflow-x: hidden;
text-overflow: ellipsis;
}
.article-list h1:hover { white-space: normal; }
}
.header {
border-top: 5px solid #8C1F22;
border-bottom-color: #8C1F22;
}
.footer { background: #8C1F22; }
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 43269a