diff --git a/docs/far/from/home.nim b/docs/far/from/home.nim index 7a0db523..984b7d0f 100644 --- a/docs/far/from/home.nim +++ b/docs/far/from/home.nim @@ -1,8 +1,8 @@ import nimib, strutils nbInit -nb.context["home_path"] = nb.context["home_path"].castStr.replace("/", r"\") # for CI since I run locally on Windows and CI runs on Linux: behaviour is the same -nb.context["here_path"] = nb.context["here_path"].castStr.replace("/", r"\") # for CI since I run locally on Windows and CI runs on Linux: behaviour is the same +nb.context["path_to_root"] = nb.context["path_to_root"].castStr.replace("/", r"\") # for CI since I run locally on Windows and CI runs on Linux: behaviour is the same +nb.context["path_to_here"] = nb.context["path_to_here"].castStr.replace("/", r"\") # for CI since I run locally on Windows and CI runs on Linux: behaviour is the same nb.partials["document"] = """ -🕷️ is {{here_path}} 🏡 ({{home_path}}) +🕷️ is {{path_to_here}} 🏡 ({{path_to_root}}) """ nbSave \ No newline at end of file diff --git a/nimib.nimble b/nimib.nimble index a5164bc3..9271aeb0 100644 --- a/nimib.nimble +++ b/nimib.nimble @@ -1,6 +1,6 @@ # Package -version = "0.2" +version = "0.2.1" author = "Pietro Peterlongo" description = "nimib 🐳 - nim 👑 driven ⛵ publishing ✍" license = "MIT" diff --git a/src/nimib.nim b/src/nimib.nim index cba6fd64..7de24ad8 100644 --- a/src/nimib.nim +++ b/src/nimib.nim @@ -74,7 +74,7 @@ template nbInit*(theme = themes.useDefault, thisFileRel = "") = nb.blk = NbBlock(kind: nbkImage, code: url) else: # Relative URL - let relativeUrl = nb.context["home_path"].vString / url + let relativeUrl = nb.context["path_to_root"].vString / url nb.blk = NbBlock(kind: nbkImage, code: relativeUrl) nb.blk.output = caption diff --git a/src/nimib/themes.nim b/src/nimib/themes.nim index e7162123..b817e14b 100644 --- a/src/nimib/themes.nim +++ b/src/nimib/themes.nim @@ -70,7 +70,7 @@ const header* = """
" & doc.context["title"].castStr & "
"
if isGitAvailable() and isOnGithub():
doc.partials["header_right"] = githubLink
diff --git a/src/nimib/types.nim b/src/nimib/types.nim
index 17d6559d..5186b749 100644
--- a/src/nimib/types.nim
+++ b/src/nimib/types.nim
@@ -45,4 +45,4 @@ proc homeDir*(doc: NbDoc): AbsoluteDir =
else:
doc.cfgDir / doc.cfg.homeDir.RelativeDir
proc thisFileRel*(doc: NbDoc): RelativeFile = doc.thisFile.relativeTo doc.srcDir
-proc homeDirRel*(doc: NbDoc): RelativeDir = doc.homeDir.relativeTo doc.thisDir
\ No newline at end of file
+proc srcDirRel*(doc: NbDoc): RelativeDir = doc.srcDir.relativeTo doc.thisDir
\ No newline at end of file