From 29b67ab5b5092f7ac62e1d9a2f35e53e7f7023b8 Mon Sep 17 00:00:00 2001 From: alifprihantoro Date: Fri, 15 Nov 2024 22:41:44 +0700 Subject: [PATCH] fix: seo, package ver and env - seo : - add meta tag - og images --- web/blogger/package.json | 4 +- web/blogger/src/component/Main.ts | 10 ++-- web/blogger/src/component/seo.ts | 73 ++++++++++++++++++++++-- web/blogger/src/component/widget/main.ts | 7 ++- web/blogger/src/env.d.ts | 12 +--- 5 files changed, 79 insertions(+), 27 deletions(-) diff --git a/web/blogger/package.json b/web/blogger/package.json index 9f8fa97..daecd49 100644 --- a/web/blogger/package.json +++ b/web/blogger/package.json @@ -12,13 +12,13 @@ "dependencies": { "@astrojs/check": "^0.9.4", "@astrojs/tailwind": "^5.1.2", - "astro": "^4.16.6", + "astro": "^4.16.12", "loadmore": "workspace:^", "tailwindcss": "^3.4.14", "typescript": "^5.6.3", "ui": "workspace:^" }, "devDependencies": { - "@muryp/vite-html": "^1.0.6" + "@muryp/vite-html": "^1.0.8" } } \ No newline at end of file diff --git a/web/blogger/src/component/Main.ts b/web/blogger/src/component/Main.ts index 3ddb5df..10f252e 100644 --- a/web/blogger/src/component/Main.ts +++ b/web/blogger/src/component/Main.ts @@ -7,6 +7,8 @@ import listPost from './pages/List' import postContent from './pages/Post' import tags from './widget/tags' +//TODO : link nav +// seo (search engine crawl google, bing,etc) export default html` <!-- - --><head> - - - - ${seo} + --><head> ${seo} ${tags} - + ${listPost} ${MainWidget({ postContent })} diff --git a/web/blogger/src/component/seo.ts b/web/blogger/src/component/seo.ts index a08366f..6be3d45 100644 --- a/web/blogger/src/component/seo.ts +++ b/web/blogger/src/component/seo.ts @@ -1,13 +1,74 @@ +const FB_ID = 'alifprihantoro' +const IMG_URL = + 'https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh0s35S6K3n6U11iGP0yAlwh5XSV8WYSmZGenleDTIR64hoeD-5uoyk7g3Ih5KqY7QQVW_GiUcSZ3h1BiP0wJp6_kPPy_N9JYI8NGCBUho8zhZgXTf3onFvIN3_LYx-K2-7-P6lOGz_igD9yya6tDzPFCGkrzBBjoLvbdJYQ0-jUMjNqPKc4lqnnzS0AGc/s672/Screenshot_20241115-222638_1.jpg' export default html` + + + + <data:blog.pageTitle /> | News Tech - - - <data:blog.pageName /> - <data:blog.title /> - - - Page Not Found - <data:blog.title /> + + <data:blog.pageName/> | <data:blog.metaDescription/> + + <data:blog.title/> | <data:blog.metaDescription/> + + <data:blog.pageTitle/> | <data:blog.metaDescription/> + + + <data:view.search.resultsMessage/> | <data:blog.metaDescription/> + + + <data:blog.pageTitle/> | <data:blog.metaDescription/> + + + <data:view.archive.rangeMessage/> | <data:blog.metaDescription/> + + + 404 - URL Tidak Ditemukan + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + ` diff --git a/web/blogger/src/component/widget/main.ts b/web/blogger/src/component/widget/main.ts index b80a8bd..610ab45 100644 --- a/web/blogger/src/component/widget/main.ts +++ b/web/blogger/src/component/widget/main.ts @@ -32,9 +32,12 @@ export default function MainWidget({ postContent }: TArgs) { - ${postContent} + + ${postContent} + ` -} \ No newline at end of file +} diff --git a/web/blogger/src/env.d.ts b/web/blogger/src/env.d.ts index 485f650..163fbe2 100644 --- a/web/blogger/src/env.d.ts +++ b/web/blogger/src/env.d.ts @@ -1,13 +1,3 @@ /// /// -declare global { - function html( - e: TemplateStringsArray, - ...a: Array - ): string - type Targs = { - name?: string - type?: string - } -} -export {} \ No newline at end of file +import '@muryp/vite-html/type'