{{ $gh_repo := .Site.Params.gitHubRepo }} {{ $gh_path := .File.Dir }} {{ $gh_file := .File.LogicalName }} {{ $gh_branch := "main" }} {{ $parts := split .RelPermalink "/" }} {{ if eq (index $parts 1) "staging" }} {{ $gh_branch := index $parts 2 }} {{ end }} {{ if eq $gh_branch "dev" }} {{ $gh_branch := "main" }} {{ end }} {{ $stripped_filename := replaceRE `(_index.md)$|(index.md)$|(.md)$` "" $gh_file | lower }} {{ $editURL := printf "%s/edit/%s/content/%s%s" $gh_repo $gh_branch $gh_path $gh_file }} {{ $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 }}