Add OG types to page/post, add rendering in page head (#52)
This commit is contained in:
@@ -112,6 +112,9 @@ type DisplayPage = {
|
||||
|
||||
/// <summary>The metadata for the page</summary>
|
||||
Metadata: MetaItem list
|
||||
|
||||
/// <summary>The OpenGraph properties for the page</summary>
|
||||
OpenGraph: OpenGraphProperties option
|
||||
} with
|
||||
|
||||
/// <summary>Create a minimal display page (no text or metadata) from a database page</summary>
|
||||
@@ -128,7 +131,8 @@ type DisplayPage = {
|
||||
IsInPageList = page.IsInPageList
|
||||
IsDefault = string page.Id = webLog.DefaultPage
|
||||
Text = ""
|
||||
Metadata = [] }
|
||||
Metadata = []
|
||||
OpenGraph = None }
|
||||
|
||||
/// <summary>Create a display page from a database page</summary>
|
||||
/// <param name="webLog">The web log to which the page belongs</param>
|
||||
@@ -136,8 +140,9 @@ type DisplayPage = {
|
||||
/// <returns>A <c>DisplayPage</c> with text and metadata</returns>
|
||||
static member FromPage webLog page =
|
||||
{ DisplayPage.FromPageMinimal webLog page with
|
||||
Text = addBaseToRelativeUrls webLog.ExtraPath page.Text
|
||||
Metadata = page.Metadata
|
||||
Text = addBaseToRelativeUrls webLog.ExtraPath page.Text
|
||||
Metadata = page.Metadata
|
||||
OpenGraph = page.OpenGraph
|
||||
}
|
||||
|
||||
|
||||
@@ -1165,6 +1170,9 @@ type PostListItem = {
|
||||
|
||||
/// <summary>Metadata for the post</summary>
|
||||
Metadata: MetaItem list
|
||||
|
||||
/// <summary>OpenGraph properties for the post</summary>
|
||||
OpenGraph: OpenGraphProperties option
|
||||
} with
|
||||
|
||||
/// <summary>Create a post list item from a post</summary>
|
||||
@@ -1183,7 +1191,8 @@ type PostListItem = {
|
||||
CategoryIds = post.CategoryIds |> List.map string
|
||||
Tags = post.Tags
|
||||
Episode = post.Episode
|
||||
Metadata = post.Metadata }
|
||||
Metadata = post.Metadata
|
||||
OpenGraph = post.OpenGraph }
|
||||
|
||||
|
||||
/// <summary>View model for displaying posts</summary>
|
||||
|
||||
Reference in New Issue
Block a user