Skip to content

Commit

Permalink
topbar: edit button supports page editURL param before site one
Browse files Browse the repository at this point in the history
Signed-off-by: Maxime Soulé <btik-git@scoubidou.com>
  • Loading branch information
maxatome committed Jan 23, 2024
1 parent 13b4513 commit 7954509
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions layouts/partials/topbar/button/edit.html
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 7954509

Please sign in to comment.