{{/* Feed Component - Reusable feed sidebar */}} {{define "feed"}}

Recent Notes View Full Feed

{{range .FeedItems}}
{{template "user-badge-simple" (dict "Pubkey" .Author "Profiles" $.Profiles)}}
{{.Content}}
{{else}}

No recent notes available.

{{end}}
{{end}} {{/* Alert Component - Success message */}} {{define "alert-success"}} {{end}} {{/* Alert Component - Error message */}} {{define "alert-error"}} {{end}} {{/* Wiki Sidebar Component - Reusable wiki navigation */}} {{define "wiki-sidebar"}} {{end}} {{/* User Badge Component - Displays user profile with picture, name, or shortened npub Usage: {{template "user-badge" (dict "Pubkey" .Author "Picture" "" "DisplayName" "" "Name" "")}} Or simpler: {{template "user-badge-simple" .Author}} for just pubkey */}} {{define "user-badge"}} {{if .Picture}} {{if .DisplayName}}{{.DisplayName}}{{else if .Name}}{{.Name}}{{else}}User{{end}} {{else}} {{end}} {{if .DisplayName}} {{.DisplayName}} {{else if .Name}} {{.Name}} {{else}} {{shortenPubkey .Pubkey}} {{end}} {{if and .Name (not .DisplayName)}} @{{.Name}} {{end}} {{end}} {{/* Simple user badge - takes a pubkey string and looks up profile from parent context's Profiles map Usage: {{template "user-badge-simple" (dict "Pubkey" .Author "Profiles" $.Profiles)}} Or with root context: {{template "user-badge-simple" (dict "Pubkey" .Author "Profiles" $)}} */}} {{define "user-badge-simple"}} {{$pubkey := .Pubkey}} {{$profiles := .Profiles}} {{$profile := index $profiles $pubkey}} {{if and $profile $profile.Picture}} {{if $profile.DisplayName}}{{$profile.DisplayName}}{{else if $profile.Name}}{{$profile.Name}}{{else}}User{{end}} {{else}} {{end}} {{if and $profile $profile.DisplayName}} {{$profile.DisplayName}} {{else if and $profile $profile.Name}} {{$profile.Name}} {{else}} {{shortenPubkey $pubkey}} {{end}} {{if and $profile $profile.Name (not $profile.DisplayName)}} @{{$profile.Name}} {{end}} {{end}}