From 5a2840e0c7ab317a9614f386d26600c9b0ad2356 Mon Sep 17 00:00:00 2001 From: Thibaut Lienart Date: Wed, 22 Sep 2021 14:11:04 +0200 Subject: [PATCH] bug fix for fd_page_html --- Project.toml | 2 +- src/converter/markdown/md.jl | 14 ++++++++++++++ 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/Project.toml b/Project.toml index 269eba973..b27f38a4c 100644 --- a/Project.toml +++ b/Project.toml @@ -1,7 +1,7 @@ name = "Franklin" uuid = "713c75ef-9fc9-4b05-94a9-213340da978e" authors = ["Thibaut Lienart "] -version = "0.10.56" +version = "0.10.57" [deps] Dates = "ade2ca70-3891-5945-98fb-dc099432e06a" diff --git a/src/converter/markdown/md.jl b/src/converter/markdown/md.jl index 5e243222e..bb5c700f4 100644 --- a/src/converter/markdown/md.jl +++ b/src/converter/markdown/md.jl @@ -173,6 +173,20 @@ function convert_md( title = first(values(PAGE_HEADERS))[1] set_var!(LOCAL_VARS, "title", title) end + + # need to fill in fd_full_url and fd_page_html as in write_page which + # isn't called in the pagevar branch. This needs to happen before the + # ALL_PAGE_VARS copy which is what `pagevar` will query later on. + if pagevar + full_url = joinpath( + locvar(:website_url)::String, + strip(locvar(:fd_url)::String, '/') + ) + set_var!(LOCAL_VARS, "fd_full_url", full_url) + ctt = convert_html(hstring) + set_var!(LOCAL_VARS, "fd_page_html", ctt) + end + # Copy vars to allpagevars to make them more easily accessible to other pages if !(isrecursive || isinternal) ALL_PAGE_VARS[rpath] = deepcopy(LOCAL_VARS)