From 58d0462f17b8fc7154ed07d63cf80e79757b4dfd Mon Sep 17 00:00:00 2001 From: kmacoders Date: Thu, 1 Jul 2021 00:55:50 +0700 Subject: [PATCH] feat: wip add blog detail page --- pages/blog/_slug.vue | 90 ++++++++++++++++++++++++++++++++++++++------ utils/getSiteMeta.js | 28 +++++++------- utils/global.js | 12 +++--- 3 files changed, 98 insertions(+), 32 deletions(-) diff --git a/pages/blog/_slug.vue b/pages/blog/_slug.vue index efff516..fd7e08b 100644 --- a/pages/blog/_slug.vue +++ b/pages/blog/_slug.vue @@ -1,22 +1,88 @@ diff --git a/utils/getSiteMeta.js b/utils/getSiteMeta.js index 8329b14..de2d20a 100644 --- a/utils/getSiteMeta.js +++ b/utils/getSiteMeta.js @@ -1,56 +1,56 @@ -import global from './global'; +import global from './global' export default (meta) => { return [ { hid: 'description', name: 'description', - content: (meta && meta.description) || global.siteDesc, + content: (meta && meta.description) || global.siteDesc }, { hid: 'og:type', property: 'og:type', - content: (meta && meta.type) || global.siteType, + content: (meta && meta.type) || global.siteType }, { hid: 'og:url', property: 'og:url', - content: (meta && meta.url) || global.siteUrl, + content: (meta && meta.url) || global.siteUrl }, { hid: 'og:title', property: 'og:title', - content: (meta && meta.title) || global.siteTitle, + content: (meta && meta.title) || global.siteTitle }, { hid: 'og:description', property: 'og:description', - content: (meta && meta.description) || global.siteDesc, + content: (meta && meta.description) || global.siteDesc }, { hid: 'og:image', property: 'og:image', - content: (meta && meta.mainImage) || global.mainImage, + content: (meta && meta.mainImage) || global.mainImage }, { hid: 'twitter:url', name: 'twitter:url', - content: (meta && meta.url) || global.siteUrl, + content: (meta && meta.url) || global.siteUrl }, { hid: 'twitter:title', name: 'twitter:title', - content: (meta && meta.title) || global.siteTitle, + content: (meta && meta.title) || global.siteTitle }, { hid: 'twitter:description', name: 'twitter:description', - content: (meta && meta.description) || global.siteDesc, + content: (meta && meta.description) || global.siteDesc }, { hid: 'twitter:image', name: 'twitter:image', - content: (meta && meta.mainImage) || global.mainImage, - }, - ]; -}; + content: (meta && meta.mainImage) || global.mainImage + } + ] +} diff --git a/utils/global.js b/utils/global.js index 45f6011..8becbb5 100644 --- a/utils/global.js +++ b/utils/global.js @@ -4,15 +4,15 @@ access any variable via object syntax global.yourVarName */ export default { - siteUrl: 'https://example.com', - siteName: 'Starter Blog', - author: 'Joe Blogs', - twitterHandle: '@joeblogs', + siteUrl: 'https://ehandytech.com', + siteName: 'ehandytech', + author: 'Huwng', + twitterHandle: '@kmacoders', twitterURL: 'https://twitter.com/garethredfern', githubURL: 'https://github.com/garethredfern', siteTitle: 'Add Your Main Site Title Here', siteDesc: 'A description for your site here, this will show on the home page.', mainImage: '', - siteType: 'website', -}; + siteType: 'website' +}