the resolve #2 resolve #15,support code line,add extra language support

This commit is contained in:
飞雪无情
2018-12-06 10:48:15 +08:00
parent 49e27884ad
commit 300be4762a
4 changed files with 76 additions and 13 deletions
+5 -1
View File
@@ -22,7 +22,11 @@ Maupassant theme, ported to Hugo.
8. 支持文章按年份日期进行归档
9. 支持GA分析统计
10. sitemap站点地图
11. 代码高亮
11. 代码高亮、代码行号
* markup、css、clike、javascript、c、csharp、bash、cpp
* aspnet、dart、docker、markup-templating、erlang
* go、groovy、java、json、kotlin、markdown、lua、objectivec
* php、python、r、yaml、toml
12. 404错误页
13. 支持关键字SEO优化
14. Google站内搜索
+6 -1
View File
@@ -10,8 +10,12 @@
</footer>
{{ if .IsPage }}
<script type="text/javascript" src="{{ "js/prism.js" | relURL}}" async="true"></script>
<script type="text/javascript">
//添加行号
(function(){
$("pre code").parent().addClass("line-numbers")
}())
window.MathJax = {
tex2jax: {
inlineMath: [ ['$','$'] ],
@@ -19,6 +23,7 @@
}
};
</script>
<script type="text/javascript" src="{{ "js/prism.js" | relURL}}" async="true"></script>
<script src='https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/MathJax.js?config=TeX-MML-AM_CHTML' async></script>
{{ end }}
<a id="rocket" href="#top"></a>
+43 -1
View File
@@ -1,5 +1,5 @@
/* PrismJS 1.15.0
https://prismjs.com/download.html#themes=prism&languages=markup+css+clike+javascript+c+bash+markup-templating+go+java+json+markdown+objectivec+php+python+yaml&plugins=highlight-keywords */
https://prismjs.com/download.html#themes=prism&languages=markup+css+clike+javascript+c+csharp+bash+cpp+aspnet+dart+docker+markup-templating+erlang+go+groovy+java+json+kotlin+markdown+lua+objectivec+php+python+r+yaml+toml&plugins=line-numbers+highlight-keywords */
/**
* prism.js default theme for JavaScript, CSS and HTML
* Based on dabblet (http://dabblet.com)
@@ -139,3 +139,45 @@ pre[class*="language-"] {
cursor: help;
}
pre[class*="language-"].line-numbers {
position: relative;
padding-left: 3.8em;
counter-reset: linenumber;
}
pre[class*="language-"].line-numbers > code {
position: relative;
white-space: inherit;
}
.line-numbers .line-numbers-rows {
position: absolute;
pointer-events: none;
top: 0;
font-size: 100%;
left: -3.8em;
width: 3em; /* works for line-numbers below 1000 lines */
letter-spacing: -1px;
border-right: 1px solid #999;
-webkit-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none;
}
.line-numbers-rows > span {
pointer-events: none;
display: block;
counter-increment: linenumber;
}
.line-numbers-rows > span:before {
content: counter(linenumber);
color: #999;
display: block;
padding-right: 0.8em;
text-align: right;
}
+22 -10
View File
File diff suppressed because one or more lines are too long