From 3324428f8b51357dbe4774d74673af80da084ca5 Mon Sep 17 00:00:00 2001 From: Ben Visness Date: Mon, 25 Oct 2021 09:07:14 -0500 Subject: [PATCH] Tweak news appearance --- src/templates/src/include/timeline_item.html | 10 ++++++---- src/templates/types.go | 9 +++++---- src/website/landing.go | 3 +++ 3 files changed, 14 insertions(+), 8 deletions(-) diff --git a/src/templates/src/include/timeline_item.html b/src/templates/src/include/timeline_item.html index 88239e8c..62f40491 100644 --- a/src/templates/src/include/timeline_item.html +++ b/src/templates/src/include/timeline_item.html @@ -1,16 +1,18 @@
{{/* top bar - avatar, info, date */}}
- - - + {{ if .OwnerAvatarUrl }} + + + + {{ end }}
{{ if .Breadcrumbs }} {{ template "breadcrumbs.html" .Breadcrumbs }} {{ end }} {{ if .Title }} -
+
{{ with .TypeTitle }}{{ . }}:{{ end }} {{ .Title }}
diff --git a/src/templates/types.go b/src/templates/types.go index 062a7f81..64f691ca 100644 --- a/src/templates/types.go +++ b/src/templates/types.go @@ -257,14 +257,15 @@ type TimelineItem struct { OwnerName string OwnerUrl string - Description template.HTML - TruncateDescription bool + Description template.HTML PreviewMedia TimelineItemMedia EmbedMedia []TimelineItemMedia - SmallInfo bool - CanShowcase bool // whether this snippet can be shown in a showcase gallery + SmallInfo bool + AllowTitleWrap bool + TruncateDescription bool + CanShowcase bool // whether this snippet can be shown in a showcase gallery } type TimelineItemMediaType int diff --git a/src/website/landing.go b/src/website/landing.go index 33876377..e6c5eead 100644 --- a/src/website/landing.go +++ b/src/website/landing.go @@ -98,7 +98,10 @@ func Index(c *RequestContext) ResponseData { if len(newsThreads) > 0 { t := newsThreads[0] item := PostToTimelineItem(lineageBuilder, &t.FirstPost, &t.Thread, &t.Project, t.FirstPostAuthor, c.Theme) + item.OwnerAvatarUrl = "" + item.Breadcrumbs = nil item.TypeTitle = "" + item.AllowTitleWrap = true item.Description = template.HTML(t.FirstPostCurrentVersion.TextParsed) item.TruncateDescription = true newsPostItem = &item