Skip to content

Fixed resource tiles on Firefox #392

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
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
38 changes: 18 additions & 20 deletions app/components/TutorialsArticles.vue
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@ const props = defineProps<{
showMore?: boolean;
}>();

const { data: articles } = await useAsyncData(props.path + '-preview', () => {
const query = queryCollection('content')
.where('path', 'LIKE', `${props.path}/%`)
.select('title', 'description', 'icon', 'path', 'technologies');
const { data: articles } = await useAsyncData(props.path + "-preview", () => {
const query = queryCollection("content")
.where("path", "LIKE", `${props.path}/%`)
.select("title", "description", "icon", "path", "technologies");

if (props.limit) {
query.limit(props.limit);
Expand All @@ -19,20 +19,15 @@ const { data: articles } = await useAsyncData(props.path + '-preview', () => {
});

const imageSrc = (article: { technologies?: string[] }) => {
const technologies = article?.technologies || ['directus'];
const techString = technologies.join(', ');
const technologies = article?.technologies || ["directus"];
const techString = technologies.join(", ");
return `/docs/api/tutorialimg?logos=${techString}`;
};
</script>

<template>
<div
class="mt-8 gap-6 grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3"
>
<template
v-for="article in articles"
:key="article.path"
>
<div class="mt-8 gap-6 grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3">
<template v-for="article in articles" :key="article.path">
<UPageCard
v-if="article.title"
:to="article.path"
Expand All @@ -41,21 +36,24 @@ const imageSrc = (article: { technologies?: string[] }) => {
title: 'font-bold text-pretty',
description: 'line-clamp-2',
container: 'p-4 md:p-4 lg:p-4',

}"
class="hover:bg-primary/5 hover:ring-primary"
class="hover:bg-primary/5 hover:ring-primary overflow-hidden"
>
<div class="">
<div class="overflow-hidden">
<img
class="mb-0 max-h-36 w-full object-cover dark:brightness-90 rounded"
:src="imageSrc(article)"
alt="Generated Image"
>
<div class="col-span-2">
<ProseP class="text-gray-900 dark:text-white text-base truncate font-bold text-pretty">
/>
<div class="col-span-2 min-w-0">
<ProseP
class="text-gray-900 dark:text-white text-base font-bold text-pretty break-words line-clamp-2"
>
{{ article.title }}
</ProseP>
<ProseP class="text-[15px] text-gray-500 dark:text-gray-400 mt-1 line-clamp-2">
<ProseP
class="text-[15px] text-gray-500 dark:text-gray-400 mt-1 line-clamp-2 break-words"
>
{{ article.description }}
</ProseP>
</div>
Expand Down