diff --git a/pages/_.vue b/pages/_.vue index 272c2303..ecdaaf81 100644 --- a/pages/_.vue +++ b/pages/_.vue @@ -77,7 +77,7 @@ templates: templates, getTemplate: getTemplate, - selectedTemplate: buildTemplate(templates, this.$route.path.substr(1)), + selectedTemplate: buildTemplate(templates, this.$route.path.substr(1).replace(/\/$/, '')), counter: 0, } @@ -93,7 +93,7 @@ } const title = 'Moje zaimki to: ' + this.selectedTemplate.name(); - const banner = `${process.env.baseUrl}/banner${this.$route.path}.png`; + const banner = `${process.env.baseUrl}/banner${this.$route.path.replace(/\/$/, '')}.png`; return { title: title, diff --git a/pages/index.vue b/pages/index.vue index c6578da1..2f6c0e85 100644 --- a/pages/index.vue +++ b/pages/index.vue @@ -16,7 +16,7 @@ Wybierz sposród najpopularniejszych:

- + {{template.name()}} @@ -247,14 +247,14 @@ if (!this.selectedTemplate.pronoun()) { return null; } - return process.env.baseUrl + '/' + (this.usedBaseEquals ? this.usedBase : this.longLink); + return this.addSlash(process.env.baseUrl + '/' + (this.usedBaseEquals ? this.usedBase : this.longLink)); }, linkMultiple() { if (!this.multiple.length) { return null; } - return process.env.baseUrl + '/' + this.multiple.join('&'); + return this.addSlash(process.env.baseUrl + '/' + this.multiple.join('&')); }, sources() { return getSources(this.selectedTemplate); @@ -268,6 +268,9 @@ } else { this.multiple.push(name); } + }, + addSlash(link) { + return link + (link.substr(link.length - 1) === '*' ? '/' : ''); } }, }