Fix title issue and seo data

Signed-off-by: nurRiyad <asadnurriyad@gmail.com>
This commit is contained in:
nurRiyad
2024-06-27 00:26:45 +06:00
parent fa2f23f6fa
commit d3c28af301
12 changed files with 42 additions and 22 deletions

View File

@@ -1,5 +1,5 @@
<script setup lang="ts"> <script setup lang="ts">
import { footerData } from '~/data' import { footerData, seoData } from '~/data'
</script> </script>
<template> <template>
@@ -12,7 +12,7 @@ import { footerData } from '~/data'
</p> </p>
<a <a
href="mailto: alasadnurriyad4@gmail.com" :href="`mailto: ${seoData.mailAddress}`"
class="block text-center w-full bg-sky-700 p-2 rounded-lg text-[#F1F2F4] mt-3 text-sm" class="block text-center w-full bg-sky-700 p-2 rounded-lg text-[#F1F2F4] mt-3 text-sm"
> >
Sent Mail Sent Mail

View File

@@ -29,7 +29,6 @@ useHead({
'Welcome To My Blog Site. Get Web Development, Javascript, Typescript, NodeJs, Vue, and Nuxt, Related Articles, Tips, Learning resources and more.', 'Welcome To My Blog Site. Get Web Development, Javascript, Typescript, NodeJs, Vue, and Nuxt, Related Articles, Tips, Learning resources and more.',
}, },
], ],
titleTemplate: 'Riyad\'s Blog - %s',
}) })
</script> </script>

View File

@@ -29,7 +29,6 @@ useHead({
'Welcome To My Blog Site. Get Web Development, Javascript, Typescript, NodeJs, Vue, and Nuxt, Related Articles, Tips, Learning resources and more.', 'Welcome To My Blog Site. Get Web Development, Javascript, Typescript, NodeJs, Vue, and Nuxt, Related Articles, Tips, Learning resources and more.',
}, },
], ],
titleTemplate: 'Riyad\'s Blog - %s',
}) })
</script> </script>

View File

