From ca01b67396d39e87ac8f1de62955133cb3aa59a7 Mon Sep 17 00:00:00 2001 From: mark Date: Sat, 16 Dec 2023 07:53:12 +0100 Subject: [PATCH 1/3] Mount data folder --- config/_default/hugo.toml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/config/_default/hugo.toml b/config/_default/hugo.toml index 952cf389a..76c07dae4 100644 --- a/config/_default/hugo.toml +++ b/config/_default/hugo.toml @@ -104,6 +104,9 @@ home = ["HTML", "RSS", "REDIR"] [[module.mounts]] source = "content" target = "content" + [[module.mounts]] + source = "data" + target = "data" [[module.mounts]] source = "i18n" target = "i18n" From b6f034f8e305a5956054ff9f083e7ed269c3ca42 Mon Sep 17 00:00:00 2001 From: mark Date: Sat, 16 Dec 2023 08:03:07 +0100 Subject: [PATCH 2/3] Add support for absolute paths --- layouts/partials/utilities/GetResource.html | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/layouts/partials/utilities/GetResource.html b/layouts/partials/utilities/GetResource.html index 803477cb0..7ec11a5f8 100644 --- a/layouts/partials/utilities/GetResource.html +++ b/layouts/partials/utilities/GetResource.html @@ -1,13 +1,28 @@ {{ $url := .url -}} {{ $page := .page -}} +{{ if hasPrefix $url "/" }} + {{ $pageContext := (path.Join "/content" $page.File.Dir) -}} + {{ if hasPrefix $url $pageContext }} + {{ $url = strings.TrimPrefix $pageContext $url -}} + {{ else if hasPrefix $url "/assets/" }} + {{ $url = strings.TrimPrefix "/assets/" $url -}} + {{ end }} + {{ $url = strings.TrimPrefix "/" $url -}} +{{ end }} {{ $res := "" }} {{ $remote := hasPrefix (lower $url) "http" }} From 1223a22d7e3dc18021fb6ebf5df0427c6de0e931 Mon Sep 17 00:00:00 2001 From: mark Date: Sat, 16 Dec 2023 08:03:31 +0100 Subject: [PATCH 3/3] Bump package version --- package-lock.json | 4 ++-- package.json | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/package-lock.json b/package-lock.json index 1cab921dd..8dc2a3db6 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@gethinode/hinode", - "version": "0.21.10", + "version": "0.21.11", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@gethinode/hinode", - "version": "0.21.10", + "version": "0.21.11", "license": "MIT", "devDependencies": { "@fullhuman/postcss-purgecss": "^5.0.0", diff --git a/package.json b/package.json index 40f3c632e..18482e24c 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@gethinode/hinode", - "version": "0.21.10", + "version": "0.21.11", "description": "Hinode is a clean documentation and blog theme for Hugo, an open-source static site generator", "keywords": [ "hugo",