diff --git a/repos/blog_repo.go b/repos/blog_repo.go index 986c144..50f87e9 100644 --- a/repos/blog_repo.go +++ b/repos/blog_repo.go @@ -71,7 +71,7 @@ func (b *BlogRepo) GetBlogByUrl(url string) (*models.BlogPost, error) { func (b *BlogRepo) GetAllBlogPosts() (*[]models.BlogPost, error) { posts := new([]models.BlogPost) - err := b.DB.Table("blog_posts").Scan(posts).Error + err := b.DB.Table("blog_posts").Order("date desc").Scan(posts).Error if err != nil { return nil, errors.New("Could not load all posts from database") } diff --git a/templates/blog_post.tmpl b/templates/blog_post.tmpl index 64de20c..3a06c0a 100644 --- a/templates/blog_post.tmpl +++ b/templates/blog_post.tmpl @@ -13,7 +13,7 @@
+
This site used to have comments. Unfortunatley maintaining a comment system that can resist bots, spammers, and other hooligans is quite tiresome. Until I figure out a way to efficiently handle comments, they are disabled. Sorry for the inconvenience.
{{ template "footer_no_banners.tmpl" . }}