Skip to content

Commit

Permalink
support link descriptions
Browse files Browse the repository at this point in the history
  • Loading branch information
ianrose14 committed Oct 14, 2024
1 parent aba2668 commit 98cb5a7
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
7 changes: 4 additions & 3 deletions cmd/webapp/handlers.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,10 @@ type webItem struct {
}

type webSection struct {
Name string `json:"name"`
Desc string `json:"desc"`
Items []*webItem `json:"items"`
Name string `json:"name"`
Desc string `json:"desc"`
LinkText string `json:"linktext"`
Items []*webItem `json:"items"`
}

// albumsHandler serves a page that lists all available photo albums.
Expand Down
5 changes: 3 additions & 2 deletions cmd/webapp/templates/allison.html
Original file line number Diff line number Diff line change
Expand Up @@ -34,15 +34,16 @@
<p>
On September 16, 2024, I lost my beautiful wife of 20 years, Allison Rose, to gastric cancer. She was beloved by
many, so I've created this page as a place to host content that others might want to see, both now and in the
future.
future. Our <a href="https://www.caringbridge.org/site/62ec39b4-d0cd-11ee-9d32-23e01ba879ca" target="_blank">Caring Bridge site</a>
has several posts detailing her journey since being diagnosed on Feb 2.
</p>
<div>
{{ range . }}
<h3>{{.Name}}</h3>
<div>{{.Desc}}</div>
<ul>
{{ range .Items }}
<li><a href="{{.Url}}" target="_blank">{{ .Desc }}</a></li>
<li><a href="{{.Url}}" target="_blank">{{ .LinkText }}</a>{{ if .Desc }} - {{ .Desc }}{{ end }}</li>
{{ end }}
</ul>
{{ end }}
Expand Down

0 comments on commit 98cb5a7

Please sign in to comment.