Skip to content

Commit

Permalink
Fix repo Widget on windows computers
Browse files Browse the repository at this point in the history
Fix repo widget creating link with backslashes when hugo is running on windows
  • Loading branch information
SZRabinowitz committed Feb 21, 2024
1 parent 7e1f9d5 commit 61d42df
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions layouts/partials/docs/repo.html
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ <h2 class="card-title fs-4 my-2 text-surface d-none d-lg-block">{{ i18n "repo_ti
<ul class="list-unstyled">
{{- if $.File -}}
{{- $filePath := printf "%s/%s%s" $branch $subPath (strings.TrimPrefix $root $.File.Filename) -}}
{{- $filePath = replace $filePath "\\" "/" -}}
<li class="mb-1">
<a href="{{ printf $sourceUrlFormat $url $filePath }}" target="_blank" rel="noopener noreferrer">
<i class="fas fa-fw fa-file-archive text-success"></i> {{ i18n "repo_action_view" }}
Expand Down

0 comments on commit 61d42df

Please sign in to comment.