Framework Config: Added /srv/dev/hugo/wiki as a Hugo Module Mount & Generalized include.html to handle any /srv/ path by mapping it to the virtual assets directory.
This commit is contained in:
@@ -43,12 +43,18 @@ enableGitInfo = true
|
|||||||
[[module.mounts]]
|
[[module.mounts]]
|
||||||
source = "/srv/docs/private"
|
source = "/srv/docs/private"
|
||||||
target = "content/private"
|
target = "content/private"
|
||||||
|
[[module.mounts]]
|
||||||
|
source = "/srv/docs/public/projects/hugo"
|
||||||
|
target = "content/public/projects/hugo"
|
||||||
[[module.mounts]]
|
[[module.mounts]]
|
||||||
source = "assets"
|
source = "assets"
|
||||||
target = "assets"
|
target = "assets"
|
||||||
[[module.mounts]]
|
[[module.mounts]]
|
||||||
source = "/srv/configs"
|
source = "/srv/configs"
|
||||||
target = "assets/configs"
|
target = "assets/configs"
|
||||||
|
[[module.mounts]]
|
||||||
|
source = "/srv/dev/hugo/wiki"
|
||||||
|
target = "assets/dev/hugo/wiki"
|
||||||
|
|
||||||
[security]
|
[security]
|
||||||
[security.funcs]
|
[security.funcs]
|
||||||
|
|||||||
@@ -2,8 +2,8 @@
|
|||||||
{{- $content := "" -}}
|
{{- $content := "" -}}
|
||||||
{{- $found := false -}}
|
{{- $found := false -}}
|
||||||
|
|
||||||
{{- /* Handle /srv/configs/ mapping to assets mount (mounted at assets/configs) */ -}}
|
{{- /* Handle /srv/ mapping to assets mount (trimming leading /srv/) */ -}}
|
||||||
{{- if strings.HasPrefix $path "/srv/configs/" -}}
|
{{- if strings.HasPrefix $path "/srv/" -}}
|
||||||
{{- $assetPath := strings.TrimPrefix "/srv/" $path -}}
|
{{- $assetPath := strings.TrimPrefix "/srv/" $path -}}
|
||||||
{{- $res := resources.Get $assetPath -}}
|
{{- $res := resources.Get $assetPath -}}
|
||||||
{{- if $res -}}
|
{{- if $res -}}
|
||||||
|
|||||||
Reference in New Issue
Block a user