From ec89a18918a7186cc2b66d4237c607f701973b3d Mon Sep 17 00:00:00 2001 From: Arg Adenn Date: Sun, 1 Dec 2024 16:44:50 +0100 Subject: [PATCH 1/6] Some seo tweaks --- components/Appbar.vue | 9 ++++++++- components/Event.vue | 2 +- pages/event/_slug.vue | 2 +- pages/index.vue | 11 +++++++++-- 4 files changed, 19 insertions(+), 5 deletions(-) diff --git a/components/Appbar.vue b/components/Appbar.vue index dc372ff6..f2f7dfaf 100644 --- a/components/Appbar.vue +++ b/components/Appbar.vue @@ -3,7 +3,14 @@ -
+

+ +
+

+
-

{{ event.title }}

+

{{ event.title }}

diff --git a/pages/event/_slug.vue b/pages/event/_slug.vue index ba5461a8..94479344 100644 --- a/pages/event/_slug.vue +++ b/pages/event/_slug.vue @@ -3,7 +3,7 @@ //- EVENT PAGE //- gancio supports microformats (http://microformats.org/wiki/h-event) //- and microdata https://schema.org/Event - .title.text-center.text-md-h4.text-h5.pa-6 + h1.title.text-center.text-md-h4.text-h5.pa-6 strong.p-name.text--primary(itemprop="name") {{event.title}} v-row v-col.col-12.col-md-8.pr-sm-2.pr-md-0 diff --git a/pages/index.vue b/pages/index.vue index 04537f70..0499e061 100644 --- a/pages/index.vue +++ b/pages/index.vue @@ -62,21 +62,28 @@ export default { } }, head () { + const i18nHead = this.$nuxtI18nHead({ addSeoAttributes: true }) return { title: this.settings.title, + htmlAttrs: { + lang: this.settings.instance_locale, + ...i18nHead.htmlAttrs + }, meta: [ // hid is used as unique identifier. Do not use `vmid` for it as it will not work { hid: 'description', name: 'description', content: this.settings?.description }, { hid: 'og-description', name: 'og:description', content: this.settings?.description }, { hid: 'og-title', property: 'og:title', content: this.settings.title }, { hid: 'og-url', property: 'og:url', content: this.settings.baseurl }, - { property: 'og:image', content: this.settings.baseurl + '/logo.png' } + { property: 'og:image', content: this.settings.baseurl + '/logo.png' }, + ...i18nHead.meta ], link: [ { rel: 'apple-touch-icon', href: this.settings.baseurl + '/logo.png' }, { rel: 'alternate', type: 'application/rss+xml', title: this.settings.title, href: this.settings.baseurl + '/feed/rss' }, { rel: 'alternate', type: 'text/calendar', title: this.settings.title, href: this.settings.baseurl + '/feed/ics' }, - { rel: 'me', href: `${this.settings.baseurl}/federation/u/${this.settings.instance_name}`} + { rel: 'me', href: `${this.settings.baseurl}/federation/u/${this.settings.instance_name}`}, + ...i18nHead.link ] } }, From d01320560e02ac2bf29dcbd935f407f8c939323c Mon Sep 17 00:00:00 2001 From: Arg Adenn Date: Tue, 10 Dec 2024 17:58:33 +0100 Subject: [PATCH 2/6] seo fix: avoid invalid link even if disabled --- pages/event/_slug.vue | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pages/event/_slug.vue b/pages/event/_slug.vue index 94479344..50eb6763 100644 --- a/pages/event/_slug.vue +++ b/pages/event/_slug.vue @@ -102,10 +102,10 @@ //- Next/prev arrow .text-center.mt-5.mb-5 v-btn.mr-2(nuxt icon outlined color='primary' - :to='`/event/${event.prev}`' :disabled='!event.prev') + :to='`/event/${event.prev ? event.prev : (event.slug || event.id)}`' :disabled='!event.prev') v-icon(v-text='mdiArrowLeft') v-btn(nuxt bottom right outlined icon color='primary' - :to='`/event/${event.next}`' :disabled='!event.next') + :to='`/event/${event.next ? event.next : (event.slug || event.id)}`' :disabled='!event.next') v-icon(v-text='mdiArrowRight') v-dialog(v-model='showEmbed' width='700px' :fullscreen='$vuetify.breakpoint.xsOnly') From 422e7a39983fee50628f3e665e230191fd305b27 Mon Sep 17 00:00:00 2001 From: Arg Adenn Date: Tue, 10 Dec 2024 19:11:25 +0100 Subject: [PATCH 3/6] seo-fix: add sensible robots.txt --- static/robots.txt | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 static/robots.txt diff --git a/static/robots.txt b/static/robots.txt new file mode 100644 index 00000000..4dde88b7 --- /dev/null +++ b/static/robots.txt @@ -0,0 +1,6 @@ +user-agent: * + +allow: / +allow: /about +allow: /event/* +allow: /announcement/* \ No newline at end of file From d615b1c5375001e525d9bddd225104e8d2f2be1f Mon Sep 17 00:00:00 2001 From: lesion Date: Mon, 13 Jan 2025 20:05:07 +0100 Subject: [PATCH 4/6] fix: seo complaining about missing lang html attribute --- pages/Login.vue | 3 +++ pages/Register.vue | 3 +++ pages/about.vue | 3 +++ pages/announcement/_id.vue | 3 +++ pages/collection/_collection.vue | 3 +++ pages/event/_slug.vue | 3 +++ pages/export.vue | 3 +++ pages/index.vue | 4 ---- pages/place/_place.vue | 3 +++ pages/tag/_tag.vue | 3 +++ 10 files changed, 27 insertions(+), 4 deletions(-) diff --git a/pages/Login.vue b/pages/Login.vue index 7ddc8ffb..60986d49 100644 --- a/pages/Login.vue +++ b/pages/Login.vue @@ -85,6 +85,9 @@ export default { }, head () { return { + htmlAttrs: { + lang: this.settings.instance_locale + }, title: this.settings.title + ' - ' + this.$t('common.login') } } diff --git a/pages/Register.vue b/pages/Register.vue index cb733d76..a187434c 100644 --- a/pages/Register.vue +++ b/pages/Register.vue @@ -77,6 +77,9 @@ export default { }, head () { return { + htmlAttrs: { + lang: this.settings.instance_locale + }, title: this.settings.title + ' - ' + this.$t('common.register') } } diff --git a/pages/about.vue b/pages/about.vue index 587a254b..438c7cc9 100644 --- a/pages/about.vue +++ b/pages/about.vue @@ -21,6 +21,9 @@ export default { }, head () { return { + htmlAttrs: { + lang: this.settings.instance_locale + }, title: `${this.settings.title} - ${this.$t('common.info')}` } }, diff --git a/pages/announcement/_id.vue b/pages/announcement/_id.vue index 5195b04e..9cb603e1 100644 --- a/pages/announcement/_id.vue +++ b/pages/announcement/_id.vue @@ -30,6 +30,9 @@ export default { return {} } return { + htmlAttrs: { + lang: this.settings.instance_locale + }, title: `${this.settings.title} - ${this.announcement.title}` } }, diff --git a/pages/collection/_collection.vue b/pages/collection/_collection.vue index df0f506b..9de7868c 100644 --- a/pages/collection/_collection.vue +++ b/pages/collection/_collection.vue @@ -23,6 +23,9 @@ export default { const title = `${this.settings.title} - ${this.collection}` return { title, + htmlAttrs: { + lang: this.settings.instance_locale + }, link: [ { rel: 'alternate', type: 'application/rss+xml', title, href: this.settings.baseurl + `/feed/rss/collection/${this.collection}` }, { rel: 'alternate', type: 'text/calendar', title, href: this.settings.baseurl + `/feed/ics/collection/${this.collection}` } diff --git a/pages/event/_slug.vue b/pages/event/_slug.vue index 6fd1f89d..d76a3d68 100644 --- a/pages/event/_slug.vue +++ b/pages/event/_slug.vue @@ -188,6 +188,9 @@ export default { return { title: `${this.settings.title} - ${this.event.title}`, + htmlAttrs: { + lang: this.settings.instance_locale + }, meta: [ // hid is used as unique identifier. Do not use `vmid` for it as it will not work { diff --git a/pages/export.vue b/pages/export.vue index 10c81b75..55c50c4c 100644 --- a/pages/export.vue +++ b/pages/export.vue @@ -122,6 +122,9 @@ export default { }, head () { return { + htmlAttrs: { + lang: this.settings.instance_locale + }, title: `${this.settings.title} - ${this.$t('common.export')}`, } }, diff --git a/pages/index.vue b/pages/index.vue index 0499e061..868b6597 100644 --- a/pages/index.vue +++ b/pages/index.vue @@ -62,12 +62,10 @@ export default { } }, head () { - const i18nHead = this.$nuxtI18nHead({ addSeoAttributes: true }) return { title: this.settings.title, htmlAttrs: { lang: this.settings.instance_locale, - ...i18nHead.htmlAttrs }, meta: [ // hid is used as unique identifier. Do not use `vmid` for it as it will not work @@ -76,14 +74,12 @@ export default { { hid: 'og-title', property: 'og:title', content: this.settings.title }, { hid: 'og-url', property: 'og:url', content: this.settings.baseurl }, { property: 'og:image', content: this.settings.baseurl + '/logo.png' }, - ...i18nHead.meta ], link: [ { rel: 'apple-touch-icon', href: this.settings.baseurl + '/logo.png' }, { rel: 'alternate', type: 'application/rss+xml', title: this.settings.title, href: this.settings.baseurl + '/feed/rss' }, { rel: 'alternate', type: 'text/calendar', title: this.settings.title, href: this.settings.baseurl + '/feed/ics' }, { rel: 'me', href: `${this.settings.baseurl}/federation/u/${this.settings.instance_name}`}, - ...i18nHead.link ] } }, diff --git a/pages/place/_place.vue b/pages/place/_place.vue index f3108932..671d72de 100644 --- a/pages/place/_place.vue +++ b/pages/place/_place.vue @@ -43,6 +43,9 @@ export default { const title = `${this.settings.title} - ${this.place.name}` return { title, + htmlAttrs: { + lang: this.settings.instance_locale + }, link: [ { rel: 'alternate', type: 'application/rss+xml', title, href: this.settings.baseurl + `/feed/rss/place/${this.place.id}` }, { rel: 'alternate', type: 'text/calendar', title, href: this.settings.baseurl + `/feed/ics/place/${this.place.id}` } diff --git a/pages/tag/_tag.vue b/pages/tag/_tag.vue index 4d95704e..c94e6c14 100644 --- a/pages/tag/_tag.vue +++ b/pages/tag/_tag.vue @@ -24,6 +24,9 @@ export default { const title = `${this.settings.title} #${tag}` return { title, + htmlAttrs: { + lang: this.settings.instance_locale + }, link: [ { rel: 'alternate', type: 'application/rss+xml', title, href: this.settings.baseurl + `/feed/rss/tag/${tag}` }, { rel: 'alternate', type: 'text/calendar', title, href: this.settings.baseurl + `/feed/ics/tag/${tag}` } From 6a64f4145ad70ceadd4962b285f546cdff53119f Mon Sep 17 00:00:00 2001 From: lesion Date: Mon, 13 Jan 2025 20:15:00 +0100 Subject: [PATCH 5/6] fix: avoid link if disabled --- pages/event/_slug.vue | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pages/event/_slug.vue b/pages/event/_slug.vue index d76a3d68..d1c75c29 100644 --- a/pages/event/_slug.vue +++ b/pages/event/_slug.vue @@ -102,10 +102,10 @@ //- Next/prev arrow .text-center.mt-5.mb-5 v-btn.mr-2(nuxt icon outlined color='primary' - :to='`/event/${event.prev ? event.prev : (event.slug || event.id)}`' :disabled='!event.prev') + :to='event.prev && `/event/${event.prev}`' :disabled='!event.prev') v-icon(v-text='mdiArrowLeft') v-btn(nuxt bottom right outlined icon color='primary' - :to='`/event/${event.next ? event.next : (event.slug || event.id)}`' :disabled='!event.next') + :to='event.next && `/event/${event.next}`' :disabled='!event.next') v-icon(v-text='mdiArrowRight') v-dialog(v-model='showEmbed' width='700px' :fullscreen='$vuetify.breakpoint.xsOnly') From 6c3cc979caf046e6fd53cdd5892444bcea3e7aa9 Mon Sep 17 00:00:00 2001 From: lesion Date: Wed, 15 Jan 2025 10:26:56 +0100 Subject: [PATCH 6/6] minor --- components/Appbar.vue | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/components/Appbar.vue b/components/Appbar.vue index f2f7dfaf..8b44abd9 100644 --- a/components/Appbar.vue +++ b/components/Appbar.vue @@ -3,14 +3,14 @@ -

+

-
+