Skip to content

Hugo Modules : Allow for replacements path within imports listing #11875

@HenrySkup

Description

@HenrySkup

Hi,

I think this might improve the maintenance of config files.

I have a hugo website pulling modules from several repos and which uses replacements to use local files which will be the most up-to-date and gets around issues when the internet is not accessible.

I think this would be similar to the intention of having the disable : true | false in the imports listings.

Currently

# config/*/module.yaml

replacements: 
  github.com/me/project-1 -> ../local/file/project-1, 
  github.com/me/project-2 -> ../local/file/project-2, 
  github.com/me/project-3 -> ../local/file/project-3, 
  github.com/me/project-4 -> ../local/file/project-4, 
imports :
  # other imports
  - # Project 1
    disable : false
    path : github.com/me/project-1
    # these imports can get quite complex with mounts 
  - # Project 2
    path : github.com/me/project-2
  - # Project 3
    path : github.com/me/project-3
  - # Project 4
    path : github.com/me/project-4

Suggestion

# config/*/module.yaml

imports :
  # other imports
  - # Project 1
    disable : false
    path : github.com/me/project-1
    replacement : ../local/file/project-1
    # these imports can get quite complex with mounts 
  - # Project 2
    path : github.com/me/project-2
    replacement : ../local/file/project-2
  - # Project 3
    path : github.com/me/project-3
    replacement : ../local/file/project-3
  - # Project 4
    path : github.com/me/project-4
    replacement : ../local/file/project-4

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions