hugo-theme-relearn/layouts/partials/topbar/button/edit.html

20 lines
827 B
HTML
Raw Normal View History

2023-09-18 18:24:49 +00:00
{{- $onwidths := cond (isset . "onwidths") .onwidths "area-more" }}
{{- $onwidthm := cond (isset . "onwidthm") .onwidthm "show" }}
{{- $onwidthl := cond (isset . "onwidthl") .onwidthl "show" }}
{{- with .page }}
{{- $format := partial "get-format.hugo" . }}
{{- $outputFormat := partial "output-format.hugo" (dict "page" . "format" $format) }}
{{- $editURL := .Site.Params.editURL | default "" }}
{{- if and (eq $outputFormat "html") $editURL .File }}
{{- partial "topbar/func/button.html" (dict
"page" .
"class" "topbar-button-edit"
"href" (printf "%s%s%s" $editURL (strings.TrimLeft "/" (replace .File.Dir "\\" "/")) .File.LogicalName)
"icon" "pen"
"onwidths" $onwidths
"onwidthm" $onwidthm
"onwidthl" $onwidthl
2023-12-05 07:40:58 +00:00
"hint" (printf "%s (CTRL+ALT+w)" (T "Edit-this-page"))
2023-09-18 18:24:49 +00:00
)}}
{{- end }}
{{- end }}