astro v5
This commit is contained in:
parent
62d2b3717a
commit
c697e7a278
11 changed files with 1136 additions and 2331 deletions
|
@ -1,25 +1,25 @@
|
|||
---
|
||||
import { getEntry } from "astro:content";
|
||||
import { getCollection } from "astro:content";
|
||||
|
||||
const badges = await getEntry("badges", "badges");
|
||||
const badges = await getCollection("badges");
|
||||
---
|
||||
|
||||
<div class="badges">
|
||||
{badges.data.map((badge) => {
|
||||
const hasHref = badge.href !== undefined;
|
||||
{badges.map((badge) => {
|
||||
const hasHref = badge.data.href !== undefined;
|
||||
|
||||
// ugh.
|
||||
// i wish we could dedupe this, but im not sure how
|
||||
return <>
|
||||
{hasHref ? <a href={badge.href} target="_blank" rel="noreferrer noopener">
|
||||
{typeof badge.path !== "string"
|
||||
? <img src={badge.path.src} alt={badge.alt} title={badge.title} loading="lazy" decoding="async" width="88" height="31"/>
|
||||
: <img src={badge.path} alt={badge.alt} title={badge.title} loading="lazy" decoding="async" width="88" height="31"/>
|
||||
{hasHref ? <a href={badge.data.href} target="_blank" rel="noreferrer noopener">
|
||||
{typeof badge.data.path !== "string"
|
||||
? <img src={badge.data.path.src} alt={badge.data.alt} title={badge.data.title} loading="lazy" decoding="async" width="88" height="31"/>
|
||||
: <img src={badge.data.path} alt={badge.data.alt} title={badge.data.title} loading="lazy" decoding="async" width="88" height="31"/>
|
||||
}
|
||||
</a> : <>
|
||||
{typeof badge.path !== "string"
|
||||
? <img src={badge.path.src} alt={badge.alt} title={badge.title} loading="lazy" decoding="async" width="88" height="31"/>
|
||||
: <img src={badge.path} alt={badge.alt} title={badge.title} loading="lazy" decoding="async" width="88" height="31"/>
|
||||
{typeof badge.data.path !== "string"
|
||||
? <img src={badge.data.path.src} alt={badge.data.alt} title={badge.data.title} loading="lazy" decoding="async" width="88" height="31"/>
|
||||
: <img src={badge.data.path} alt={badge.data.alt} title={badge.data.title} loading="lazy" decoding="async" width="88" height="31"/>
|
||||
}
|
||||
</>}
|
||||
</>;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue