Skip to content

mounts: Add name mapping config option #10129

Open
@bep

Description

@bep

I'm doing some foundational improvements to Hugo, and I stumbled over some limitations to single file mounts (as in: Not a directory). These mounts were intended to be used for directories, that the file mounts worked was a little accidental. One use case would be the below:

[module]
  [[module.mounts]]
    source = "README.md"
    target = "content/_index.md"

There are some limitations to the above, and it also makes the mount code unnecessarily complex. So, with the work I'm doing right now I'm rewriting the above to be a directory mount with a source filter (README.md) and a name map (README.md<=> _index.md).

I have not exposed this feature in the config yet, but I suspect it would be really useful, as described in #4691

I'm not sure how it would look, maybe:

[module]
  [[module.mounts]]
    source = "." # Project root
    target = "content"
    includeFiles = "**/*.md"
     [[module.mounts.renames]]
     "README.md".to "_index.md"

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions