Use favicon if OG image URL is not specified (#52)

This commit is contained in:
2026-07-17 22:23:39 -04:00
parent abfae6786d
commit 03dc289991
3 changed files with 45 additions and 20 deletions
+4 -1
View File
@@ -219,8 +219,11 @@ let parser =
|> Permalink
|> app.WebLog.AbsoluteUrl
|> function url -> writeOgProp ("og:url", url)
let fallback =
if assetExists "favicon.ico" app.WebLog then Some $"theme/{app.WebLog.ThemeId}/favicon.ico"
else None
match if app.IsPage then app.Page.OpenGraph else app.Posts.Posts[0].OpenGraph with
| Some props -> props.ToProperties app.WebLog.UrlToAbsolute |> Seq.iter writeOgProp
| Some props -> props.ToProperties app.WebLog.UrlToAbsolute fallback |> Seq.iter writeOgProp
| None -> ()
writer.WriteLine $"""{s}<meta name=generator content="{app.Generator}">"""