Skip to content

Commit

Permalink
update footer
Browse files Browse the repository at this point in the history
  • Loading branch information
zdying committed Sep 16, 2017
1 parent 7c93b27 commit df2649f
Show file tree
Hide file tree
Showing 6 changed files with 107 additions and 6 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -63,4 +63,5 @@ typings/
# hexo
.deploy*/
public/
db.json

2 changes: 1 addition & 1 deletion db.json

Large diffs are not rendered by default.

20 changes: 20 additions & 0 deletions scripts/helpers.js
Original file line number Diff line number Diff line change
Expand Up @@ -195,3 +195,23 @@ hexo.extend.helper.register('disqus_lang', function() {

return data.disqus_lang || lang;
});

hexo.extend.helper.register('footer_links', function(type) {
var lang = this.page.lang;
var data = this.site.data.footerlinks[lang][type];
var html = [
'<ul class="links">'
];

_.each(data, function (link, title) {
html.push(
'<li class="link-item">',
'<a href="' + link + '" target="_blank">' + title + '</a>',
'</li>'
);
});

html.push('</ul>');

return html.join('');
});
37 changes: 37 additions & 0 deletions source/_data/footerlinks.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
en:
licenses:
'hiproxy LICENSE: MIT': 'https://github.com/hiproxy/hiproxy/blob/master/LICENSE'
'Doc LICENSE: CC BY 4.0': 'http://creativecommons.org/licenses/by/4.0/'
github:
Organization: https://github.com/hiproxy
Project Code: https://github.com/hiproxy/hiroxy
Docmentation Code: https://github.com/hiproxy/documentation
libs:
hemsl: https://github.com/hemsl/hemsl
step-flow: https://github.com/hiproxy/step-flow
conf-parser: https://github.com/hiproxy/conf-parser
open-browser: https://github.com/hiproxy/open-browser
links:
qfight: https://github.com/qfight
YMFE: http://ued.qunar.com/ymfe/about
Qunar UED: http://ued.qunar.com/
去哪儿网: https://www.qunar.com

zh-cn:
licenses:
'hiproxy许可: MIT': 'https://github.com/hiproxy/hiproxy/blob/master/LICENSE'
'文档许可: CC BY 4.0': 'http://creativecommons.org/licenses/by/4.0/'
github:
组织: https://github.com/hiproxy
项目源码: https://github.com/hiproxy/hiroxy
文档源码: https://github.com/hiproxy/documentation
libs:
hemsl: https://github.com/hemsl/hemsl
step-flow: https://github.com/hiproxy/step-flow
conf-parser: https://github.com/hiproxy/conf-parser
open-browser: https://github.com/hiproxy/open-browser
links:
qfight: https://github.com/qfight
YMFE: http://ued.qunar.com/ymfe/about
Qunar UED: http://ued.qunar.com/
去哪儿网: https://www.qunar.com
32 changes: 27 additions & 5 deletions themes/navy/layout/partial/footer.swig
Original file line number Diff line number Diff line change
@@ -1,12 +1,34 @@
<footer id="footer" class="wrapper">
<div class="inner">
<div id="footer-copyright">
&copy; {{ moment(Date.now()).year() }} <a href="https://github.com/hiproxy/hiproxy/graphs/contributors" target="_blank">{{ config.author }}</a><br>
Documentation licensed under <a href="http://creativecommons.org/licenses/by/4.0/" target="_blank">CC BY 4.0</a>.
<div class="column">
<p class="column-title">
&copy; {{ moment(Date.now()).year() }} <a href="https://github.com/hiproxy/hiproxy/graphs/contributors" target="_blank">{{ config.author }}</a><br>
</p>
{{ footer_links('licenses') }}
</div>
<div id="footer-links">
<div class="column">
<p class="column-title">
<i class="fa fa-github"></i> Github
</p>
{{ footer_links('github') }}
</div>
<div class="column">
<p class="column-title">
<i class="fa fa-code"></i> 相关项目
</p>
{{ footer_links('libs') }}
</div>
<div class="column">
<p class="column-title">
<i class="fa fa-link"></i> 相关链接
</p>
{{ footer_links('links') }}
</div>
<!--
<div class="column" id="other-links">
<a href="https://twitter.com/{{ config.twitter }}" class="footer-link" target="_blank"><i class="fa fa-twitter"></i></a>
<a href="https://github.com/{{ config.github }}" class="footer-link" target="_blank"><i class="fa fa-github-alt"></i></a>
<a href="https://github.com/{{ config.github }}" class="footer-link" target="_blank"><i class="fa fa-github"></i></a>
</div>
-->
</div>
</footer>
21 changes: 21 additions & 0 deletions themes/navy/source/css/_partial/footer.styl
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,27 @@
transition: 0.2s
&:hover
color: #fff
.column
@media mq-normal
margin-top: 0
width: 25%
float: left
width: 100%
margin-top: 3em
&:first-child
margin-top: 0
.column-title
margin-bottom: 1em
font-weight: bold
i
margin-right .5em
.links
.link-item
padding-left: 0
list-style: none
margin-top: 10px
&:first-child
margin-top: 0

#footer-copyright
line-height: 1.4
Expand Down

0 comments on commit df2649f

Please sign in to comment.