From 3df595b8c55af0d76065c99067c63259274f93b2 Mon Sep 17 00:00:00 2001 From: tutaru99 Date: Tue, 2 Jul 2024 09:48:23 +0200 Subject: [PATCH 1/2] OS2UOL-128: SEO/OpenGraph added to all pages --- components/views/courseView.vue | 260 ++++++++++++++++++++-- components/views/course_educatorsView.vue | 259 +++++++++++++++++++-- components/views/exerciseView.vue | 259 +++++++++++++++++++-- components/views/internshipView.vue | 259 +++++++++++++++++++-- components/views/newsView.vue | 259 +++++++++++++++++++-- components/views/pageView.vue | 259 ++++++++++++++++++++- components/views/userView.vue | 259 ++++++++++++++++++++- pages/[...slug].vue | 37 +-- 8 files changed, 1733 insertions(+), 118 deletions(-) diff --git a/components/views/courseView.vue b/components/views/courseView.vue index e48270b..5075ba1 100644 --- a/components/views/courseView.vue +++ b/components/views/courseView.vue @@ -22,27 +22,259 @@ const props = defineProps({ }, }); -const robots = ref( - props.data?.field_meta_tags?.html_head?.robots?.attributes?.content, -); - -const seoPageContent = ref( - props.data?.field_meta_tags?.html_head?.description?.attributes?.content, -); - +const openGraph = ref(props.data?.field_meta_tags?.html_head); useHead({ - title: - props?.data?.field_meta_tags?.html_head?.title?.attributes?.content || - props.data?.field_name, + title: openGraph.value.title?.attributes?.content, meta: [ { name: 'description', - content: seoPageContent.value, + content: openGraph.value.description?.attributes?.content, + }, + { name: 'robots', content: openGraph.value.robots?.attributes?.content }, + { + name: 'abstract', + content: openGraph.value.abstract?.attributes?.content, + }, + { + name: 'keywords', + content: openGraph.value.keywords?.attributes?.content, + }, + { + property: 'og:description', + content: openGraph.value.og_description?.attributes?.content, + }, + { + property: 'og:image', + content: openGraph.value.og_image_0?.attributes?.content, + }, + { + property: 'og:site_name', + content: openGraph.value.og_site_name?.attributes?.content, + }, + { + property: 'og:title', + content: openGraph.value.og_title?.attributes?.content, + }, + { + property: 'og:url', + content: openGraph.value.og_url?.attributes?.content, + }, + { + property: 'og:type', + content: openGraph.value.og_type?.attributes?.content, + }, + { + property: 'og:determiner', + content: openGraph.value.og_determiner?.attributes?.content, + }, + { + property: 'article:author', + content: openGraph.value.article_author_0?.attributes?.content, + }, + { + property: 'article:expiration_time', + content: openGraph.value.article_expiration_time?.attributes?.content, + }, + { + property: 'article:modified_time', + content: openGraph.value.article_modified_time?.attributes?.content, + }, + { + property: 'article:published_time', + content: openGraph.value.article_published_time?.attributes?.content, + }, + { + property: 'article:publisher', + content: openGraph.value.article_publisher?.attributes?.content, + }, + { + property: 'article:section', + content: openGraph.value.article_section?.attributes?.content, + }, + { + property: 'article:tag', + content: openGraph.value.article_tag_0?.attributes?.content, + }, + { + property: 'book:author', + content: openGraph.value.book_author_0?.attributes?.content, + }, + { + property: 'book:isbn', + content: openGraph.value.book_isbn?.attributes?.content, + }, + { + property: 'book:release_date', + content: openGraph.value.book_release_date?.attributes?.content, + }, + { + property: 'book:tag', + content: openGraph.value.book_tag_0?.attributes?.content, + }, + { + property: 'og:audio', + content: openGraph.value.og_audio?.attributes?.content, + }, + { + property: 'og:audio:secure_url', + content: openGraph.value.og_audio_secure_url?.attributes?.content, + }, + { + property: 'og:audio:type', + content: openGraph.value.og_audio_type?.attributes?.content, + }, + { + property: 'og:country-name', + content: openGraph.value.og_country_name?.attributes?.content, + }, + { + property: 'og:email', + content: openGraph.value.og_email?.attributes?.content, + }, + { + property: 'og:fax_number', + content: openGraph.value.og_fax_number?.attributes?.content, + }, + { + property: 'og:image:alt', + content: openGraph.value.og_image_alt?.attributes?.content, + }, + { + property: 'og:image:height', + content: openGraph.value.og_image_height?.attributes?.content, + }, + { + property: 'og:image:secure_url', + content: openGraph.value.og_image_secure_url_0?.attributes?.content, }, { - name: 'robots', - content: robots.value, + property: 'og:image:type', + content: openGraph.value.og_image_type?.attributes?.content, }, + { + property: 'og:image:url', + content: openGraph.value.og_image_url_0?.attributes?.content, + }, + { + property: 'og:image:width', + content: openGraph.value.og_image_width?.attributes?.content, + }, + { + property: 'og:latitude', + content: openGraph.value.og_latitude?.attributes?.content, + }, + { + property: 'og:locale', + content: openGraph.value.og_locale?.attributes?.content, + }, + { + property: 'og:locale:alternative', + content: openGraph.value.og_locale_alternative_0?.attributes?.content, + }, + { + property: 'og:locality', + content: openGraph.value.og_locality?.attributes?.content, + }, + { + property: 'og:longitude', + content: openGraph.value.og_longitude?.attributes?.content, + }, + { + property: 'og:phone_number', + content: openGraph.value.og_phone_number?.attributes?.content, + }, + { + property: 'og:postal_code', + content: openGraph.value.og_postal_code?.attributes?.content, + }, + { + property: 'og:region', + content: openGraph.value.og_region?.attributes?.content, + }, + { + property: 'og:see_also', + content: openGraph.value.og_see_also?.attributes?.content, + }, + { + property: 'og:street_address', + content: openGraph.value.og_street_address?.attributes?.content, + }, + { + property: 'og:updated_time', + content: openGraph.value.og_updated_time?.attributes?.content, + }, + { + property: 'og:video', + content: openGraph.value.og_video_0?.attributes?.content, + }, + { + property: 'og:video:duration', + content: openGraph.value.og_video_duration?.attributes?.content, + }, + { + property: 'og:video:height', + content: openGraph.value.og_video_height?.attributes?.content, + }, + { + property: 'og:video:secure_url', + content: openGraph.value.og_video_secure_url?.attributes?.content, + }, + { + property: 'og:video:type', + content: openGraph.value.og_video_type?.attributes?.content, + }, + { + property: 'og:video:width', + content: openGraph.value.og_video_width?.attributes?.content, + }, + { + property: 'profile:first_name', + content: openGraph.value.profile_first_name?.attributes?.content, + }, + { + property: 'profile:gender', + content: openGraph.value.profile_gender?.attributes?.content, + }, + { + property: 'profile:last_name', + content: openGraph.value.profile_last_name?.attributes?.content, + }, + { + property: 'profile:username', + content: openGraph.value.profile_username?.attributes?.content, + }, + { + property: 'video:actor', + content: openGraph.value.video_actor_0?.attributes?.content, + }, + { + property: 'video:actor:role', + content: openGraph.value.video_actor_role_0?.attributes?.content, + }, + { + property: 'video:director', + content: openGraph.value.video_director_0?.attributes?.content, + }, + { + property: 'video:release_date', + content: openGraph.value.video_release_date?.attributes?.content, + }, + { + property: 'video:series', + content: openGraph.value.video_series?.attributes?.content, + }, + { + property: 'video:tag', + content: openGraph.value.video_tag_0?.attributes?.content, + }, + { + property: 'video:writer', + content: openGraph.value.video_writer_0?.attributes?.content, + }, + ], + link: [ + { rel: 'canonical', href: openGraph.value.canonical_url?.attributes?.href }, + { rel: 'image_src', href: openGraph.value.image_src?.attributes?.href }, ], }); diff --git a/components/views/course_educatorsView.vue b/components/views/course_educatorsView.vue index fe2b349..c6dc17a 100644 --- a/components/views/course_educatorsView.vue +++ b/components/views/course_educatorsView.vue @@ -22,27 +22,260 @@ const props = defineProps({ }, }); -const robots = ref( - props.data?.field_meta_tags?.html_head?.robots?.attributes?.content, -); - -const seoPageContent = ref( - props.data?.field_meta_tags?.html_head?.description?.attributes?.content, -); +const openGraph = ref(props.data?.field_meta_tags?.html_head); useHead({ - title: - props?.data?.field_meta_tags?.html_head?.title?.attributes?.content || - props.data?.field_name, + title: openGraph.value.title?.attributes?.content, meta: [ { name: 'description', - content: seoPageContent.value, + content: openGraph.value.description?.attributes?.content, + }, + { name: 'robots', content: openGraph.value.robots?.attributes?.content }, + { + name: 'abstract', + content: openGraph.value.abstract?.attributes?.content, + }, + { + name: 'keywords', + content: openGraph.value.keywords?.attributes?.content, + }, + { + property: 'og:description', + content: openGraph.value.og_description?.attributes?.content, + }, + { + property: 'og:image', + content: openGraph.value.og_image_0?.attributes?.content, + }, + { + property: 'og:site_name', + content: openGraph.value.og_site_name?.attributes?.content, + }, + { + property: 'og:title', + content: openGraph.value.og_title?.attributes?.content, + }, + { + property: 'og:url', + content: openGraph.value.og_url?.attributes?.content, + }, + { + property: 'og:type', + content: openGraph.value.og_type?.attributes?.content, + }, + { + property: 'og:determiner', + content: openGraph.value.og_determiner?.attributes?.content, + }, + { + property: 'article:author', + content: openGraph.value.article_author_0?.attributes?.content, + }, + { + property: 'article:expiration_time', + content: openGraph.value.article_expiration_time?.attributes?.content, + }, + { + property: 'article:modified_time', + content: openGraph.value.article_modified_time?.attributes?.content, + }, + { + property: 'article:published_time', + content: openGraph.value.article_published_time?.attributes?.content, + }, + { + property: 'article:publisher', + content: openGraph.value.article_publisher?.attributes?.content, + }, + { + property: 'article:section', + content: openGraph.value.article_section?.attributes?.content, + }, + { + property: 'article:tag', + content: openGraph.value.article_tag_0?.attributes?.content, + }, + { + property: 'book:author', + content: openGraph.value.book_author_0?.attributes?.content, + }, + { + property: 'book:isbn', + content: openGraph.value.book_isbn?.attributes?.content, + }, + { + property: 'book:release_date', + content: openGraph.value.book_release_date?.attributes?.content, + }, + { + property: 'book:tag', + content: openGraph.value.book_tag_0?.attributes?.content, + }, + { + property: 'og:audio', + content: openGraph.value.og_audio?.attributes?.content, + }, + { + property: 'og:audio:secure_url', + content: openGraph.value.og_audio_secure_url?.attributes?.content, + }, + { + property: 'og:audio:type', + content: openGraph.value.og_audio_type?.attributes?.content, + }, + { + property: 'og:country-name', + content: openGraph.value.og_country_name?.attributes?.content, + }, + { + property: 'og:email', + content: openGraph.value.og_email?.attributes?.content, + }, + { + property: 'og:fax_number', + content: openGraph.value.og_fax_number?.attributes?.content, + }, + { + property: 'og:image:alt', + content: openGraph.value.og_image_alt?.attributes?.content, + }, + { + property: 'og:image:height', + content: openGraph.value.og_image_height?.attributes?.content, + }, + { + property: 'og:image:secure_url', + content: openGraph.value.og_image_secure_url_0?.attributes?.content, }, { - name: 'robots', - content: robots.value, + property: 'og:image:type', + content: openGraph.value.og_image_type?.attributes?.content, }, + { + property: 'og:image:url', + content: openGraph.value.og_image_url_0?.attributes?.content, + }, + { + property: 'og:image:width', + content: openGraph.value.og_image_width?.attributes?.content, + }, + { + property: 'og:latitude', + content: openGraph.value.og_latitude?.attributes?.content, + }, + { + property: 'og:locale', + content: openGraph.value.og_locale?.attributes?.content, + }, + { + property: 'og:locale:alternative', + content: openGraph.value.og_locale_alternative_0?.attributes?.content, + }, + { + property: 'og:locality', + content: openGraph.value.og_locality?.attributes?.content, + }, + { + property: 'og:longitude', + content: openGraph.value.og_longitude?.attributes?.content, + }, + { + property: 'og:phone_number', + content: openGraph.value.og_phone_number?.attributes?.content, + }, + { + property: 'og:postal_code', + content: openGraph.value.og_postal_code?.attributes?.content, + }, + { + property: 'og:region', + content: openGraph.value.og_region?.attributes?.content, + }, + { + property: 'og:see_also', + content: openGraph.value.og_see_also?.attributes?.content, + }, + { + property: 'og:street_address', + content: openGraph.value.og_street_address?.attributes?.content, + }, + { + property: 'og:updated_time', + content: openGraph.value.og_updated_time?.attributes?.content, + }, + { + property: 'og:video', + content: openGraph.value.og_video_0?.attributes?.content, + }, + { + property: 'og:video:duration', + content: openGraph.value.og_video_duration?.attributes?.content, + }, + { + property: 'og:video:height', + content: openGraph.value.og_video_height?.attributes?.content, + }, + { + property: 'og:video:secure_url', + content: openGraph.value.og_video_secure_url?.attributes?.content, + }, + { + property: 'og:video:type', + content: openGraph.value.og_video_type?.attributes?.content, + }, + { + property: 'og:video:width', + content: openGraph.value.og_video_width?.attributes?.content, + }, + { + property: 'profile:first_name', + content: openGraph.value.profile_first_name?.attributes?.content, + }, + { + property: 'profile:gender', + content: openGraph.value.profile_gender?.attributes?.content, + }, + { + property: 'profile:last_name', + content: openGraph.value.profile_last_name?.attributes?.content, + }, + { + property: 'profile:username', + content: openGraph.value.profile_username?.attributes?.content, + }, + { + property: 'video:actor', + content: openGraph.value.video_actor_0?.attributes?.content, + }, + { + property: 'video:actor:role', + content: openGraph.value.video_actor_role_0?.attributes?.content, + }, + { + property: 'video:director', + content: openGraph.value.video_director_0?.attributes?.content, + }, + { + property: 'video:release_date', + content: openGraph.value.video_release_date?.attributes?.content, + }, + { + property: 'video:series', + content: openGraph.value.video_series?.attributes?.content, + }, + { + property: 'video:tag', + content: openGraph.value.video_tag_0?.attributes?.content, + }, + { + property: 'video:writer', + content: openGraph.value.video_writer_0?.attributes?.content, + }, + ], + link: [ + { rel: 'canonical', href: openGraph.value.canonical_url?.attributes?.href }, + { rel: 'image_src', href: openGraph.value.image_src?.attributes?.href }, ], }); diff --git a/components/views/exerciseView.vue b/components/views/exerciseView.vue index 216ef76..faf57f8 100644 --- a/components/views/exerciseView.vue +++ b/components/views/exerciseView.vue @@ -21,27 +21,260 @@ const props = defineProps({ }, }); -const robots = ref( - props.data?.field_meta_tags?.html_head?.robots?.attributes?.content, -); - -const seoPageContent = ref( - props.data?.field_meta_tags?.html_head?.description?.attributes?.content, -); +const openGraph = ref(props.data?.field_meta_tags?.html_head); useHead({ - title: - props?.data?.field_meta_tags?.html_head?.title?.attributes?.content || - props.data?.field_name, + title: openGraph.value.title?.attributes?.content, meta: [ { name: 'description', - content: seoPageContent.value, + content: openGraph.value.description?.attributes?.content, + }, + { name: 'robots', content: openGraph.value.robots?.attributes?.content }, + { + name: 'abstract', + content: openGraph.value.abstract?.attributes?.content, + }, + { + name: 'keywords', + content: openGraph.value.keywords?.attributes?.content, + }, + { + property: 'og:description', + content: openGraph.value.og_description?.attributes?.content, + }, + { + property: 'og:image', + content: openGraph.value.og_image_0?.attributes?.content, + }, + { + property: 'og:site_name', + content: openGraph.value.og_site_name?.attributes?.content, + }, + { + property: 'og:title', + content: openGraph.value.og_title?.attributes?.content, + }, + { + property: 'og:url', + content: openGraph.value.og_url?.attributes?.content, + }, + { + property: 'og:type', + content: openGraph.value.og_type?.attributes?.content, + }, + { + property: 'og:determiner', + content: openGraph.value.og_determiner?.attributes?.content, + }, + { + property: 'article:author', + content: openGraph.value.article_author_0?.attributes?.content, + }, + { + property: 'article:expiration_time', + content: openGraph.value.article_expiration_time?.attributes?.content, + }, + { + property: 'article:modified_time', + content: openGraph.value.article_modified_time?.attributes?.content, + }, + { + property: 'article:published_time', + content: openGraph.value.article_published_time?.attributes?.content, + }, + { + property: 'article:publisher', + content: openGraph.value.article_publisher?.attributes?.content, + }, + { + property: 'article:section', + content: openGraph.value.article_section?.attributes?.content, + }, + { + property: 'article:tag', + content: openGraph.value.article_tag_0?.attributes?.content, + }, + { + property: 'book:author', + content: openGraph.value.book_author_0?.attributes?.content, + }, + { + property: 'book:isbn', + content: openGraph.value.book_isbn?.attributes?.content, + }, + { + property: 'book:release_date', + content: openGraph.value.book_release_date?.attributes?.content, + }, + { + property: 'book:tag', + content: openGraph.value.book_tag_0?.attributes?.content, + }, + { + property: 'og:audio', + content: openGraph.value.og_audio?.attributes?.content, + }, + { + property: 'og:audio:secure_url', + content: openGraph.value.og_audio_secure_url?.attributes?.content, + }, + { + property: 'og:audio:type', + content: openGraph.value.og_audio_type?.attributes?.content, + }, + { + property: 'og:country-name', + content: openGraph.value.og_country_name?.attributes?.content, + }, + { + property: 'og:email', + content: openGraph.value.og_email?.attributes?.content, + }, + { + property: 'og:fax_number', + content: openGraph.value.og_fax_number?.attributes?.content, + }, + { + property: 'og:image:alt', + content: openGraph.value.og_image_alt?.attributes?.content, + }, + { + property: 'og:image:height', + content: openGraph.value.og_image_height?.attributes?.content, + }, + { + property: 'og:image:secure_url', + content: openGraph.value.og_image_secure_url_0?.attributes?.content, }, { - name: 'robots', - content: robots.value, + property: 'og:image:type', + content: openGraph.value.og_image_type?.attributes?.content, }, + { + property: 'og:image:url', + content: openGraph.value.og_image_url_0?.attributes?.content, + }, + { + property: 'og:image:width', + content: openGraph.value.og_image_width?.attributes?.content, + }, + { + property: 'og:latitude', + content: openGraph.value.og_latitude?.attributes?.content, + }, + { + property: 'og:locale', + content: openGraph.value.og_locale?.attributes?.content, + }, + { + property: 'og:locale:alternative', + content: openGraph.value.og_locale_alternative_0?.attributes?.content, + }, + { + property: 'og:locality', + content: openGraph.value.og_locality?.attributes?.content, + }, + { + property: 'og:longitude', + content: openGraph.value.og_longitude?.attributes?.content, + }, + { + property: 'og:phone_number', + content: openGraph.value.og_phone_number?.attributes?.content, + }, + { + property: 'og:postal_code', + content: openGraph.value.og_postal_code?.attributes?.content, + }, + { + property: 'og:region', + content: openGraph.value.og_region?.attributes?.content, + }, + { + property: 'og:see_also', + content: openGraph.value.og_see_also?.attributes?.content, + }, + { + property: 'og:street_address', + content: openGraph.value.og_street_address?.attributes?.content, + }, + { + property: 'og:updated_time', + content: openGraph.value.og_updated_time?.attributes?.content, + }, + { + property: 'og:video', + content: openGraph.value.og_video_0?.attributes?.content, + }, + { + property: 'og:video:duration', + content: openGraph.value.og_video_duration?.attributes?.content, + }, + { + property: 'og:video:height', + content: openGraph.value.og_video_height?.attributes?.content, + }, + { + property: 'og:video:secure_url', + content: openGraph.value.og_video_secure_url?.attributes?.content, + }, + { + property: 'og:video:type', + content: openGraph.value.og_video_type?.attributes?.content, + }, + { + property: 'og:video:width', + content: openGraph.value.og_video_width?.attributes?.content, + }, + { + property: 'profile:first_name', + content: openGraph.value.profile_first_name?.attributes?.content, + }, + { + property: 'profile:gender', + content: openGraph.value.profile_gender?.attributes?.content, + }, + { + property: 'profile:last_name', + content: openGraph.value.profile_last_name?.attributes?.content, + }, + { + property: 'profile:username', + content: openGraph.value.profile_username?.attributes?.content, + }, + { + property: 'video:actor', + content: openGraph.value.video_actor_0?.attributes?.content, + }, + { + property: 'video:actor:role', + content: openGraph.value.video_actor_role_0?.attributes?.content, + }, + { + property: 'video:director', + content: openGraph.value.video_director_0?.attributes?.content, + }, + { + property: 'video:release_date', + content: openGraph.value.video_release_date?.attributes?.content, + }, + { + property: 'video:series', + content: openGraph.value.video_series?.attributes?.content, + }, + { + property: 'video:tag', + content: openGraph.value.video_tag_0?.attributes?.content, + }, + { + property: 'video:writer', + content: openGraph.value.video_writer_0?.attributes?.content, + }, + ], + link: [ + { rel: 'canonical', href: openGraph.value.canonical_url?.attributes?.href }, + { rel: 'image_src', href: openGraph.value.image_src?.attributes?.href }, ], }); diff --git a/components/views/internshipView.vue b/components/views/internshipView.vue index c28db0e..6d2ae07 100644 --- a/components/views/internshipView.vue +++ b/components/views/internshipView.vue @@ -22,27 +22,260 @@ const props = defineProps({ }, }); -const robots = ref( - props.data?.field_meta_tags?.html_head?.robots?.attributes?.content, -); - -const seoPageContent = ref( - props.data?.field_meta_tags?.html_head?.description?.attributes?.content, -); +const openGraph = ref(props.data?.field_meta_tags?.html_head); useHead({ - title: - props?.data?.field_meta_tags?.html_head?.title?.attributes?.content || - props.data?.field_name, + title: openGraph.value.title?.attributes?.content, meta: [ { name: 'description', - content: seoPageContent.value, + content: openGraph.value.description?.attributes?.content, + }, + { name: 'robots', content: openGraph.value.robots?.attributes?.content }, + { + name: 'abstract', + content: openGraph.value.abstract?.attributes?.content, + }, + { + name: 'keywords', + content: openGraph.value.keywords?.attributes?.content, + }, + { + property: 'og:description', + content: openGraph.value.og_description?.attributes?.content, + }, + { + property: 'og:image', + content: openGraph.value.og_image_0?.attributes?.content, + }, + { + property: 'og:site_name', + content: openGraph.value.og_site_name?.attributes?.content, + }, + { + property: 'og:title', + content: openGraph.value.og_title?.attributes?.content, + }, + { + property: 'og:url', + content: openGraph.value.og_url?.attributes?.content, + }, + { + property: 'og:type', + content: openGraph.value.og_type?.attributes?.content, + }, + { + property: 'og:determiner', + content: openGraph.value.og_determiner?.attributes?.content, + }, + { + property: 'article:author', + content: openGraph.value.article_author_0?.attributes?.content, + }, + { + property: 'article:expiration_time', + content: openGraph.value.article_expiration_time?.attributes?.content, + }, + { + property: 'article:modified_time', + content: openGraph.value.article_modified_time?.attributes?.content, + }, + { + property: 'article:published_time', + content: openGraph.value.article_published_time?.attributes?.content, + }, + { + property: 'article:publisher', + content: openGraph.value.article_publisher?.attributes?.content, + }, + { + property: 'article:section', + content: openGraph.value.article_section?.attributes?.content, + }, + { + property: 'article:tag', + content: openGraph.value.article_tag_0?.attributes?.content, + }, + { + property: 'book:author', + content: openGraph.value.book_author_0?.attributes?.content, + }, + { + property: 'book:isbn', + content: openGraph.value.book_isbn?.attributes?.content, + }, + { + property: 'book:release_date', + content: openGraph.value.book_release_date?.attributes?.content, + }, + { + property: 'book:tag', + content: openGraph.value.book_tag_0?.attributes?.content, + }, + { + property: 'og:audio', + content: openGraph.value.og_audio?.attributes?.content, + }, + { + property: 'og:audio:secure_url', + content: openGraph.value.og_audio_secure_url?.attributes?.content, + }, + { + property: 'og:audio:type', + content: openGraph.value.og_audio_type?.attributes?.content, + }, + { + property: 'og:country-name', + content: openGraph.value.og_country_name?.attributes?.content, + }, + { + property: 'og:email', + content: openGraph.value.og_email?.attributes?.content, + }, + { + property: 'og:fax_number', + content: openGraph.value.og_fax_number?.attributes?.content, + }, + { + property: 'og:image:alt', + content: openGraph.value.og_image_alt?.attributes?.content, + }, + { + property: 'og:image:height', + content: openGraph.value.og_image_height?.attributes?.content, + }, + { + property: 'og:image:secure_url', + content: openGraph.value.og_image_secure_url_0?.attributes?.content, }, { - name: 'robots', - content: robots.value, + property: 'og:image:type', + content: openGraph.value.og_image_type?.attributes?.content, }, + { + property: 'og:image:url', + content: openGraph.value.og_image_url_0?.attributes?.content, + }, + { + property: 'og:image:width', + content: openGraph.value.og_image_width?.attributes?.content, + }, + { + property: 'og:latitude', + content: openGraph.value.og_latitude?.attributes?.content, + }, + { + property: 'og:locale', + content: openGraph.value.og_locale?.attributes?.content, + }, + { + property: 'og:locale:alternative', + content: openGraph.value.og_locale_alternative_0?.attributes?.content, + }, + { + property: 'og:locality', + content: openGraph.value.og_locality?.attributes?.content, + }, + { + property: 'og:longitude', + content: openGraph.value.og_longitude?.attributes?.content, + }, + { + property: 'og:phone_number', + content: openGraph.value.og_phone_number?.attributes?.content, + }, + { + property: 'og:postal_code', + content: openGraph.value.og_postal_code?.attributes?.content, + }, + { + property: 'og:region', + content: openGraph.value.og_region?.attributes?.content, + }, + { + property: 'og:see_also', + content: openGraph.value.og_see_also?.attributes?.content, + }, + { + property: 'og:street_address', + content: openGraph.value.og_street_address?.attributes?.content, + }, + { + property: 'og:updated_time', + content: openGraph.value.og_updated_time?.attributes?.content, + }, + { + property: 'og:video', + content: openGraph.value.og_video_0?.attributes?.content, + }, + { + property: 'og:video:duration', + content: openGraph.value.og_video_duration?.attributes?.content, + }, + { + property: 'og:video:height', + content: openGraph.value.og_video_height?.attributes?.content, + }, + { + property: 'og:video:secure_url', + content: openGraph.value.og_video_secure_url?.attributes?.content, + }, + { + property: 'og:video:type', + content: openGraph.value.og_video_type?.attributes?.content, + }, + { + property: 'og:video:width', + content: openGraph.value.og_video_width?.attributes?.content, + }, + { + property: 'profile:first_name', + content: openGraph.value.profile_first_name?.attributes?.content, + }, + { + property: 'profile:gender', + content: openGraph.value.profile_gender?.attributes?.content, + }, + { + property: 'profile:last_name', + content: openGraph.value.profile_last_name?.attributes?.content, + }, + { + property: 'profile:username', + content: openGraph.value.profile_username?.attributes?.content, + }, + { + property: 'video:actor', + content: openGraph.value.video_actor_0?.attributes?.content, + }, + { + property: 'video:actor:role', + content: openGraph.value.video_actor_role_0?.attributes?.content, + }, + { + property: 'video:director', + content: openGraph.value.video_director_0?.attributes?.content, + }, + { + property: 'video:release_date', + content: openGraph.value.video_release_date?.attributes?.content, + }, + { + property: 'video:series', + content: openGraph.value.video_series?.attributes?.content, + }, + { + property: 'video:tag', + content: openGraph.value.video_tag_0?.attributes?.content, + }, + { + property: 'video:writer', + content: openGraph.value.video_writer_0?.attributes?.content, + }, + ], + link: [ + { rel: 'canonical', href: openGraph.value.canonical_url?.attributes?.href }, + { rel: 'image_src', href: openGraph.value.image_src?.attributes?.href }, ], }); diff --git a/components/views/newsView.vue b/components/views/newsView.vue index 0281b3d..ecd5cca 100644 --- a/components/views/newsView.vue +++ b/components/views/newsView.vue @@ -9,27 +9,260 @@ const props = defineProps({ }, }); -const robots = ref( - props.data?.field_meta_tags?.html_head?.robots?.attributes?.content, -); - -const seoPageContent = ref( - props.data?.field_meta_tags?.html_head?.description?.attributes?.content, -); +const openGraph = ref(props.data?.field_meta_tags?.html_head); useHead({ - title: - props?.data?.field_meta_tags?.html_head?.title?.attributes?.content || - props.data?.field_name, + title: openGraph.value.title?.attributes?.content, meta: [ { name: 'description', - content: seoPageContent.value, + content: openGraph.value.description?.attributes?.content, + }, + { name: 'robots', content: openGraph.value.robots?.attributes?.content }, + { + name: 'abstract', + content: openGraph.value.abstract?.attributes?.content, + }, + { + name: 'keywords', + content: openGraph.value.keywords?.attributes?.content, + }, + { + property: 'og:description', + content: openGraph.value.og_description?.attributes?.content, + }, + { + property: 'og:image', + content: openGraph.value.og_image_0?.attributes?.content, + }, + { + property: 'og:site_name', + content: openGraph.value.og_site_name?.attributes?.content, + }, + { + property: 'og:title', + content: openGraph.value.og_title?.attributes?.content, + }, + { + property: 'og:url', + content: openGraph.value.og_url?.attributes?.content, + }, + { + property: 'og:type', + content: openGraph.value.og_type?.attributes?.content, + }, + { + property: 'og:determiner', + content: openGraph.value.og_determiner?.attributes?.content, + }, + { + property: 'article:author', + content: openGraph.value.article_author_0?.attributes?.content, + }, + { + property: 'article:expiration_time', + content: openGraph.value.article_expiration_time?.attributes?.content, + }, + { + property: 'article:modified_time', + content: openGraph.value.article_modified_time?.attributes?.content, + }, + { + property: 'article:published_time', + content: openGraph.value.article_published_time?.attributes?.content, + }, + { + property: 'article:publisher', + content: openGraph.value.article_publisher?.attributes?.content, + }, + { + property: 'article:section', + content: openGraph.value.article_section?.attributes?.content, + }, + { + property: 'article:tag', + content: openGraph.value.article_tag_0?.attributes?.content, + }, + { + property: 'book:author', + content: openGraph.value.book_author_0?.attributes?.content, + }, + { + property: 'book:isbn', + content: openGraph.value.book_isbn?.attributes?.content, + }, + { + property: 'book:release_date', + content: openGraph.value.book_release_date?.attributes?.content, + }, + { + property: 'book:tag', + content: openGraph.value.book_tag_0?.attributes?.content, + }, + { + property: 'og:audio', + content: openGraph.value.og_audio?.attributes?.content, + }, + { + property: 'og:audio:secure_url', + content: openGraph.value.og_audio_secure_url?.attributes?.content, + }, + { + property: 'og:audio:type', + content: openGraph.value.og_audio_type?.attributes?.content, + }, + { + property: 'og:country-name', + content: openGraph.value.og_country_name?.attributes?.content, + }, + { + property: 'og:email', + content: openGraph.value.og_email?.attributes?.content, + }, + { + property: 'og:fax_number', + content: openGraph.value.og_fax_number?.attributes?.content, + }, + { + property: 'og:image:alt', + content: openGraph.value.og_image_alt?.attributes?.content, + }, + { + property: 'og:image:height', + content: openGraph.value.og_image_height?.attributes?.content, + }, + { + property: 'og:image:secure_url', + content: openGraph.value.og_image_secure_url_0?.attributes?.content, + }, + { + property: 'og:image:type', + content: openGraph.value.og_image_type?.attributes?.content, + }, + { + property: 'og:image:url', + content: openGraph.value.og_image_url_0?.attributes?.content, + }, + { + property: 'og:image:width', + content: openGraph.value.og_image_width?.attributes?.content, + }, + { + property: 'og:latitude', + content: openGraph.value.og_latitude?.attributes?.content, + }, + { + property: 'og:locale', + content: openGraph.value.og_locale?.attributes?.content, + }, + { + property: 'og:locale:alternative', + content: openGraph.value.og_locale_alternative_0?.attributes?.content, + }, + { + property: 'og:locality', + content: openGraph.value.og_locality?.attributes?.content, + }, + { + property: 'og:longitude', + content: openGraph.value.og_longitude?.attributes?.content, + }, + { + property: 'og:phone_number', + content: openGraph.value.og_phone_number?.attributes?.content, + }, + { + property: 'og:postal_code', + content: openGraph.value.og_postal_code?.attributes?.content, + }, + { + property: 'og:region', + content: openGraph.value.og_region?.attributes?.content, + }, + { + property: 'og:see_also', + content: openGraph.value.og_see_also?.attributes?.content, + }, + { + property: 'og:street_address', + content: openGraph.value.og_street_address?.attributes?.content, + }, + { + property: 'og:updated_time', + content: openGraph.value.og_updated_time?.attributes?.content, + }, + { + property: 'og:video', + content: openGraph.value.og_video_0?.attributes?.content, + }, + { + property: 'og:video:duration', + content: openGraph.value.og_video_duration?.attributes?.content, + }, + { + property: 'og:video:height', + content: openGraph.value.og_video_height?.attributes?.content, + }, + { + property: 'og:video:secure_url', + content: openGraph.value.og_video_secure_url?.attributes?.content, + }, + { + property: 'og:video:type', + content: openGraph.value.og_video_type?.attributes?.content, + }, + { + property: 'og:video:width', + content: openGraph.value.og_video_width?.attributes?.content, + }, + { + property: 'profile:first_name', + content: openGraph.value.profile_first_name?.attributes?.content, + }, + { + property: 'profile:gender', + content: openGraph.value.profile_gender?.attributes?.content, + }, + { + property: 'profile:last_name', + content: openGraph.value.profile_last_name?.attributes?.content, }, { - name: 'robots', - content: robots.value, + property: 'profile:username', + content: openGraph.value.profile_username?.attributes?.content, }, + { + property: 'video:actor', + content: openGraph.value.video_actor_0?.attributes?.content, + }, + { + property: 'video:actor:role', + content: openGraph.value.video_actor_role_0?.attributes?.content, + }, + { + property: 'video:director', + content: openGraph.value.video_director_0?.attributes?.content, + }, + { + property: 'video:release_date', + content: openGraph.value.video_release_date?.attributes?.content, + }, + { + property: 'video:series', + content: openGraph.value.video_series?.attributes?.content, + }, + { + property: 'video:tag', + content: openGraph.value.video_tag_0?.attributes?.content, + }, + { + property: 'video:writer', + content: openGraph.value.video_writer_0?.attributes?.content, + }, + ], + link: [ + { rel: 'canonical', href: openGraph.value.canonical_url?.attributes?.href }, + { rel: 'image_src', href: openGraph.value.image_src?.attributes?.href }, ], }); diff --git a/components/views/pageView.vue b/components/views/pageView.vue index 73f66d1..c695bb3 100644 --- a/components/views/pageView.vue +++ b/components/views/pageView.vue @@ -12,27 +12,264 @@ const props = defineProps({ }, }); -const robots = ref( - props.data?.field_meta_tags?.html_head?.robots?.attributes?.content, -); - -const seoPageContent = ref( - props.data?.field_meta_tags?.html_head?.description?.attributes?.content, -); +const openGraph = ref(props.data?.field_meta_tags?.html_head); useHead({ - title: props?.data?.field_meta_tags?.html_head?.title?.attributes?.content, + title: openGraph.value.title?.attributes?.content, meta: [ { name: 'description', - content: seoPageContent.value, + content: openGraph.value.description?.attributes?.content, + }, + { name: 'robots', content: openGraph.value.robots?.attributes?.content }, + { + name: 'abstract', + content: openGraph.value.abstract?.attributes?.content, + }, + { + name: 'keywords', + content: openGraph.value.keywords?.attributes?.content, + }, + { + property: 'og:description', + content: openGraph.value.og_description?.attributes?.content, + }, + { + property: 'og:image', + content: openGraph.value.og_image_0?.attributes?.content, + }, + { + property: 'og:site_name', + content: openGraph.value.og_site_name?.attributes?.content, + }, + { + property: 'og:title', + content: openGraph.value.og_title?.attributes?.content, + }, + { + property: 'og:url', + content: openGraph.value.og_url?.attributes?.content, + }, + { + property: 'og:type', + content: openGraph.value.og_type?.attributes?.content, + }, + { + property: 'og:determiner', + content: openGraph.value.og_determiner?.attributes?.content, + }, + { + property: 'article:author', + content: openGraph.value.article_author_0?.attributes?.content, + }, + { + property: 'article:expiration_time', + content: openGraph.value.article_expiration_time?.attributes?.content, + }, + { + property: 'article:modified_time', + content: openGraph.value.article_modified_time?.attributes?.content, + }, + { + property: 'article:published_time', + content: openGraph.value.article_published_time?.attributes?.content, + }, + { + property: 'article:publisher', + content: openGraph.value.article_publisher?.attributes?.content, + }, + { + property: 'article:section', + content: openGraph.value.article_section?.attributes?.content, + }, + { + property: 'article:tag', + content: openGraph.value.article_tag_0?.attributes?.content, + }, + { + property: 'book:author', + content: openGraph.value.book_author_0?.attributes?.content, + }, + { + property: 'book:isbn', + content: openGraph.value.book_isbn?.attributes?.content, + }, + { + property: 'book:release_date', + content: openGraph.value.book_release_date?.attributes?.content, + }, + { + property: 'book:tag', + content: openGraph.value.book_tag_0?.attributes?.content, + }, + { + property: 'og:audio', + content: openGraph.value.og_audio?.attributes?.content, + }, + { + property: 'og:audio:secure_url', + content: openGraph.value.og_audio_secure_url?.attributes?.content, + }, + { + property: 'og:audio:type', + content: openGraph.value.og_audio_type?.attributes?.content, + }, + { + property: 'og:country-name', + content: openGraph.value.og_country_name?.attributes?.content, + }, + { + property: 'og:email', + content: openGraph.value.og_email?.attributes?.content, + }, + { + property: 'og:fax_number', + content: openGraph.value.og_fax_number?.attributes?.content, + }, + { + property: 'og:image:alt', + content: openGraph.value.og_image_alt?.attributes?.content, + }, + { + property: 'og:image:height', + content: openGraph.value.og_image_height?.attributes?.content, + }, + { + property: 'og:image:secure_url', + content: openGraph.value.og_image_secure_url_0?.attributes?.content, + }, + { + property: 'og:image:type', + content: openGraph.value.og_image_type?.attributes?.content, }, { - name: 'robots', - content: robots.value, + property: 'og:image:url', + content: openGraph.value.og_image_url_0?.attributes?.content, }, + { + property: 'og:image:width', + content: openGraph.value.og_image_width?.attributes?.content, + }, + { + property: 'og:latitude', + content: openGraph.value.og_latitude?.attributes?.content, + }, + { + property: 'og:locale', + content: openGraph.value.og_locale?.attributes?.content, + }, + { + property: 'og:locale:alternative', + content: openGraph.value.og_locale_alternative_0?.attributes?.content, + }, + { + property: 'og:locality', + content: openGraph.value.og_locality?.attributes?.content, + }, + { + property: 'og:longitude', + content: openGraph.value.og_longitude?.attributes?.content, + }, + { + property: 'og:phone_number', + content: openGraph.value.og_phone_number?.attributes?.content, + }, + { + property: 'og:postal_code', + content: openGraph.value.og_postal_code?.attributes?.content, + }, + { + property: 'og:region', + content: openGraph.value.og_region?.attributes?.content, + }, + { + property: 'og:see_also', + content: openGraph.value.og_see_also?.attributes?.content, + }, + { + property: 'og:street_address', + content: openGraph.value.og_street_address?.attributes?.content, + }, + { + property: 'og:updated_time', + content: openGraph.value.og_updated_time?.attributes?.content, + }, + { + property: 'og:video', + content: openGraph.value.og_video_0?.attributes?.content, + }, + { + property: 'og:video:duration', + content: openGraph.value.og_video_duration?.attributes?.content, + }, + { + property: 'og:video:height', + content: openGraph.value.og_video_height?.attributes?.content, + }, + { + property: 'og:video:secure_url', + content: openGraph.value.og_video_secure_url?.attributes?.content, + }, + { + property: 'og:video:type', + content: openGraph.value.og_video_type?.attributes?.content, + }, + { + property: 'og:video:width', + content: openGraph.value.og_video_width?.attributes?.content, + }, + { + property: 'profile:first_name', + content: openGraph.value.profile_first_name?.attributes?.content, + }, + { + property: 'profile:gender', + content: openGraph.value.profile_gender?.attributes?.content, + }, + { + property: 'profile:last_name', + content: openGraph.value.profile_last_name?.attributes?.content, + }, + { + property: 'profile:username', + content: openGraph.value.profile_username?.attributes?.content, + }, + { + property: 'video:actor', + content: openGraph.value.video_actor_0?.attributes?.content, + }, + { + property: 'video:actor:role', + content: openGraph.value.video_actor_role_0?.attributes?.content, + }, + { + property: 'video:director', + content: openGraph.value.video_director_0?.attributes?.content, + }, + { + property: 'video:release_date', + content: openGraph.value.video_release_date?.attributes?.content, + }, + { + property: 'video:series', + content: openGraph.value.video_series?.attributes?.content, + }, + { + property: 'video:tag', + content: openGraph.value.video_tag_0?.attributes?.content, + }, + { + property: 'video:writer', + content: openGraph.value.video_writer_0?.attributes?.content, + }, + ], + link: [ + { rel: 'canonical', href: openGraph.value.canonical_url?.attributes?.href }, + { rel: 'image_src', href: openGraph.value.image_src?.attributes?.href }, ], }); + +console.log('pageView', props.data);