Commit: 3aba66886378420ada775803a060eafc30c6caf2 Parent: b68dca25ec95e54f2c86e77343003969972b3345 Author: Vi Grey Date: 2024-05-08 07:51 UTC Summary: Fix %REL_HOME% path generation CHANGELOG.txt | 6 ++++++ src/huginn.go | 11 +++++++++-- 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.txt b/CHANGELOG.txt index 5e1b583..60f4791 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -2,6 +2,12 @@ All notable changes to this project will be documented in this file. +## [0.0.28] - 2024-05-08 + +### Fixed +- Fix %REL_HOME% path generation + + ## [0.0.27] - 2024-05-03 ### Changed diff --git a/src/huginn.go b/src/huginn.go index 8a47410..f3f0cd1 100644 --- a/src/huginn.go +++ b/src/huginn.go @@ -9,7 +9,7 @@ import ( const ( PROGRAM = "huginn" - VERSION = "0.0.27" + VERSION = "0.0.28" ) func init() { @@ -55,7 +55,14 @@ func main() { } else if tokens[x].tokenType == LAYOUT_TOKEN_TYPE_GEMINI_CONTENT { translateGemtextFileToHTML(htmlFile, relPath, textonly) } else if tokens[x].tokenType == LAYOUT_TOKEN_TYPE_REL_HOME { - htmlFile.Write([]byte{'/'}) + if relative { + if relHome := getRelativePath(relPath, "/"); relHome != "." { + htmlFile.Write([]byte(relHome)) + htmlFile.Write([]byte{'/'}) + } + } else { + htmlFile.Write([]byte{'/'}) + } } else if tokens[x].tokenType == LAYOUT_TOKEN_TYPE_INDEXLESS_PAGE_PATH { htmlFile.Write([]byte(filepath.Join("/", indexlessPath(pagePath)))) } else if tokens[x].tokenType == LAYOUT_TOKEN_TYPE_PAGE_PATH {