Skip to content

Commit

Permalink
fix: Trim urls with strings.TrimRight
Browse files Browse the repository at this point in the history
  • Loading branch information
peaceiris committed Jun 17, 2021
1 parent 64a8e1c commit 1162d72
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion layouts/partials/edit-button.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{{ with $.Site.Params.repo }}
<a class="button is-pulled-right" href="{{ .URL }}/edit/{{ .branch }}/{{ .contentDir }}/{{ $.Lang }}/{{ $.File.Path }}">
<a class="button is-pulled-right" href="{{ strings.TrimRight "/" .URL }}/edit/{{ .branch }}/{{ .contentDir }}/{{ $.Lang }}/{{ $.File.Path }}">
{{ i18n "edit" }}
</a>
{{ end }}
4 changes: 2 additions & 2 deletions layouts/partials/keyboard-shortcut.html
Original file line number Diff line number Diff line change
Expand Up @@ -72,12 +72,12 @@
break;
{{ with $.Site.Params.repo }}
case 'g+e':
window.open('{{ .URL }}/edit/{{ .branch }}/{{ .contentDir }}/{{ $.Lang }}/{{ $.File.Path }}', '_blank');
window.open('{{ strings.TrimRight "/" .URL }}/edit/{{ .branch }}/{{ .contentDir }}/{{ $.Lang }}/{{ $.File.Path }}', '_blank');
break;
{{ end }}
{{ with $.Site.Params.repo }}
case 'g+s':
window.open('{{ .URL }}/blob/{{ .branch }}/{{ .contentDir }}/{{ $.Lang }}/{{ $.File.Path }}', '_blank');
window.open('{{ strings.TrimRight "/" .URL }}/blob/{{ .branch }}/{{ .contentDir }}/{{ $.Lang }}/{{ $.File.Path }}', '_blank');
break;
{{ end }}
case 'r':
Expand Down
2 changes: 1 addition & 1 deletion layouts/partials/view-on-github-button.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{{ with $.Site.Params.repo }}
<a class="button is-pulled-right" href="{{ .URL }}/blob/{{ .branch }}/{{ .contentDir }}/{{ $.Lang }}/{{ $.File.Path }}">
<a class="button is-pulled-right" href="{{ strings.TrimRight "/" .URL }}/blob/{{ .branch }}/{{ .contentDir }}/{{ $.Lang }}/{{ $.File.Path }}">
{{ i18n "view_on_github" }}
</a>
{{ end }}
2 changes: 1 addition & 1 deletion layouts/robots.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
User-agent: *

Sitemap: {{ .Site.BaseURL }}sitemap.xml
Sitemap: {{ strings.TrimRight "/" .Site.BaseURL }}/sitemap.xml

0 comments on commit 1162d72

Please sign in to comment.