mirror of
https://github.com/McShelby/hugo-theme-relearn.git
synced 2024-11-23 15:57:57 +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 }}
|
{{- with .page }}
|
||||||
{{- $format := partial "get-format.hugo" . }}
|
{{- $format := partial "get-format.hugo" . }}
|
||||||
{{- $outputFormat := partial "output-format.hugo" (dict "page" . "format" $format) }}
|
{{- $outputFormat := partial "output-format.hugo" (dict "page" . "format" $format) }}
|
||||||
{{- $editURL := .Site.Params.editURL | default "" }}
|
{{- if and (eq $outputFormat "html") (or .Site.Params.editURL .Params.editURL) .File }}
|
||||||
{{- if and (eq $outputFormat "html") $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
|
{{- partial "topbar/func/button.html" (dict
|
||||||
"page" .
|
"page" .
|
||||||
"class" "topbar-button-edit"
|
"class" "topbar-button-edit"
|
||||||
"href" (printf "%s%s%s" $editURL (strings.TrimLeft "/" (replace .File.Dir "\\" "/")) .File.LogicalName)
|
"href" $href
|
||||||
"icon" "pen"
|
"icon" "pen"
|
||||||
"onwidths" $onwidths
|
"onwidths" $onwidths
|
||||||
"onwidthm" $onwidthm
|
"onwidthm" $onwidthm
|
||||||
|
|
Loading…
Reference in a new issue