HUGO

Mount root of repository

Is there any way to mount the root of a repository?

Structure of github.com/user/foo:

.
├── a.jpg
└── b.jpg

Site configuration (causes panic):

[[module.imports]]
path = "github.com/user/foo"

[[module.imports.mounts]]
source = "/"
target = "assets/images"

Panic:

panic: invalid root mapping; from/to: assets/images//

I can easily restructure the repository if I need to.

/ is interpreted as an absolute path – which I assume will only work on *nix, and is most likely not what you would ever, ever want.

I’m not sure why you would map the entire root, but I would assume this would work:

[[module.imports.mounts]]
source = "."
target = "assets/images"

But please do not report a bug if it doesn’t.

Just to be clear about the above, for the security minded:

  • / is only interpreted as an absolute path on *nix, not Windows (on Windows, I guess, it’s just not found)
  • Absolute paths are not allowed in theme/module mappings, only in the main project

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.