#101 news and essential workshops should open browser

This commit is contained in:
neil 2022-12-21 13:08:55 +08:00
parent f063c576cb
commit 4e4fa27364
5 changed files with 9 additions and 4 deletions

View file

@ -16,7 +16,7 @@
<PanelHeader title="Essential Workshops" ctaLabel="View all" ctaLink="/" />
{#if courses.length}
<Posts posts={courses} />
<Posts posts={courses} linkTarget="_blank" />
{:else}
<section class="h-64 border border-gray bg-black p-4">
<Preloader />

View file

@ -23,4 +23,5 @@
imageUrl: course.banner_image_url,
link: course.link
}))}
linkTarget="_blank"
/>

View file

@ -16,7 +16,7 @@
<PanelHeader title="Open-source News" ctaLabel="Read more articles >" ctaLink="/" />
{#if news.length}
<Posts posts={news} />
<Posts posts={news} linkTarget="_blank" />
{:else}
<section class="h-64 border border-gray bg-black p-4">
<Preloader />

View file

@ -6,6 +6,7 @@
import GalleryItem from './GalleryItem.svelte';
export let title = '';
export let linkTarget = '';
interface GalleryItemShape {
imageUrl: string;
@ -77,7 +78,7 @@
<section class="absolute top-0 flex h-full" style={styleFeaturedPackages}>
{#each items as item}
<div class="h-full" style={`width:${width}px`}>
<a href={item.link}>
<a href={item.link} target={linkTarget} rel="noopener">
<GalleryItem {...item} {width} />
</a>
</div>

View file

@ -2,6 +2,7 @@
import '../app.css';
import type { AirtablePost } from '../types';
export let linkTarget = '';
export let posts: AirtablePost[] = [];
</script>
@ -15,7 +16,9 @@
<section class="w-2/3 p-4 font-sono">
<h1 class="text-xl text-primary">{article.title}</h1>
<p class="my-4 text-sm line-clamp-4">{article.short_description}</p>
<a href={article.link} class="text-sm text-primary underline">Read more ...</a>
<a href={article.link} target={linkTarget} class="text-sm text-primary underline"
>Read more ...</a
>
</section>
</article>
</li>