diff --git a/src/templates/src/blog_index.html b/src/templates/src/blog_index.html index 177b8a0..6ead85b 100644 --- a/src/templates/src/blog_index.html +++ b/src/templates/src/blog_index.html @@ -20,15 +20,17 @@
{{ .Author.Name }} — {{ timehtml (relativedate .Date) .Date }}
-
-
- {{ .Content }} -
-
-
-
- Read More → -
+ {{ if $.ShowContent }} +
+
+ {{ .Content }} +
+
+
+
+ Read More → +
+ {{ end }} {{ end }} diff --git a/src/website/blogs.go b/src/website/blogs.go index 3e92e21..a14e828 100644 --- a/src/website/blogs.go +++ b/src/website/blogs.go @@ -30,11 +30,12 @@ func BlogIndex(c *RequestContext) ResponseData { Posts []blogIndexEntry Pagination templates.Pagination + ShowContent bool CanCreatePost bool NewPostUrl string } - const postsPerPage = 5 + const postsPerPage = 20 numThreads, err := hmndata.CountThreads(c.Context(), c.Conn, c.CurrentUser, hmndata.ThreadsQuery{ ProjectIDs: []int{c.CurrentProject.ID}, @@ -105,6 +106,7 @@ func BlogIndex(c *RequestContext) ResponseData { NextUrl: c.UrlContext.BuildBlog(utils.IntClamp(1, page+1, numPages)), }, + ShowContent: len(entries) <= 5, CanCreatePost: canCreate, NewPostUrl: c.UrlContext.BuildBlogNewThread(), }, c.Perf)