mirror of
https://github.com/flysnow-org/maupassant-hugo.git
synced 2026-08-24 07:18:55 +00:00
SeeAlso支持;Disqus支持;修复代码显示不全问题;增加更多的代码高亮语言支持
This commit is contained in:
@@ -88,6 +88,12 @@ theme = "maupassant"
|
||||
googleAnalytics = "GA ID"
|
||||
```
|
||||
|
||||
#### Disqus
|
||||
|
||||
```toml
|
||||
disqusShortname = "yourdiscussshortname"
|
||||
```
|
||||
|
||||
## Contributing
|
||||
|
||||
All kinds of contributions (enhancements, new features, documentation & code improvements, issues & bugs reporting) are welcome.
|
||||
|
||||
+16
-1
@@ -21,8 +21,13 @@ Maupassant theme, ported to Hugo.
|
||||
7. 自定义友情链接支持
|
||||
8. 支持文章按年份日期进行归档
|
||||
9. 支持GA分析统计
|
||||
10. 支持关键字SEO优化
|
||||
10. sitemap站点地图
|
||||
11. 代码高亮
|
||||
12. 404错误页
|
||||
13. 支持关键字SEO优化
|
||||
14. Google站内搜索
|
||||
15. See Also 支持
|
||||
16. Disqus评论支持
|
||||
|
||||
## 下载安装
|
||||
|
||||
@@ -121,6 +126,16 @@ type: archives
|
||||
|
||||
`content/archives/index.md`表示在`content/archives/`目录下的`index.md`文件
|
||||
|
||||
#### Disqus
|
||||
|
||||
该支持主持Disqus评论,如果要启用Disqus,可以在`config.toml`里添加如下配置即可.
|
||||
|
||||
```toml
|
||||
disqusShortname = "yourdiscussshortname"
|
||||
```
|
||||
|
||||
替换成你自己的Disqus名字即可。
|
||||
|
||||
#### 禁止分类的名称转为小写
|
||||
|
||||
我们在写文章的时候,会给文章进行分类,比如Golang,但是默认情况下,Hugo会把这个Golang转为小写,
|
||||
|
||||
@@ -28,6 +28,8 @@
|
||||
{{ .Content }}
|
||||
</div>
|
||||
|
||||
{{ partial "related" . }}
|
||||
|
||||
<div class="post-meta meta-tags">
|
||||
{{ if and (isset .Params "tags") .Params.tags }}
|
||||
<ul class="clearfix">
|
||||
@@ -39,16 +41,6 @@
|
||||
没有标签
|
||||
{{ end }}
|
||||
</div>
|
||||
{{ if eq .Type "post" }}
|
||||
<div class="post-nav">
|
||||
{{if .NextInSection}}
|
||||
<a href="{{.NextInSection.Permalink}}" class="pre">{{.NextInSection.Title}}</a>
|
||||
{{end}}
|
||||
{{if .PrevInSection}}
|
||||
<a href="{{.PrevInSection.Permalink}}" class="next">{{.PrevInSection.Title}}</a>
|
||||
{{end}}
|
||||
</div>
|
||||
{{ end }}
|
||||
</article>
|
||||
{{ partial "comments" . }}
|
||||
</div>
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
{{ template "_internal/disqus.html" . }}
|
||||
@@ -0,0 +1,11 @@
|
||||
{{ $related := .Site.RegularPages.Related . | first 5 }}
|
||||
{{ with $related }}
|
||||
<div class="post-archive">
|
||||
<h2>See Also</h2>
|
||||
<ul class="listing">
|
||||
{{ range . }}
|
||||
<li><a href="{{ .RelPermalink }}">{{ .Title }}</a></li>
|
||||
{{ end }}
|
||||
</ul>
|
||||
</div>
|
||||
{{ end }}
|
||||
+1
-43
@@ -1,5 +1,5 @@
|
||||
/* PrismJS 1.15.0
|
||||
https://prismjs.com/download.html#themes=prism-coy&languages=markup+css+clike+javascript+c+bash+cpp+coffeescript+ruby+diff+docker+markup-templating+erlang+git+go+groovy+less+haskell+java+json+kotlin+markdown+lua+makefile+nginx+objectivec+php+python+r+swift+yaml+vim&plugins=line-numbers+highlight-keywords */
|
||||
https://prismjs.com/download.html#themes=prism-coy&languages=markup+css+clike+javascript+c+csharp+bash+basic+cpp+coffeescript+clojure+ruby+diff+docker+markup-templating+erlang+git+go+groovy+less+haskell+java+json+kotlin+markdown+lua+makefile+nginx+objectivec+perl+php+php-extras+sql+python+r+jsx+typescript+rust+scala+plsql+swift+yaml+tsx+vbnet+vim&plugins=highlight-keywords */
|
||||
/**
|
||||
* prism.js Coy theme for JavaScript, CoffeeScript, CSS and HTML
|
||||
* Based on https://github.com/tshedor/workshop-wp-theme (Example: http://workshop.kansan.com/category/sessions/basics or http://workshop.timshedor.com/category/sessions/basics);
|
||||
@@ -226,45 +226,3 @@ pre .line-highlight {
|
||||
margin-top: 0;
|
||||
}
|
||||
|
||||
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;
|
||||
}
|
||||
|
||||
|
||||
+3
-39
@@ -368,11 +368,11 @@ textarea {
|
||||
.post-content h3,.post-content h2{
|
||||
margin: 1.4em 0 1.1em;
|
||||
}
|
||||
.post-content pre, .comment-content pre {
|
||||
/* .post-content pre, .comment-content pre {
|
||||
max-height: 320px;
|
||||
}
|
||||
} */
|
||||
.post-content pre, .comment-content pre {
|
||||
padding: 1.5em 2em;
|
||||
padding: 1em 1.5em;
|
||||
}
|
||||
.post-content p code, .comment-content p code {
|
||||
display:inline;
|
||||
@@ -897,42 +897,6 @@ img.alignright {
|
||||
display: block;
|
||||
}
|
||||
|
||||
/* post navigator*/
|
||||
.post-nav {
|
||||
overflow: hidden;
|
||||
margin-top: 15px;
|
||||
margin-bottom: 20px;
|
||||
padding: 10px;
|
||||
white-space: nowrap;
|
||||
border-top: 1px solid #eee;
|
||||
}
|
||||
.post-nav a {
|
||||
display: inline-block;
|
||||
line-height: 25px;
|
||||
font-size: 15px;
|
||||
color: #555;
|
||||
border-bottom: none;
|
||||
float: left;
|
||||
}
|
||||
.post-nav a.pre {
|
||||
float: left;
|
||||
}
|
||||
.post-nav a.pre:before {
|
||||
content: "\ea23";
|
||||
padding-right: 0.3em;
|
||||
}
|
||||
.post-nav a.next {
|
||||
float: right;
|
||||
}
|
||||
.post-nav a.next:after {
|
||||
content: "\ea24";
|
||||
padding-left: 0.3em;
|
||||
}
|
||||
.post-nav a:hover {
|
||||
border-bottom: none;
|
||||
color: #222;
|
||||
}
|
||||
|
||||
/* for archive page starts*/
|
||||
.post-archive {
|
||||
font-size: 15px;
|
||||
|
||||
+14
-2
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user