Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/peaceiris/hugo-theme-iris.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorpeaceiris <30958501+peaceiris@users.noreply.github.com>2021-06-17 19:05:40 +0300
committerpeaceiris <30958501+peaceiris@users.noreply.github.com>2021-06-17 19:05:40 +0300
commit1162d724fe35b4aae05044cffa444303c874a639 (patch)
tree4a798976c11797cce5ecc7de42dcc11c06dbcc86 /layouts
parent64a8e1c8a34af93095e5df5202a3c0c8dccffc89 (diff)
fix: Trim urls with strings.TrimRight
Diffstat (limited to 'layouts')
-rw-r--r--layouts/partials/edit-button.html2
-rw-r--r--layouts/partials/keyboard-shortcut.html4
-rw-r--r--layouts/partials/view-on-github-button.html2
-rw-r--r--layouts/robots.txt2
4 files changed, 5 insertions, 5 deletions
diff --git a/layouts/partials/edit-button.html b/layouts/partials/edit-button.html
index a2d329ca..4fad9d13 100644
--- a/layouts/partials/edit-button.html
+++ b/layouts/partials/edit-button.html
@@ -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 }}
diff --git a/layouts/partials/keyboard-shortcut.html b/layouts/partials/keyboard-shortcut.html
index 4a99b161..9322e03f 100644
--- a/layouts/partials/keyboard-shortcut.html
+++ b/layouts/partials/keyboard-shortcut.html
@@ -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':
diff --git a/layouts/partials/view-on-github-button.html b/layouts/partials/view-on-github-button.html
index 8383688f..90d0fae4 100644
--- a/layouts/partials/view-on-github-button.html
+++ b/layouts/partials/view-on-github-button.html
@@ -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 }}
diff --git a/layouts/robots.txt b/layouts/robots.txt
index 19e78ce8..7ab1db94 100644
--- a/layouts/robots.txt
+++ b/layouts/robots.txt
@@ -1,3 +1,3 @@
User-agent: *
-Sitemap: {{ .Site.BaseURL }}sitemap.xml
+Sitemap: {{ strings.TrimRight "/" .Site.BaseURL }}/sitemap.xml