Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dynamic OGs Again Again 😭 #178

Merged
merged 2 commits into from
Jan 7, 2025
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
add templates page case
bryantgillespie committed Jan 7, 2025
commit 594024bd10b2fa37d39bbd2ed846f821bb4b942a
12 changes: 12 additions & 0 deletions utils/og.ts
Original file line number Diff line number Diff line change
@@ -55,6 +55,18 @@ export function getOgProps(baseUrl: string, collection: string, item = {} as any
};
}

case 'templates': {
return {
...props,
title: item.name ?? 'Directus Template',
imageUrl: `${baseUrl}/${item.image?.id}?format=jpeg&width=800`,
badgeLabel: 'Directus Template',
publishedAt: item.description,
authorName: userName(item.creator),
authorImage: `${baseUrl}/${item.creator?.avatar}?format=jpeg&width=800`,
};
}

default:
return props;
}

Unchanged files with check annotations Beta

const { $directus, $readItems } = useNuxtApp();
const {
public: { directusUrl },

Check warning on line 13 in pages/creators/[slug].vue

GitHub Actions / Lint

'directusUrl' is assigned a value but never used. Allowed unused vars must match /^_/u
} = useRuntimeConfig();
const { data: creator } = await useAsyncData(
<script setup lang="ts">
const { $directus, $readItems } = useNuxtApp();
const { fullPath, params } = useRoute();

Check warning on line 3 in pages/features/[slug].vue

GitHub Actions / Lint

'fullPath' is assigned a value but never used. Allowed unused vars must match /^_/u
const router = useRouter();
const {
public: { directusUrl, baseUrl },

Check warning on line 7 in pages/features/[slug].vue

GitHub Actions / Lint

'directusUrl' is assigned a value but never used. Allowed unused vars must match /^_/u

Check warning on line 7 in pages/features/[slug].vue

GitHub Actions / Lint

'baseUrl' is assigned a value but never used. Allowed unused vars must match /^_/u
} = useRuntimeConfig();
const { data: feature } = await useAsyncData(
<BaseContainer>
<div class="details">
<h1>{{ live.title }}</h1>
<div v-html="live.description" />

Check warning on line 98 in pages/tv/live.vue

GitHub Actions / Lint

'v-html' directive can lead to XSS attack
</div>
<div v-if="highlights.length" class="highlights">