-
Notifications
You must be signed in to change notification settings - Fork 465
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
BREAKING CHANGE: fix Hugo's .Site.IsServer error
As of Hugo 0.120.0, `.Site.IsServer` is deprecated, and starting with Hugo 0.132.0, it causes a build error. Unfortunately, this is a breaking upstream change that we can't "fix" on our end. As a result, we had to raise the minimum supported version to v0.54.0 and implement another workaround to ensure compatibility with older versions, not just Hugo v0.120.0 and all subsequent versions. Fix #369
- Loading branch information
Showing
6 changed files
with
20 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,11 @@ | ||
{{ if and .Site.Config.Services.Disqus.Shortname (index .Params "comments" | default "true") (not .Site.IsServer) }} | ||
{{- $server := "" }} | ||
{{- if ge (int (index (split hugo.Version ".") 1)) "120" }} | ||
{{- $server = hugo.IsServer }} | ||
{{- else }} | ||
{{- $server = .Site.IsServer }} | ||
{{- end }} | ||
{{- if and .Site.Config.Services.Disqus.Shortname (index .Params "comments" | default "true") (not $server) }} | ||
<section class="comments"> | ||
{{ template "_internal/disqus.html" . }} | ||
</section> | ||
{{ end }} | ||
{{- end }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters