Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions hugo.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,15 @@ params:
icon: "fab fa-slack"
desc: "Chat with other project developers"

# Allow content to retrieve the PULL_REQUEST and BRANCH environment variables.
# These are provided during Netlify builds:
# https://docs.netlify.com/build/configure-builds/environment-variables/#git-metadata
security:
funcs:
getenv:
- PULL_REQUEST
- BRANCH

# hugo module configuration

module:
Expand Down
18 changes: 18 additions & 0 deletions layouts/_partials/version-banner.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{{- /* https://docs.netlify.com/build/configure-builds/environment-variables/#git-metadata */ -}}
{{- $is_pr := getenv "PULL_REQUEST" -}}
{{- $branch := getenv "BRANCH" -}}
{{- if or (ne $is_pr "true") (ne $branch "stable") -}}
{{- $color := "primary" -}}
<div class="pageinfo pageinfo-{{ $color }}">
<p>
{{- if eq $is_pr "true" -}}
This is a preview of a Pull Request for SOPS documentation.
{{- else if eq $branch "main" -}}
This is the development version of the SOPS documentation.
{{- else -}}
This is a preview of the SOPS documentation.
{{- end }}
The documentation for the latest SOPS release can be found on <a href="https://getsops.io/">getsops.io</a>.
</p>
</div>
{{ end -}}