Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
BartG95 opened this issue Dec 30, 2024 · 0 comments
Open

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

BartG95 opened this issue Dec 30, 2024 · 0 comments

Comments

@BartG95
Copy link

BartG95 commented Dec 30, 2024

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant