diff --git a/src/MyWebLog.Domain/SupportTypes.fs b/src/MyWebLog.Domain/SupportTypes.fs
index 73864a3..7403e6e 100644
--- a/src/MyWebLog.Domain/SupportTypes.fs
+++ b/src/MyWebLog.Domain/SupportTypes.fs
@@ -581,6 +581,22 @@ type OpenGraphType =
| "website" -> Website
| _ -> invalidArg (nameof typ) $"{typ} is not a valid OpenGraph type"
+ /// The values and display names for valid values of this type
+ static member Selections =
+ [ string Article, nameof Article
+ string Book, nameof Book
+ string MusicAlbum, "Music: Album"
+ string MusicPlaylist, "Music: Playlist"
+ string MusicRadioStation, "Music: Radio Station"
+ string MusicSong, "Music: Song"
+ string PaymentLink, "Payment Link"
+ string Profile, nameof Profile
+ string VideoEpisode, "Video: Episode"
+ string VideoMovie, "Video: Movie"
+ string VideoOther, "Video: Other"
+ string VideoTvShow, "Video: TV Show"
+ string Website, nameof Website ]
+
override this.ToString() =
match this with
| Article -> "article"
diff --git a/src/MyWebLog/Views/Helpers.fs b/src/MyWebLog/Views/Helpers.fs
index 5ba1b77..8482b71 100644
--- a/src/MyWebLog/Views/Helpers.fs
+++ b/src/MyWebLog/Views/Helpers.fs
@@ -389,6 +389,49 @@ let commonTemplates (model: EditCommonModel) (templates: MetaItem seq) =
_.Name _.Value []
+/// Display the OpenGraph data edit form
+/// The edit model
+/// Fields for editing OpenGraph data for a page or post
+let commonOpenGraph (model: EditCommonModel) =
+ fieldset [] [
+ legend [] [
+ span [ _class "form-check form-switch" ] [
+ small [] [
+ input [ _type "checkbox"; _name (nameof model.AssignOpenGraph)
+ _id (nameof model.AssignOpenGraph); _class "form-check-input"; _value "true"
+ _data "bs-toggle" "collapse"; _data "bs-target" "#og_props"
+ _onclick "Admin.toggleOpenGraphFields()"; if model.AssignOpenGraph then _checked ]
+ ]
+ label [ _for (nameof model.AssignOpenGraph) ] [ raw "OpenGraph Properties" ]
+ ]
+ ]
+ div [ _id "og_props"; _class $"""container p-0 collapse{if model.AssignOpenGraph then " show" else ""}""" ] [
+ div [ _class "col-4" ] [
+ selectField [ _required ] (nameof model.OpenGraphType) "Type" model.OpenGraphType
+ OpenGraphType.Selections fst snd []
+ ]
+ // member val OpenGraphType = "" with get, set
+ // member val OpenGraphImageUrl = "" with get, set
+ // member val OpenGraphImageType = "" with get, set
+ // member val OpenGraphImageWidth = "" with get, set
+ // member val OpenGraphImageHeight = "" with get, set
+ // member val OpenGraphImageAlt = "" with get, set
+ // member val OpenGraphAudioUrl = "" with get, set
+ // member val OpenGraphAudioType = "" with get, set
+ // member val OpenGraphDescription = "" with get, set
+ // member val OpenGraphDeterminer = "" with get, set
+ // member val OpenGraphLocale = "" with get, set
+ // member val OpenGraphAlternateLocales = "" with get, set
+ // member val OpenGraphVideoUrl = "" with get, set
+ // member val OpenGraphVideoType = "" with get, set
+ // member val OpenGraphVideoWidth = "" with get, set
+ // member val OpenGraphVideoHeight = "" with get, set
+ // member val OpenGraphExtraNames: string array = [||] with get, set
+ // member val OpenGraphExtraValues: string array = [||] with get, set
+
+ ]
+ ]
+
/// Display the metadata item edit form
/// The edit model
/// A form for editing metadata
diff --git a/src/MyWebLog/Views/Post.fs b/src/MyWebLog/Views/Post.fs
index ba0b045..5337793 100644
--- a/src/MyWebLog/Views/Post.fs
+++ b/src/MyWebLog/Views/Post.fs
@@ -291,6 +291,7 @@ let postEdit (model: EditPostModel) templates (ratings: MetaItem list) app = [
checkboxSwitch [ _class "mb-2" ] (nameof model.DoPublish) "Publish This Post" model.DoPublish []
saveButton
hr [ _class "mb-3" ]
+ commonOpenGraph model
fieldset [ _class "mb-3" ] [
legend [] [
span [ _class "form-check form-switch" ] [