Permalink
Browse files

style: code review/linting 规范代码样式

Review and restructure the code I wrote.
修改调整我写的代码,使其符合代码规范。

http://moxfive.xyz/2015/11/09/web-style-guide/
  • Loading branch information...
MOxFIVE committed Dec 17, 2015
1 parent 8fd12f5 commit cbe3921fa15ae31f9c7a165e8f727287c87ad78b
@@ -57,17 +57,17 @@
<% } %>
</article>
<% if (!index && post.toc != false && !is_page()){ %>
<%- partial('_partial/toc') %>
<%- partial('_partial/toc') %>
<% } %>
<% if (!index && theme.share){ %>
<%- partial('post/share') %>
<% } %>
<% if (!index && theme.duoshuo && post.comments){ %>
<%- partial('post/duoshuo', {
key: post.path,
title: post.title,
url: config.url+url_for(post.path)
<%- partial('post/duoshuo', {
key: post.path,
title: post.title,
url: config.url+url_for(post.path),
}) %>
<% } %>
@@ -90,48 +90,49 @@
<% } %>
<% if (!index && post.comments){ %>
<style type="text/css">
#scroll {
display: none;
}
<style>
#scroll {
display: none;
}
</style>
<div class="scroll">
<a href="#" title="返回顶部"><i class="fa fa-arrow-up"></i></a>
<a href="#comments" title="查看评论"><i class="fa fa-comments-o"></i></a>
<a href="#footer" title="转到底部"><i class="fa fa-arrow-down"></i></a>
<a href="#" title="返回顶部"><i class="fa fa-arrow-up"></i></a>
<a href="#comments" title="查看评论"><i class="fa fa-comments-o"></i></a>
<a href="#footer" title="转到底部"><i class="fa fa-arrow-down"></i></a>
</div>
<% } %>
<%- partial('_partial/post-nav-button') %>
<% if (post.fancybox != false){ %>
<% if (theme.fancybox){ %>
<%- css('fancybox/jquery.fancybox') %>
<script>
var yiliaConfig = {
fancybox: <%=theme.fancybox%>,
mathjax: <%=theme.mathjax%>,
animate: <%=theme.animate%>,
isHome: <%=is_home()%>,
isPost: <%=is_post()%>,
isArchive: <%=is_archive()%>,
isTag: <%=is_tag()%>,
isCategory: <%=is_category()%>,
open_in_new: <%=theme.open_in_new%>
}
var yiliaConfig = {
fancybox: <%=theme.fancybox%>,
mathjax: <%=theme.mathjax%>,
animate: <%=theme.animate%>,
isHome: <%=is_home()%>,
isPost: <%=is_post()%>,
isArchive: <%=is_archive()%>,
isTag: <%=is_tag()%>,
isCategory: <%=is_category()%>,
open_in_new: <%=theme.open_in_new%>
}
</script>
<% } %>
<% } %>
<% } else { %>
<script>
var yiliaConfig = {
fancybox: false,
mathjax: <%=theme.mathjax%>,
animate: <%=theme.animate%>,
isHome: <%=is_home()%>,
isPost: <%=is_post()%>,
isArchive: <%=is_archive()%>,
isTag: <%=is_tag()%>,
isCategory: <%=is_category()%>,
open_in_new: <%=theme.open_in_new%>
}
</script>
<script>
var yiliaConfig = {
fancybox: false,
mathjax: <%=theme.mathjax%>,
animate: <%=theme.animate%>,
isHome: <%=is_home()%>,
isPost: <%=is_post()%>,
isArchive: <%=is_archive()%>,
isTag: <%=is_tag()%>,
isCategory: <%=is_category()%>,
open_in_new: <%=theme.open_in_new%>
}
</script>
<% } %>
@@ -1,26 +1,26 @@
<% if (theme.background_image){ %>
<script>
var backgroundnum = <%= theme.background_image %>;
var backgroundimg = "url(/background/bg-x.jpg)".replace(/x/gi, Math.ceil(Math.random() * backgroundnum));
<script>
var backgroundnum = <%= theme.background_image %>;
var backgroundimg = "url(/background/bg-x.jpg)".replace(/x/gi, Math.ceil(Math.random() * backgroundnum));
$("body").css({"background": backgroundimg, "background-attachment": "fixed", "background-size": "cover"});
</script>
$("body").css({"background": backgroundimg, "background-attachment": "fixed", "background-size": "cover"});
</script>
<% } else { %>
<style>
body {
background: lightgray;
}
#container .left-col {
background: white;
}
.article-inner {
background: white;
}
.post-nav-button {
background: #ececec;
}
#header .header-nav .social #GitHub {
background-color: #bfd3ec;
}
</style>
<style>
body {
background: lightgray;
}
#container .left-col {
background: white;
}
.article-inner {
background: white;
}
.post-nav-button {
background: #ececec;
}
#header .header-nav .social #GitHub {
background-color: #bfd3ec;
}
</style>
<% } %>
View
@@ -1,24 +1,24 @@
<footer id="footer">
<div class="outer">
<div id="footer-info">
<div class="footer-left">
&copy; <%= date(new Date(), 'YYYY') %> <%= config.author || config.title %>
</div>
<div class="footer-right">
<a href="http://hexo.io/" target="_blank" title="快速、简洁且高效的静态博客框架">Hexo</a> Theme <a href="https://github.com/MOxFIVE/hexo-theme-yelee" target="_blank" title="简而不减双栏 Hexo 博客主题">Yelee</a> by MOxFIVE
<div class="outer">
<div id="footer-info">
<div class="footer-left">
&copy; <%= date(new Date(), 'YYYY') %> <%= config.author || config.title %>
</div>
<div class="footer-right">
<a href="http://hexo.io/" target="_blank" title="快速、简洁且高效的静态博客框架">Hexo</a> Theme <a href="https://github.com/MOxFIVE/hexo-theme-yelee" target="_blank" title="简而不减双栏 Hexo 博客主题">Yelee</a> by MOxFIVE
</div>
</div>
<div class="visit">
<span id="busuanzi_container_site_pv" style='display:none'>
<span id="site-visit" >本站到访数:
<span id="busuanzi_value_site_uv"></span>
</span>
</span>
<span id="busuanzi_container_page_pv" style='display:none'>
<span id="page-visit">, 本页阅读量:
<span id="busuanzi_value_page_pv"></span>
</span>
</span>
</div>
</div>
<div class="visit">
<span id="busuanzi_container_site_pv" style='display:none'>
<span id="site-visit" >本站到访数:
<span id="busuanzi_value_site_uv"></span>
</span>
</span>
<span id="busuanzi_container_page_pv" style='display:none'>
<span id="page-visit">, 本页阅读量:
<span id="busuanzi_value_page_pv"></span>
</span>
</span>
</div>
</div>
</footer>
@@ -1,12 +1,12 @@
<% if (is_archive() || is_tag() || is_category()) { %>
<button class="hide-labels">TAG 开关</button>
<script src="http://7.url.cn/edu/jslib/comb/require-2.1.6,jquery-1.9.1.min.js">
</script>
<script>
$(document).ready(function(){
$("button").click(function(){
$(".article-info").toggle(200);
});
});
</script>
<button class="hide-labels">TAG 开关</button>
<script src="http://7.url.cn/edu/jslib/comb/require-2.1.6,jquery-1.9.1.min.js">
</script>
<script>
$(document).ready(function() {
$("button").click(function() {
$(".article-info").toggle(200);
});
});
</script>
<% } %>
Oops, something went wrong.

0 comments on commit cbe3921

Please sign in to comment.