Skip to content

Support GitInfo for content folders in different Git repositories #5533

@deanishe

Description

@deanishe

GitInfo provides metadata about content files, but from my observations and reading of the code, it actually searches the working directory for a git repo, not the content directory.

As a result, if content and theme/configuration are kept in separate repos (including when content is a submodule), Hugo fails to find any git metadata for the content files because it's querying the wrong repo.

Because GitInfo is for information about content, not theme/build configuration etc., Hugo should search for a git repo from the content directory, not the working directory, which is generally where the configuration and themes are found, and may or may not be in the same repo.

This should make GitInfo behave correctly for anyone who keeps their content in a separate repo, while continuing to work as before for mono-repos.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions