Skip to content

Commit 0d007f3

Browse files
committed
Merge pull request #54 from dinever/default_theme
Rename all `Articles` to `Posts`
2 parents 1366e8a + 0f06bb8 commit 0d007f3

26 files changed

+134
-312
lines changed

app/handler/home.go

+6-6
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ import (
1414

1515
func RegisterFunctions(app *golf.Application) {
1616
app.View.FuncMap["Tags"] = getAllTags
17-
app.View.FuncMap["RecentArticles"] = getRecentPosts
17+
app.View.FuncMap["RecentPosts"] = getRecentPosts
1818
}
1919

2020
func HomeHandler(ctx *golf.Context) {
@@ -28,7 +28,7 @@ func HomeHandler(ctx *golf.Context) {
2828
// theme := model.GetSetting("site_theme")
2929
data := map[string]interface{}{
3030
"Title": "Home",
31-
"Articles": posts,
31+
"Posts": posts,
3232
"Pager": pager,
3333
}
3434
// updateSidebarData(data)
@@ -46,7 +46,7 @@ func ContentHandler(ctx *golf.Context) {
4646
post.Hits++
4747
data := map[string]interface{}{
4848
"Title": post.Title,
49-
"Article": post,
49+
"Post": post,
5050
"Content": post,
5151
"Comments": post.Comments,
5252
}
@@ -122,7 +122,7 @@ func TagHandler(ctx *golf.Context) {
122122
posts := new(model.Posts)
123123
pager, err := posts.GetPostsByTag(tag.Id, int64(page), 5, true)
124124
data := map[string]interface{}{
125-
"Articles": posts,
125+
"Posts": posts,
126126
"Pager": pager,
127127
"Tag": tag,
128128
"Title": tag.Name,
@@ -165,7 +165,7 @@ func SiteMapHandler(ctx *golf.Context) {
165165
"Title": model.GetSettingValue("site_title"),
166166
"Link": baseUrl,
167167
"Created": now,
168-
"Articles": articleMap,
168+
"Posts": articleMap,
169169
"Navigators": navMap,
170170
})
171171
}
@@ -191,6 +191,6 @@ func RssHandler(ctx *golf.Context) {
191191
"Link": baseUrl,
192192
"Desc": model.GetSettingValue("site_description"),
193193
"Created": utils.Now().Format(time.RFC822),
194-
"Articles": articleMap,
194+
"Posts": articleMap,
195195
})
196196
}

app/model/stats.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import "github.com/dinever/golf"
44

55
type Statis struct {
66
Comments int64
7-
Articles int64
7+
Posts int64
88
Pages int64
99
Files int
1010
Version int
@@ -17,7 +17,7 @@ func NewStatis(app *golf.Application) *Statis {
1717
pageNum, _ := GetNumberOfPosts(true, false)
1818
commentNum, _ := GetNumberOfComments()
1919

20-
s.Articles = postNum
20+
s.Posts = postNum
2121
s.Pages = pageNum
2222
s.Sessions = app.SessionManager.Count()
2323
s.Comments = commentNum

view/admin/home.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ <h2 class="mdl-card__title-text">Welcome</h2>
1515

1616
<div class="mdl-layout mdl-card dingo-card-short dingo-card-count mdl-color--blue-400 mdl-color-text--white mdl-shadow--2dp">
1717
<p class="mdl-color-text--white">Posts</p>
18-
<h2 class="mdl-color-text--white">{{.Statis.Articles}}</h2>
18+
<h2 class="mdl-color-text--white">{{.Statis.Posts}}</h2>
1919
</div>
2020

2121
<div class="mdl-layout mdl-card dingo-card-short dingo-card-count mdl-color--blue-300 mdl-color-text--white mdl-shadow--2dp">

view/default/404.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ <h1 class="article-title" itemprop="name">
3636
<h3 class="widget-title">recents</h3>
3737
<div class="widget">
3838
<ul id="recent-post" class="">
39-
{{range .RecentArticles}}
39+
{{range .RecentPosts}}
4040
<li>
4141
<div class="item-inner">
4242
<p class="item-category"><a class="article-category-link" href="">LifeStyle</a></p>

view/default/article.html

+4-13
Original file line numberDiff line numberDiff line change
@@ -6,28 +6,19 @@
66
<div class="row">
77
<div class="col-lg-12">
88

9-
<h1 class="post-title">{{ .Article.Title }}</h1>
10-
<div class="post-meta"><span>By</span> <a href="#" title="{{ .Article.Author.Name }}">{{ .Article.Author.Name }}</a>, <time datetime="{{DateFormat .Article.PublishedAt "%Y-%m-%d"}}">{{ DateFormat .Article.PublishedAt "%b %d, %Y"}}</time></div>
9+
<h1 class="post-title">{{ .Post.Title }}</h1>
10+
<div class="post-meta"><span>By</span> <a href="#" title="{{ .Post.Author.Name }}">{{ .Post.Author.Name }}</a>, <time datetime="{{DateFormat .Post.PublishedAt "%Y-%m-%d"}}">{{ DateFormat .Post.PublishedAt "%b %d, %Y"}}</time></div>
1111
</div>
1212
</div>
1313

1414
<div class="row">
1515
<div class="col-lg-12">
1616
<div class="post-content">
17-
{{Html .Article.Html }}
18-
</div>
19-
<div class="post-share">
20-
<ul class="social-icons">
21-
<li><a href="https://www.facebook.com/sharer/sharer.php" onclick="window.open(this.href, 'facebook-share','width=580,height=296');return false;" class="button button-social button-facebook" title="Share on Facebook"><i class="fa fa-facebook"></i></a></li>
22-
<li><a href="http://twitter.com/share?text=Kindle%20and%20e-books%20revived%20reading%2C%20study%20shows&amp;url=" onclick="window.open(this.href, 'twitter-share', 'width=550,height=235');return false;" class="button button-social button-twitter" title="Share on Twitter"><i class="fa fa-twitter"></i></a></li>
23-
<li><a href="https://plus.google.com/share?url=" onclick="window.open(this.href, 'google-plus-share', 'width=490,height=530');return false;" class="button button-social button-google-plus" title="Share on Google Plus"><i class="fa fa-google-plus"></i></a></li>
24-
<li><a href="http://www.linkedin.com/shareArticle" onclick="window.open(this.href, 'linkedin-share', 'width=490,height=530');return false;" class="button button-social button-linkedin" title="Share on LinkedIn"><i class="fa fa-linkedin"></i></a></li>
25-
<li><a href="mailto:" class="button button-social" title="Share via email"><i class="fa fa-envelope"></i></a></li>
26-
</ul>
17+
{{Html .Post.Html }}
2718
</div>
2819
</div>
2920
</div>
30-
{{ if .Article.AllowComment }}
21+
{{ if .Post.AllowComment }}
3122
<div class="row">
3223
<div class="col-md-12">
3324
<div class="post-comments">

0 commit comments

Comments
 (0)