Support relative URLs in OpenGraph properties (#52)
This commit is contained in:
@@ -164,7 +164,7 @@ let save : HttpHandler = requireAccess Author >=> fun next ctx -> task {
|
||||
match! tryPage with
|
||||
| Some page when canEdit page.AuthorId ctx ->
|
||||
let updateList = page.IsInPageList <> model.IsShownInPageList
|
||||
let updatedPage = model.UpdatePage page ctx.WebLog now
|
||||
let updatedPage = model.UpdatePage page now
|
||||
do! (if model.IsNew then data.Page.Add else data.Page.Update) updatedPage
|
||||
if updateList then do! PageListCache.update ctx
|
||||
do! addMessage ctx { UserMessage.Success with Message = "Page saved successfully" }
|
||||
|
||||
@@ -495,7 +495,7 @@ let save : HttpHandler = requireAccess Author >=> fun next ctx -> task {
|
||||
| Some post when canEdit post.AuthorId ctx ->
|
||||
let priorCats = post.CategoryIds
|
||||
let updatedPost =
|
||||
model.UpdatePost post ctx.WebLog (Noda.now ())
|
||||
model.UpdatePost post (Noda.now ())
|
||||
|> function
|
||||
| post ->
|
||||
if model.SetPublished then
|
||||
|
||||
@@ -207,7 +207,7 @@ let parser =
|
||||
|> app.WebLog.AbsoluteUrl
|
||||
|> function url -> writeOgProp ("og:url", url)
|
||||
match if app.IsPage then app.Page.OpenGraph else app.Posts.Posts[0].OpenGraph with
|
||||
| Some props -> props.Properties |> Seq.iter writeOgProp
|
||||
| Some props -> props.ToProperties app.WebLog.UrlToAbsolute |> Seq.iter writeOgProp
|
||||
| None -> ()
|
||||
|
||||
writer.WriteLine $"""{s}<meta name=generator content="{app.Generator}">"""
|
||||
|
||||
Reference in New Issue
Block a user