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

Commit

Permalink
Update docs generation
Browse files Browse the repository at this point in the history
  • Loading branch information
Freymaurer committed Jun 8, 2022
1 parent c8965da commit e041f20
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 deletions.
1 change: 0 additions & 1 deletion src/generators/index.fsx
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ let generate' (ctx : SiteContents) (_: string) =
let landingPage = docs0 |> Seq.tryFind(fun x -> x.title = "Index")
match landingPage with
| Some docs ->
printfn "found!"
Layout.layout ctx docs.title [
docs |> Layout.docsLayout
]
Expand Down
14 changes: 10 additions & 4 deletions src/generators/layout.fsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,17 @@ let injectWebsocketCode (webpage:string) =
let index = webpage.IndexOf head
webpage.Insert ( (index + head.Length + 1),websocketScript)

let layout (ctx : SiteContents) active bodyCnt =
let layout (ctx : SiteContents) (activePageTitle: string) bodyCnt =
let siteInfo = ctx.TryGetValue<Globalloader.SiteInfo> ()
let ttl =
siteInfo
|> Option.map (fun si -> si.title)
|> Option.defaultValue ""
siteInfo
|> Option.map (fun si ->
if activePageTitle <> "" then
si.title + " - " + activePageTitle
else
si.title
)
|> Option.defaultValue ""

html [Class "has-navbar-fixed-top"; HtmlProperties.Style [CSSProperties.Custom("scroll-behavior", "smooth")]] [
head [] [
Expand Down Expand Up @@ -132,6 +137,7 @@ let docsLayout (docs: Docsloader.Docs) =
// Edit this page link
div [] [
a [
Target "_blank"
Href $"https://github.com/nfdi4plants/nfdi4plants.github.io/tree/main/src/{docs.file}";
HtmlProperties.Style [MarginLeft "auto"; Display "block"; CSSProperties.Width "130px"]
] [!! "✏️ Edit this page"]
Expand Down

0 comments on commit e041f20

Please sign in to comment.