Replace URLs in pages when not at directory root
This commit is contained in:
parent
b971a343a4
commit
5daf18e01d
|
@ -93,6 +93,7 @@ type DisplayPage =
|
||||||
/// The metadata for the page
|
/// The metadata for the page
|
||||||
metadata : MetaItem list
|
metadata : MetaItem list
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Create a minimal display page (no text or metadata) from a database page
|
/// Create a minimal display page (no text or metadata) from a database page
|
||||||
static member fromPageMinimal webLog (page : Page) =
|
static member fromPageMinimal webLog (page : Page) =
|
||||||
let pageId = PageId.toString page.id
|
let pageId = PageId.toString page.id
|
||||||
|
@ -106,8 +107,10 @@ type DisplayPage =
|
||||||
text = ""
|
text = ""
|
||||||
metadata = []
|
metadata = []
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Create a display page from a database page
|
/// Create a display page from a database page
|
||||||
static member fromPage webLog (page : Page) =
|
static member fromPage webLog (page : Page) =
|
||||||
|
let _, extra = WebLog.hostAndPath webLog
|
||||||
let pageId = PageId.toString page.id
|
let pageId = PageId.toString page.id
|
||||||
{ id = pageId
|
{ id = pageId
|
||||||
title = page.title
|
title = page.title
|
||||||
|
@ -116,7 +119,7 @@ type DisplayPage =
|
||||||
updatedOn = page.updatedOn
|
updatedOn = page.updatedOn
|
||||||
showInPageList = page.showInPageList
|
showInPageList = page.showInPageList
|
||||||
isDefault = pageId = webLog.defaultPage
|
isDefault = pageId = webLog.defaultPage
|
||||||
text = page.text
|
text = if extra = "" then page.text else page.text.Replace ("href=\"/", $"href=\"{extra}/")
|
||||||
metadata = page.metadata
|
metadata = page.metadata
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
"hostname": "data02.bitbadger.solutions",
|
"hostname": "data02.bitbadger.solutions",
|
||||||
"database": "myWebLog_dev"
|
"database": "myWebLog_dev"
|
||||||
},
|
},
|
||||||
"Generator": "myWebLog 2.0-alpha15",
|
"Generator": "myWebLog 2.0-alpha16",
|
||||||
"Logging": {
|
"Logging": {
|
||||||
"LogLevel": {
|
"LogLevel": {
|
||||||
"MyWebLog.Handlers": "Debug"
|
"MyWebLog.Handlers": "Debug"
|
||||||
|
|
Loading…
Reference in New Issue
Block a user