Skip to content

Commit

Permalink
Tweak Atom descriptions to have both title and description
Browse files Browse the repository at this point in the history
  • Loading branch information
brandur committed Jan 12, 2023
1 parent 3d5aecc commit 29141c2
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 2 deletions.
1 change: 1 addition & 0 deletions build.go
Original file line number Diff line number Diff line change
Expand Up @@ -2013,6 +2013,7 @@ func renderAtom(ctx context.Context, c *modulir.Context, atom *Atom, atomIndex i
if len(atom.Photos) > 0 {
photo := atom.Photos[0]
card = &twitterCard{
Description: fmt.Sprintf("Published %s.", atom.PublishedAt.Format("2006 / Jan 2 / 15:04 PST")),
ImageURL: fmt.Sprintf("%s/photographs/atoms/%s/%s_large@2x%s",
conf.AbsoluteURL, atom.Slug, photo.Slug, photo.TargetExt()),
Title: atom.Slug,
Expand Down
2 changes: 0 additions & 2 deletions views/_twitter.tmpl.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,7 @@
<meta name="twitter:site" content="@brandur">
<meta name="twitter:creator" content="@brandur">
<meta name="twitter:title" content="{{.TwitterCard.Title}}">
{{- if ne .TwitterCard.Description "" -}}
<meta name="twitter:description" content="{{.TwitterCard.Description}}">
{{- end -}}
{{- if ne .TwitterCard.ImageURL "" -}}
<meta name="twitter:image" content="{{.TwitterCard.ImageURL}}">
{{- end -}}
Expand Down

0 comments on commit 29141c2

Please sign in to comment.