Skip to content

Add GitInfo to Site for site-wide commit info #13206

@BartG95

Description

@BartG95

For example, I want to link to the git repo containing the source code of my website. But the source might have progressed after the latest build/deploy, so I can't just link to the main branch (well, I can, but the main branch does not necessarily has the source code of the current build/deploy). Instead I want to link to the repo at a specific commit, specifically the commit we were at while building/deploying.

For the time being, I work around this by wrapping hugo in a Makefile, that also creates a 'commit_id' file in my assets folder containing the output of git rev-parse --verify HEAD, and then using that via os.ReadFile. It works fine, but it is far from elegant.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions