Fix feed item empty category spanUnverified
62c1d08 parent: 8f8e2e1 modified
internal/tmpl/partials/feed-item.html +1 -1 | @@ -5,7 +5,7 @@ | ||
| 5 | 5 | <div class="min-w-0 flex-1"> |
| 6 | 6 | <div class="flex items-center gap-2 flex-wrap"> |
| 7 | 7 | <span class="font-bold text-spot-text truncate">{{if .FeedTitle}}{{.FeedTitle}}{{else}}{{.FeedURL}}{{end}}</span> |
| 8 | - {{if .Category.Valid}}<span class="text-xs bg-spot-hover text-spot-secondary px-2 py-0.5 rounded-full shrink-0">{{.Category.String}}</span>{{end}} | |
| 8 | + {{if and .Category.Valid .Category.String}}<span class="text-xs bg-spot-hover text-spot-secondary px-2 py-0.5 rounded-full shrink-0">{{.Category.String}}</span>{{end}} | |
| 9 | 9 | </div> |
| 10 | 10 | <div class="text-xs text-spot-muted truncate mt-0.5">{{.FeedURL}}</div> |
| 11 | 11 | </div> |
| @@ -5,7 +5,7 @@ | |||
| 5 | <div class="min-w-0 flex-1"> | 5 | <div class="min-w-0 flex-1"> |
| 6 | <div class="flex items-center gap-2 flex-wrap"> | 6 | <div class="flex items-center gap-2 flex-wrap"> |
| 7 | <span class="font-bold text-spot-text truncate">{{if .FeedTitle}}{{.FeedTitle}}{{else}}{{.FeedURL}}{{end}}</span> | 7 | <span class="font-bold text-spot-text truncate">{{if .FeedTitle}}{{.FeedTitle}}{{else}}{{.FeedURL}}{{end}}</span> |
| 8 | - {{if .Category.Valid}}<span class="text-xs bg-spot-hover text-spot-secondary px-2 py-0.5 rounded-full shrink-0">{{.Category.String}}</span>{{end}} | 8 | + {{if and .Category.Valid .Category.String}}<span class="text-xs bg-spot-hover text-spot-secondary px-2 py-0.5 rounded-full shrink-0">{{.Category.String}}</span>{{end}} |
| 9 | </div> | 9 | </div> |
| 10 | <div class="text-xs text-spot-muted truncate mt-0.5">{{.FeedURL}}</div> | 10 | <div class="text-xs text-spot-muted truncate mt-0.5">{{.FeedURL}}</div> |
| 11 | </div> | 11 | </div> |
modified
internal/tmpl/profile.html +1 -1 | @@ -30,7 +30,7 @@ | ||
| 30 | 30 | <div class="min-w-0 flex-1"> |
| 31 | 31 | <div class="flex items-center gap-2 flex-wrap"> |
| 32 | 32 | <span class="font-bold text-spot-text truncate">{{if .FeedTitle}}{{.FeedTitle}}{{else}}{{.FeedURL}}{{end}}</span> |
| 33 | - {{if .Category.Valid}}<span class="text-xs bg-spot-hover text-spot-secondary px-2 py-0.5 rounded-full shrink-0">{{.Category.String}}</span>{{end}} | |
| 33 | + {{if and .Category.Valid .Category.String}}<span class="text-xs bg-spot-hover text-spot-secondary px-2 py-0.5 rounded-full shrink-0">{{.Category.String}}</span>{{end}} | |
| 34 | 34 | </div> |
| 35 | 35 | <div class="text-xs text-spot-muted truncate mt-0.5">{{.FeedURL}}</div> |
| 36 | 36 | </div> |
| @@ -30,7 +30,7 @@ | |||
| 30 | <div class="min-w-0 flex-1"> | 30 | <div class="min-w-0 flex-1"> |
| 31 | <div class="flex items-center gap-2 flex-wrap"> | 31 | <div class="flex items-center gap-2 flex-wrap"> |
| 32 | <span class="font-bold text-spot-text truncate">{{if .FeedTitle}}{{.FeedTitle}}{{else}}{{.FeedURL}}{{end}}</span> | 32 | <span class="font-bold text-spot-text truncate">{{if .FeedTitle}}{{.FeedTitle}}{{else}}{{.FeedURL}}{{end}}</span> |
| 33 | - {{if .Category.Valid}}<span class="text-xs bg-spot-hover text-spot-secondary px-2 py-0.5 rounded-full shrink-0">{{.Category.String}}</span>{{end}} | 33 | + {{if and .Category.Valid .Category.String}}<span class="text-xs bg-spot-hover text-spot-secondary px-2 py-0.5 rounded-full shrink-0">{{.Category.String}}</span>{{end}} |
| 34 | </div> | 34 | </div> |
| 35 | <div class="text-xs text-spot-muted truncate mt-0.5">{{.FeedURL}}</div> | 35 | <div class="text-xs text-spot-muted truncate mt-0.5">{{.FeedURL}}</div> |
| 36 | </div> | 36 | </div> |