Skip to content

Commit

Permalink
添加一言副标题
Browse files Browse the repository at this point in the history
  • Loading branch information
secret committed Apr 10, 2018
1 parent 39e30fd commit 3b62243
Show file tree
Hide file tree
Showing 5 changed files with 45 additions and 13 deletions.
25 changes: 15 additions & 10 deletions _config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,16 +12,6 @@ menu:
关于: /about
友链: /links

# Gitment
gitment:
owner: isecret
repo: comments
client_id: fd2eb35d0541586fff12
client_secret: 2d3600405c3d52acc4350bde075e176cdb633cea

# 腾讯统计
tencent_analytics: 65634393

# 联系方式
social:
QQ: 572524331
Expand All @@ -36,6 +26,19 @@ favicon: /favicon.ico
# 站点 Logo
logo: /favicon.png

# 一言 hitokoto
hitokoto: enabled

# Gitment
gitment:
owner: isecret
repo: comments
client_id: fd2eb35d0541586fff12
client_secret: 2d3600405c3d52acc4350bde075e176cdb633cea

# 腾讯统计
tencent_analytics: 65634393

# CSS 样式表路径
stylesheets:
- //fonts.openapi.link/css?family=Lato:300,300italic,400,400italic,700,700italic&subset=latin,latin-ext
Expand All @@ -44,6 +47,8 @@ stylesheets:

# Javascript 脚本路径
scripts:
- /js/jquery.min.js
- /js/fetch.min.js
- /js/instantclick.min.js
- /js/gitment.browser.min.js
- /js/hola.js
19 changes: 17 additions & 2 deletions layout/layout.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -46,12 +46,12 @@ if (is_home()) pageTitle = config.title;
</head>
<body>
<div class="container">
<div class="header">
<div class="header-outer">
<div class="header-site">
<div class="header-title">
<%=config.title%>
</div>
<div class="header-subtitle">
<div id="hitokoto" class="header-subtitle">
<%=config.subtitle%>
</div>
</div>
Expand Down Expand Up @@ -96,6 +96,21 @@ if (is_home()) pageTitle = config.title;
gitment.render("gitment");
</script>
<% } %>
<% if (theme.hitokoto == 'enabled') { %>
<script>
fetch('https://v1.hitokoto.cn')
.then(function (res){
return res.json();
})
.then(function (data) {
var hitokoto = document.getElementById('hitokoto');
hitokoto.innerText = '' + data.hitokoto + '」——' + data.from;
})
.catch(function (err) {
console.error(err);
});
</script>
<% } %>
<script data-no-instant>InstantClick.init();</script>
</body>
</html>
2 changes: 1 addition & 1 deletion source/css/hola.css
Original file line number Diff line number Diff line change
Expand Up @@ -443,7 +443,7 @@ hr {
}
}

.header {
.header-outer {
min-width: 100%;
display: inline-block;
padding: 10px 0;
Expand Down
8 changes: 8 additions & 0 deletions source/js/fetch.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions source/js/jquery.min.js

Large diffs are not rendered by default.

0 comments on commit 3b62243

Please sign in to comment.