Skip to content

Commit

Permalink
fix up case where there's no readme in path
Browse files Browse the repository at this point in the history
trailing slash was defeating me
  • Loading branch information
SallyMcGrath committed Oct 27, 2024
1 parent a9160fb commit d22aa9d
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions common-theme/layouts/partials/strings/readme-paths.html
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@

{{ $newSrc := .src }}

{{/* Remove trailing slash if present */}}
{{ $newSrc = replaceRE "/$" "" $newSrc }}

{{/* Handle /blob/main/path/readme.md format */}}
{{ $newSrc = replaceRE "/blob/main/(.+?)/(?i:readme\\.md)$" "/readme/$1" $newSrc }}

Expand Down

0 comments on commit d22aa9d

Please sign in to comment.