github.com/choria-io/go-choria@v0.28.1-0.20240416190746-b3bf9c7d5a45/docs/themes/hugo-theme-relearn/layouts/partials/topbar/button/edit.html (about)

     1  {{- $onwidths := cond (isset . "onwidths") .onwidths "area-more" }}
     2  {{- $onwidthm := cond (isset . "onwidthm") .onwidthm "show" }}
     3  {{- $onwidthl := cond (isset . "onwidthl") .onwidthl "show" }}
     4  {{- with .page }}
     5  	{{- $format := partial "get-format.hugo" . }}
     6  	{{- $outputFormat := partial "output-format.hugo" (dict "page" . "format" $format) }}
     7  	{{- if and (eq $outputFormat "html") .File }}
     8  		{{- $filePath := printf "%s%s" (strings.TrimLeft "/" (replace .File.Dir "\\" "/")) .File.LogicalName }}
     9  		{{- $href := "" }}
    10  		{{- if .Site.Params.editURL }}
    11  			{{- $href = .Site.Params.editURL }}
    12  			{{- if not (strings.Contains $href "${FilePath}") }}
    13  				{{ $href = printf "%s%s" $href "${FilePath}" }}
    14  			{{- end }}
    15  		{{- end }}
    16  		{{- if isset .Params "editurl" }}
    17  			{{- $href = .Params.editURL }}
    18  		{{- end }}
    19  		{{- $href = strings.Replace $href "${FilePath}" $filePath }}
    20  		{{- if $href }}
    21  			{{- partial "topbar/func/button.html" (dict
    22  				"page" .
    23  				"class" "topbar-button-edit"
    24  				"href" $href
    25  				"icon" "pen"
    26  				"onwidths" $onwidths
    27  				"onwidthm" $onwidthm
    28  				"onwidthl" $onwidthl
    29  				"hint" (printf "%s (CTRL+ALT+w)" (T "Edit-this-page"))
    30  			)}}
    31  		{{- end }}
    32  	{{- end }}
    33  {{- end }}