Skip to content

Commit de2d74a

Browse files
authored
Create edit-page.html
1 parent f7c0fa6 commit de2d74a

1 file changed

Lines changed: 11 additions & 0 deletions

File tree

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{{/* Overrides the default edit-page.html partial for complex paths */}}
2+
{{ $path := replace .File.Path .Lang "" }}
3+
{{ $path = replace $path "content." "" }}
4+
{{ $path = strings.TrimLeft "/" $path }}
5+
{{ $path = strings.TrimRight "." $path }}
6+
{{ $url := printf "%s/edit/docs/%s" $.Site.Params.BookRepo $path }}
7+
8+
<a href="{{ $url | safeURL }}" title='{{ T "Edit this page" }}' rel="noopener" target="_blank">
9+
{{ with partial "svgs/icon-edit.svg" . }} {{ . }} {{ end }}
10+
{{ T "Edit this page" }}
11+
</a>

0 commit comments

Comments
 (0)