From 19950c2031c4debfae7c0dc080613f2668fd369b Mon Sep 17 00:00:00 2001 From: Razon Yang Date: Wed, 13 Nov 2024 12:02:25 +0800 Subject: [PATCH] fix: do not fetch contributors for uncommitted content (#111) You'll need to enable [GitInfo](https://gohugo.io/methods/page/gitinfo/) feature via setting the `enableGitInfo` parameter on configuration file or specify the `--enableGitInfo` flag to `hugo` command. Closes #110 --- layouts/partials/hb/modules/revision/index.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/layouts/partials/hb/modules/revision/index.html b/layouts/partials/hb/modules/revision/index.html index c8705d2..b08cd51 100644 --- a/layouts/partials/hb/modules/revision/index.html +++ b/layouts/partials/hb/modules/revision/index.html @@ -29,7 +29,7 @@ {{- $editURL = printf "https://github.com/%s/%s/edit/%s/%s" $params.repo_owner $params.repo_name $repoBranch $path }} {{- $viewURL = printf "https://github.com/%s/%s/blob/%s/%s" $params.repo_owner $params.repo_name $repoBranch $path }} {{- $historyURL = printf "https://github.com/%s/%s/commits/%s/%s" $params.repo_owner $params.repo_name $repoBranch $path }} - {{- if $showContributors }} + {{- if and $showContributors .GitInfo }} {{- $opts := dict "key" $.Lastmod }} {{- with getenv "GITHUB_TOKEN" }} {{- $opts = merge $opts (dict "headers" (dict "Authorization" (printf "Bearer %s" .))) }}