@@ -35,7 +35,9 @@ export const seoData = {
ogTitle: 'Riyad codes and helps others learn Javascript, Typescript, Vue, Nuxt, & Problem Solving', ogTitle: 'Riyad codes and helps others learn Javascript, Typescript, Vue, Nuxt, & Problem Solving',
twitterDescription: 'My blog website, where I play around with Nuxt, Vue, and more and showcase my blog, resources, etc', twitterDescription: 'My blog website, where I play around with Nuxt, Vue, and more and showcase my blog, resources, etc',
image: 'https://res.cloudinary.com/dmecmyphj/image/upload/v1673548905/nuxt-blog/cover_ntgs6u.webp', image: 'https://res.cloudinary.com/dmecmyphj/image/upload/v1673548905/nuxt-blog/cover_ntgs6u.webp',
mySite: 'https://blog-nurriyad.vercel.app/', mySite: 'https://blog-nurriyad.vercel.app',
twitterHandle: '@qdnvubp',
mailAddress: 'asadnurriyad@gmail.com',
} }
export const siteMetaData = [ export const siteMetaData = [
@@ -63,7 +65,7 @@ export const siteMetaData = [
content: seoData.image, content: seoData.image,
}, },
// Test on: https://cards-dev.twitter.com/validator or https://socialsharepreview.com/ // Test on: https://cards-dev.twitter.com/validator or https://socialsharepreview.com/
{ name: 'twitter:site', content: '@qdnvubp' }, { name: 'twitter:site', content: seoData.twitterHandle },
{ name: 'twitter:card', content: 'summary_large_image' }, { name: 'twitter:card', content: 'summary_large_image' },
{ {
name: 'twitter:url', name: 'twitter:url',

View File

@@ -1,12 +1,13 @@
import { navbarData, seoData } from './data'
// https://nuxt.com/docs/api/configuration/nuxt-config // https://nuxt.com/docs/api/configuration/nuxt-config
export default defineNuxtConfig({ export default defineNuxtConfig({
app: { app: {
head: { head: {
charset: 'utf-16', charset: 'utf-16',
viewport: 'width=device-width,initial-scale=1', viewport: 'width=device-width,initial-scale=1',
title: 'Riyad\'s Blog', title: navbarData.homeTitle,
titleTemplate: '%s - Riyad\'s Blog', titleTemplate: `%s - ${navbarData.homeTitle}`,
meta: [{ name: 'description', content: 'Riyad\'s awesome blog' }],
}, },
pageTransition: { name: 'page', mode: 'out-in' }, pageTransition: { name: 'page', mode: 'out-in' },
layoutTransition: { name: 'layout', mode: 'out-in' }, layoutTransition: { name: 'layout', mode: 'out-in' },
@@ -16,11 +17,11 @@ export default defineNuxtConfig({
strictNuxtContentPaths: true, strictNuxtContentPaths: true,
}, },
site: { site: {
url: 'https://blog.nurriyad.xyz', url: seoData.mySite,
identity: { identity: {
type: 'Person', type: 'Person',
}, },
twitter: '@qdnvubp', twitter: seoData.twitterHandle,
}, },
typescript: { typescript: {

View File

@@ -1,4 +1,14 @@
<script setup lang="ts"> <script setup lang="ts">
useHead({
title: '404',
meta: [
{
name: 'description',
content: 'Page not found',
},
],
})
defineOgImageComponent('About', { defineOgImageComponent('About', {
headline: 'Wrong Path', headline: 'Wrong Path',
title: '404', title: '404',

View File

@@ -1,9 +1,19 @@
<script setup lang="ts"> <script setup lang="ts">
import { aboutPage } from '~/data' import { aboutPage, footerData, navbarData } from '~/data'
useHead({
title: 'About',
meta: [
{
name: 'description',
content: footerData.aboutAuthor,
},
],
})
defineOgImageComponent('About', { defineOgImageComponent('About', {
headline: 'Greetings 👋', headline: 'Greetings 👋',
title: 'Riyad\'s Blog', title: navbarData.homeTitle,
description: 'Dive into web development with me and learn Js, Ts, Vue, Nuxt, Docker, k8s', description: 'Dive into web development with me and learn Js, Ts, Vue, Nuxt, Docker, k8s',
link: '/riyad.jpg', link: '/riyad.jpg',
}) })

View File

@@ -1,5 +1,6 @@
<script setup lang="ts"> <script setup lang="ts">
import type { BlogPost } from '@/types/blog' import type { BlogPost } from '@/types/blog'
import { navbarData, seoData } from '~/data'
const { path } = useRoute() const { path } = useRoute()
@@ -30,11 +31,11 @@ useHead({
content: data.value.description, content: data.value.description,
}, },
// Test on: https://developers.facebook.com/tools/debug/ or https://socialsharepreview.com/ // Test on: https://developers.facebook.com/tools/debug/ or https://socialsharepreview.com/
{ property: 'og:site_name', content: 'Riyad\'s Blog' }, { property: 'og:site_name', content: navbarData.homeTitle },
{ hid: 'og:type', property: 'og:type', content: 'website' }, { hid: 'og:type', property: 'og:type', content: 'website' },
{ {
property: 'og:url', property: 'og:url',
content: `https://blog-nurriyad.vercel.app/${path}`, content: `${seoData.mySite}/${path}`,
}, },
{ {
property: 'og:title', property: 'og:title',
@@ -53,7 +54,7 @@ useHead({
{ name: 'twitter:card', content: 'summary_large_image' }, { name: 'twitter:card', content: 'summary_large_image' },
{ {
name: 'twitter:url', name: 'twitter:url',
content: `https://blog-nurriyad.vercel.app/${path}`, content: `${seoData.mySite}/${path}`,
}, },
{ {
name: 'twitter:title', name: 'twitter:title',
@@ -71,7 +72,7 @@ useHead({
link: [ link: [
{ {
rel: 'canonical', rel: 'canonical',
href: `https://blog-nurriyad.vercel.app/${path}`, href: `${seoData.mySite}/${path}`,
}, },
], ],
}) })

View File

@@ -65,7 +65,6 @@ useHead({
content: 'Here you will find all the blog posts I have written & published on this site.', content: 'Here you will find all the blog posts I have written & published on this site.',
}, },
], ],
titleTemplate: 'Riyad\'s Blog - %s',
}) })
// Generate OG Image // Generate OG Image

View File

@@ -42,7 +42,6 @@ useHead({
content: `You will find all the ${category.value} related post here`, content: `You will find all the ${category.value} related post here`,
}, },
], ],
titleTemplate: 'Riyad\'s Blog - %s',
}) })
// Generate OG Image // Generate OG Image

View File

@@ -27,7 +27,6 @@ useHead({
'Below All the topics are listed on which either I have written a blog or will write a blog in near future.', 'Below All the topics are listed on which either I have written a blog or will write a blog in near future.',
}, },
], ],
titleTemplate: 'Riyad\'s Blog - %s',
}) })
// Generate OG Image // Generate OG Image

View File

@@ -1,4 +1,6 @@
<script lang="ts" setup> <script lang="ts" setup>
import { navbarData } from '~/data'
useHead({ useHead({
title: 'Home', title: 'Home',
meta: [ meta: [
@@ -8,13 +10,12 @@ useHead({
'Welcome To My Blog Site. Get Web Development, Javascript, Typescript, NodeJs, Vue, and Nuxt, Related Articles, Tips, Learning resources and more.', 'Welcome To My Blog Site. Get Web Development, Javascript, Typescript, NodeJs, Vue, and Nuxt, Related Articles, Tips, Learning resources and more.',
}, },
], ],
titleTemplate: 'Riyad\'s Blog - %s',
}) })
// Generate OG Image // Generate OG Image
defineOgImageComponent('About', { defineOgImageComponent('About', {
headline: 'Greetings 👋', headline: 'Greetings 👋',
title: 'Riyad\'s Blog', title: navbarData.homeTitle,
description: 'Dive into web development with me and learn Js, Ts, Vue, Nuxt, Docker, k8s', description: 'Dive into web development with me and learn Js, Ts, Vue, Nuxt, Docker, k8s',
link: '/riyad.jpg', link: '/riyad.jpg',
}) })