Skip to content

Commit d6d7353

Browse files
authored
Fix meta-links (#1161)
1 parent 0a1fe3f commit d6d7353

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

layouts/partials/meta-links.html

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
{{ $gh_repo := .Site.Params.gitHubRepo }}
2-
{{ $gh_file := .File }}
2+
{{ $gh_path := .File.Dir }}
3+
{{ $gh_file := .File.LogicalName }}
34
{{ $gh_branch := "main" }}
45
{{ $parts := split .RelPermalink "/" }}
56
{{ if eq (index $parts 1) "staging" }}
@@ -9,10 +10,10 @@
910
{{ $gh_branch := "main" }}
1011
{{ end }}
1112

12-
{{ $path := replaceRE `(_index.md)$|(index.md)$|(.md)$` "" $gh_file }}
13+
{{ $stripped_filename := replaceRE `(_index.md)$|(index.md)$|(.md)$` "" $gh_file | lower }}
1314

14-
{{ $editURL := printf "%s/edit/%s/content/%s" $gh_repo $gh_branch $gh_file }}
15-
{{ $issuesURL := printf "%s/issues/new?title=Feedback: %s&body=Page https://redis.io/docs/latest/%s" $gh_repo (safeURL $.Title ) $path }}
15+
{{ $editURL := printf "%s/edit/%s/content/%s%s" $gh_repo $gh_branch $gh_path $gh_file }}
16+
{{ $issuesURL := printf "%s/issues/new?title=Feedback: %s&body=Page https://redis.io/docs/latest/%s%s" $gh_repo (safeURL $.Title ) $gh_path $stripped_filename }}
1617

1718
<nav class="flex flex-col gap-3 pb-3 w-52 text-redis-pencil-600 border-b border-b-redis-pen-700 border-opacity-50">
1819
<a {{ printf "href=%q" $editURL | safeHTMLAttr }} target="_blank" class="group inline-flex items-center gap-1 hover:text-redis-pen-400 mt-auto self-start">

0 commit comments

Comments
 (0)