Skip to content

Commit

Permalink
[d0xigen] Add author's website, twitter, telegram to the meta
Browse files Browse the repository at this point in the history
  • Loading branch information
d0rich committed Sep 6, 2024
1 parent f3e043a commit 8969701
Show file tree
Hide file tree
Showing 5 changed files with 47 additions and 2 deletions.
5 changes: 5 additions & 0 deletions .changeset/eighty-knives-lie.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'd0xigen': patch
---

Add author's website, twitter, telegram to the meta
5 changes: 5 additions & 0 deletions apps/d0xigen.d0rich.me/app.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,11 @@ export default defineAppConfig({
description: '🌬📓 Docs to breath life into your project',
url: 'https://d0xigen.d0rich.me',
author: 'Nikolay Dorofeev',
authorSocial: {
telegram: '@d0rich',
website: 'https://d0rich.me',
twitter: '@d0rich'
},
social: {
github: 'https://github.com/d0rich/esprit/tree/main/packages/d0xigen'
},
Expand Down
11 changes: 11 additions & 0 deletions packages/d0xigen/app.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,12 @@ interface ThemeConfig {
description: string
url: string
author: string
authorSocial?: {
telegram?: `@${string}`
website?: string
twitter?: `@${string}`
twitterSite?: `@${string}`
}
social?: {
github?: string
}
Expand Down Expand Up @@ -40,6 +46,11 @@ export default defineAppConfig({
description: 'My awesome docs',
url: 'https://d0rich.me',
author: 'Nikolai Dorofeev',
authorSocial: {
telegram: '@d0rich',
website: 'https://d0rich.me',
twitter: '@d0rich'
},
social: {
github: undefined
},
Expand Down
6 changes: 6 additions & 0 deletions packages/d0xigen/app.vue
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,12 @@ useSeoMeta({
ogImage: appConfig.d0xigen.url + appConfig.d0xigen.og.image,
twitterImage: appConfig.d0xigen.url + appConfig.d0xigen.og.image,
twitterCard: 'summary_large_image',
twitterSite: computed(
() =>
appConfig.d0xigen.authorSocial?.twitterSite ??
appConfig.d0xigen.authorSocial?.twitter
),
twitterCreator: appConfig.d0xigen.authorSocial?.twitter,
ogUrl: computed(() => appConfig.d0xigen.url + route.path)
})
</script>
Expand Down
22 changes: 20 additions & 2 deletions packages/d0xigen/components/d/AsyncSafeMeta.vue
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<script setup lang="ts">
const config = useAppConfig()
defineProps<{
title?: string
ogTitle?: string
Expand All @@ -17,7 +18,24 @@ defineProps<{
property="og:title"
:content="ogTitle || title"
/>
<Meta v-if="description" name="description" :content="description" />
<Meta v-if="description" property="og:description" :content="description" />
<template v-if="description">
<Meta v-if="description" name="description" :content="description" />
<Meta
v-if="description"
property="og:description"
:content="description"
/>
</template>

<Link
v-if="config.d0xigen.authorSocial?.website"
rel="author"
:href="config.d0xigen.authorSocial?.website"
/>
<Meta
v-if="config.d0xigen.authorSocial?.telegram"
property="tg:channel"
:content="config.d0xigen.authorSocial?.telegram"
/>
</Head>
</template>

0 comments on commit 8969701

Please sign in to comment.