From fc71473177b3d0abea123d8a0e032c58b686302f Mon Sep 17 00:00:00 2001 From: Caleb Gardner Date: Tue, 7 Jan 2025 09:27:08 -0600 Subject: [PATCH] Set Update time on separate line --- internal/blog/blog.go | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/internal/blog/blog.go b/internal/blog/blog.go index 748f97f..c1f74c3 100644 --- a/internal/blog/blog.go +++ b/internal/blog/blog.go @@ -20,6 +20,7 @@ const ( blogTitle = "

%v

" blogAuthor = "

By %v

" blogCreate = "
Written on: %v
" + blogUpdate = "
Updated on: %v
" blogMain = "
%v
" ) @@ -47,11 +48,9 @@ func (b *Blog) HTMX(blogApp *BlogApp, ctx context.Context) string { } else { out += fmt.Sprintf(blogAuthor, "unknown") } - cTime := time.Unix(b.CreateTime, 0).Format(time.DateOnly) + out += fmt.Sprintf(blogCreate, time.Unix(b.CreateTime, 0).Format(time.DateOnly)) if b.UpdateTime > b.CreateTime { - out += fmt.Sprintf(blogCreate, cTime+"; Last updated on: "+time.Unix(b.UpdateTime, 0).Format(time.DateOnly)) - } else { - out += fmt.Sprintf(blogCreate, cTime) + out += fmt.Sprintf(blogUpdate, time.Unix(b.UpdateTime, 0).Format(time.DateOnly)) } out += fmt.Sprintf(blogMain, b.HTMLBlog) if err == nil {