this repo has no description
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

๐Ÿ› Fix some aliasing shenanigans

+21 -14
+2 -11
src/components/TagReference.astro
··· 8 8 const tag = await getEntry( 9 9 "tags", 10 10 typeof Astro.props.tag === "string" ? Astro.props.tag : Astro.props.tag.id, 11 - )?.then((tag) => 12 - tag 13 - ? { 14 - ...tag.data, 15 - slug: 16 - (tag.data as unknown as { isAliasOf: string | null }).isAliasOf ?? 17 - tag.id, 18 - } 19 - : "", 20 - ); 11 + )?.then((t) => t?.data); 21 12 --- 22 13 23 - {tag && <a href={`/${tag.slug}`}>#{tag.singular}</a>} 14 + {tag && <a href={`/${tag.isAliasOf ?? tag.slug}`}>#{tag.singular}</a>} 24 15 25 16 <style> 26 17 a {
+19 -3
src/pages/using/[tech].astro
··· 4 4 import StrongHeader from "../../components/StrongHeader.astro"; 5 5 import Layout from "../../layouts/Regular.astro"; 6 6 import WorksGrid from "../../components/WorksGrid.astro"; 7 + import { resolveAliased } from "../../aliases"; 7 8 export const getStaticPaths = (async () => { 8 9 return await getCollection("technologies").then((techs) => 9 10 techs.map((tech) => ({ params: { tech: tech.id } })), 10 11 ); 11 12 }) satisfies GetStaticPaths; 12 13 13 - const tech = await getEntry("technologies", Astro.params.tech!.toString()); 14 + const technologies = await getCollection("technologies"); 15 + 16 + let tech = await getEntry("technologies", Astro.params.tech!.toString()); 17 + if (!tech) return Astro.rewrite("/404"); 18 + 19 + tech = await getEntry( 20 + "technologies", 21 + resolveAliased(tech.id, technologies) ?? tech.id, 22 + ); 14 23 if (!tech) return Astro.rewrite("/404"); 15 24 16 25 const works = await getCollection("works").then((works) => ··· 18 27 .filter( 19 28 ({ data: work }) => 20 29 !work.metadata.private && 21 - work.metadata.madeWith?.some((mw) => mw.id === tech.id), 30 + (work.metadata.madeWith?.some( 31 + (mw) => resolveAliased(mw.id, technologies) === tech.id, 32 + ) || 33 + work.metadata.additionalMetadata?.made_with 34 + ?.map((id) => resolveAliased(id, technologies)) 35 + .includes(tech.id)), 22 36 ) 23 37 .map((w) => w.data), 24 38 ); 39 + 40 + const name = tech.data.name === "C Sharp" ? "C#" : tech.data.name; 25 41 --- 26 42 27 43 <Layout> 28 44 <StrongHeader 29 45 back="/" 30 - title={tech.data.name} 46 + title={name} 31 47 editButton="~/projects.local/portfolio/technologies.yaml" 32 48 > 33 49 <div class="description" i18n set:html={tech.rendered!.html} />