hugo-theme-relearn/layouts/partials/topbar/button/source.html
2025-01-29 14:19:27 +01:00

22 lines
No EOL
736 B
HTML

{{- $onwidths := cond (isset . "onwidths") .onwidths "area-more" }}
{{- $onwidthm := cond (isset . "onwidthm") .onwidthm "show" }}
{{- $onwidthl := cond (isset . "onwidthl") .onwidthl "show" }}
{{- with .page }}
{{- $format := .OutputFormats.Get "source" }}
{{- $show := and $format (not (.Param "disableSourceButton")) }}
{{- if $show }}
{{- $show = and (not (partial "_relearn/pageIsSpecial.gotmpl" .)) .File .File.Filename }}
{{- end }}
{{- if $show }}
{{- partial "topbar/func/button.html" (dict
"page" .
"class" "topbar-button-source"
"href" $format.RelPermalink
"icon" "file-code"
"onwidths" $onwidths
"onwidthm" $onwidthm
"onwidthl" $onwidthl
"hint" (T "Show-source")
)}}
{{- end }}
{{- end }}