diff --git a/src/pages/store/articles.vue b/src/pages/store/articles.vue index ebb7c1d8b..a7df3e792 100644 --- a/src/pages/store/articles.vue +++ b/src/pages/store/articles.vue @@ -161,7 +161,6 @@ export default { body: true, }, ], - link: [{ rel: 'canonical', href: `${this.$route.path}` }], }; }, computed: { diff --git a/src/pages/store/index.vue b/src/pages/store/index.vue index 493da34e3..86fcfcb07 100644 --- a/src/pages/store/index.vue +++ b/src/pages/store/index.vue @@ -516,7 +516,13 @@ export default { head() { const title = this.$t('store_index_page_title'); const description = this.$t('store_books_page_description'); - const link = [{ rel: 'canonical', href: `${this.$route.path}` }]; + const link = [ + { + hid: 'i18n-can', + rel: 'canonical', + href: this.canonicalLink, + }, + ]; const classIds = Array.from( new Set(this.bookstoreItems.map(b => b.classId).flat()) ); @@ -604,6 +610,17 @@ export default { 'getNFTClassMetadataById', ]), + canonicalLink() { + const baseUrl = `${EXTERNAL_HOST}${this.$route.path}`; + const { tag, q } = this.$route.query; + if (tag) { + return `${baseUrl}?tag=${tag}`; + } + if (q && this.sortedBookstoreItems.length) { + return `${baseUrl}?q=${q}`; + } + return baseUrl; + }, // Price filter related priceFilterList() { return [