Skip to content

Commit

Permalink
fix(btn-link): correct the broken links related to the current page w…
Browse files Browse the repository at this point in the history
…hen the url not begin with a leading slash
  • Loading branch information
razonyang committed Sep 20, 2023
1 parent a2d4b77 commit 942f4d9
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion layouts/partials/bootstrap/btn-link.html
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,11 @@
{{- with site.GetPage $url }}
{{- $url = .RelPermalink }}
{{- else }}
{{- $url = relURL $url }}
{{- if hasPrefix $url "/" }}
{{- $url = relURL $url }}
{{- else }}
{{- $url = printf "%s%s" .Page.RelPermalink $url }}
{{- end }}
{{- end }}
{{- end }}
{{- $classes := slice "btn" }}
Expand Down

0 comments on commit 942f4d9

Please sign in to comment.