Skip to content

Commit

Permalink
修复bug
Browse files Browse the repository at this point in the history
  • Loading branch information
broqiang committed Apr 24, 2019
1 parent 76c8a68 commit 9c03ef3
Show file tree
Hide file tree
Showing 7 changed files with 21 additions and 11 deletions.
4 changes: 2 additions & 2 deletions app/http/controllers/posts.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ func PostsByCategory(c *gin.Context) {

if len(articles) > 0 {
params := mergeH(c, gin.H{
"title": "分类" + name,
"title": "分类 | " + name,
"keywords": name,
"posts": articles,
})
Expand All @@ -51,7 +51,7 @@ func PostsByTag(c *gin.Context) {

if len(articles) > 0 {
params := mergeH(c, gin.H{
"title": "标签-" + name,
"title": "标签 | " + name,
"keywords": name,
"posts": articles,
})
Expand Down
2 changes: 1 addition & 1 deletion app/mdfile/article.go
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ func getAritclesSpecifiedCategory(category *Category) Articles {
}

// 将分类添加到文章中
article.Category = category.Title
article.Category = category.Path
article.Path = strings.TrimSuffix(info.Name(), ext)

articles = append(articles, article)
Expand Down
6 changes: 5 additions & 1 deletion config/categories.toml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,10 @@
path = "php"
description = "和 PHP 相关的文章"

[[category]]
title = "MySQL"
path = "mysql"
description = "和 MySQL 相关的文章"

[[category]]
title = "算法"
Expand All @@ -41,4 +45,4 @@
path = "/about"
description = "关于本博客"
# 外链,不去解析 markdwon
out_link = true
out_link = true
4 changes: 4 additions & 0 deletions resources/assets/sass/app.scss
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,10 @@ body {
background-color: #F5F7F9;
}

.article-list>li>div>h1 {
font-size: 1.8rem;
}


.footer > .container {
padding-right: 15px;
Expand Down
2 changes: 1 addition & 1 deletion resources/static/css/app.css

Large diffs are not rendered by default.

12 changes: 7 additions & 5 deletions resources/views/posts/_right.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,12 @@
公告
</div>
<hr>
本博客已经由 go 重写点击 <a href="/about">about</a> 了解更多
点击 <a href="https://php-blog.broqiang.com" target="_blank">Laravel 版本博客</a>
可以查看旧版博客如果你喜欢本博客欢迎 <a href="https://github.com/broqiang/mdblog" target="_blank">Star</a>
感谢
<small>
本博客已经由 go 重写点击 <a href="/about">about</a> 了解更多
点击 <a href="https://php-blog.broqiang.com" target="_blank">Laravel 版本博客</a>
可以查看旧版博客如果你喜欢本博客欢迎 <a href="https://github.com/broqiang/mdblog" target="_blank">Star</a>
感谢
</small>
</div>
</div>
<div class="card mb-2 border-white bg-light text-secondary">
Expand All @@ -20,7 +22,7 @@
<hr>
{{ range $k, $v := .tags }}
<a class="btn btn-light btn-sm my-1 mr-1 shadow rounded" href="/tag/{{ $v.Title }}">
<span class="{{ if $v.Active }}text-info{{ else }}text-secondary{{ end }}">{{ $v.Title }}</span>
<span class="text-secondary {{ if $v.Active }}font-weight-bold{{ end }}">{{ $v.Title }}</span>
<span class="badge badge-secondary">{{ $v.Number }}</span>
</a>
{{ end }}
Expand Down
2 changes: 1 addition & 1 deletion resources/views/posts/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
{{ range $index, $post := .posts }}
<li class="media mb-3">
<div class="media-body">
<h2 class="mb-1"><a class="text-dark" href="/posts/{{ $post.Path }}">{{ $post.Title }} </a></h2>
<h1 class="mb-1"><a class="text-dark" href="/posts/{{ $post.Path }}">{{ $post.Title }} </a></h1>
<p>
<a class="text-secondary" href="{{ $post.HomePage }}">{{ $post.Author }}</a>
&rarr; <small>update: {{ $post.UpdatedAt.Format "2006-01-02" }}</small>
Expand Down

0 comments on commit 9c03ef3

Please sign in to comment.