Skip to content
This repository has been archived by the owner on Oct 21, 2024. It is now read-only.

Commit

Permalink
Try fix path change for sidebarurls
Browse files Browse the repository at this point in the history
  • Loading branch information
Freymaurer committed Jul 11, 2022
1 parent d2d2630 commit b277eab
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
4 changes: 0 additions & 4 deletions src/Nfdi4Plants.Fornax/Loaders.fs
Original file line number Diff line number Diff line change
Expand Up @@ -163,11 +163,7 @@ type Docs with

let content = Aux.getContent text
let sidebar =
#if WATCH
addSidebar |> Option.map (Aux.getSidebar contentDir None)
#else
addSidebar |> Option.map (Aux.getSidebar contentDir productionBasePath)
#endif
let chopLength =
if rootDir.EndsWith(Path.DirectorySeparatorChar) then rootDir.Length
else rootDir.Length + 1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,15 @@ module NfdiSidebarElementHeader =
let attr = hb.GetAttributes()
attr.AddProperty("slot", "inner")

#if WATCH
if href.IsSome then
attr.AddProperty("href", href.Value)
#else
if href.IsSome then
let nextHref = if productionBasePath.IsSome then "/" + productionBasePath.Value.Trim([|'/'|]) + "/" + href.Value.Trim([|'/'|]) else href.Value
attr.AddProperty("href", nextHref)
#endif


if (renderer.EnableHtmlForBlock) then
renderer.Write('<') |> ignore
Expand Down Expand Up @@ -82,6 +88,5 @@ module NfdiSidebarElementHeader =
// <param name="pipeline">The Markdig <see cref="MarkdownPipelineBuilder"/> to add the extension to</param>
static member UseSidebarHeader(pipeline : MarkdownPipelineBuilder, ?productionBasePath) =
let x = if productionBasePath.IsSome then SidebarHeaderExtension(productionBasePath.Value) else SidebarHeaderExtension()
printfn "HIT: %A" productionBasePath
pipeline.Extensions.Add(x)
pipeline

0 comments on commit b277eab

Please sign in to comment.