mirror of
https://github.com/McShelby/hugo-theme-relearn.git
synced 2024-11-27 01:33:04 +00:00
topbar: edit button supports page editURL param before site one
Signed-off-by: Maxime Soulé <btik-git@scoubidou.com>
This commit is contained in:
parent
13b4513688
commit
7954509934
1 changed files with 3 additions and 3 deletions
|
@ -4,12 +4,12 @@
|
|||
{{- 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 }}
|
||||
{{- if and (eq $outputFormat "html") (or .Site.Params.editURL .Params.editURL) .File }}
|
||||
{{- $href := or .Params.editURL (printf "%s%s%s" .Site.Params.editURL (strings.TrimLeft "/" (replace .File.Dir "\\" "/")) .File.LogicalName) }}
|
||||
{{- partial "topbar/func/button.html" (dict
|
||||
"page" .
|
||||
"class" "topbar-button-edit"
|
||||
"href" (printf "%s%s%s" $editURL (strings.TrimLeft "/" (replace .File.Dir "\\" "/")) .File.LogicalName)
|
||||
"href" $href
|
||||
"icon" "pen"
|
||||
"onwidths" $onwidths
|
||||
"onwidthm" $onwidthm
|
||||
|
|
Loading…
Reference in a new issue