Loading src/components/Graphic.astro +4 −4 Original line number Diff line number Diff line Loading @@ -6,11 +6,11 @@ import { TbTextCaption } from "react-icons/tb"; import Lightbox from "../components/Lightbox.astro"; import GraphicCornerLabel from "./GraphicCornerLabel.astro"; const { project, data, title } = Astro.props; const { path, data } = Astro.props; const { href, caption } = data; const DEFAULT_IMAGE_PATH = "/src/assets/default.png"; const images = import.meta.glob<{ default: ImageMetadata }>("src/**/*.{png,jpg,jpeg}", { import: 'default' }); const re = new RegExp(`/src/data/project/${project}/${href}`); const re = new RegExp(`/src/data/${path}/${href}`); const maybeImagePath = Object.keys(images).find((key) => re.test(key)); const src = images[maybeImagePath ? maybeImagePath : DEFAULT_IMAGE_PATH](); --- Loading @@ -23,7 +23,7 @@ const src = images[maybeImagePath ? maybeImagePath : DEFAULT_IMAGE_PATH](); </script> <div class="graphic-wrapper"> <GraphicCornerLabel /> <Image src={src} title={title} alt={title} width={380} height={200} /> <Image src={src} title={caption} alt={caption} width={380} height={200} /> { caption && ( <div class="graphic-caption"> Loading @@ -34,7 +34,7 @@ const src = images[maybeImagePath ? maybeImagePath : DEFAULT_IMAGE_PATH](); ) } </div> <Lightbox src={src} title={title} caption={caption} /> <Lightbox src={src} title={caption} caption={caption} /> <style> .graphic-wrapper { cursor: pointer; Loading src/pages/[organization].astro +1 −2 Original line number Diff line number Diff line Loading @@ -43,8 +43,7 @@ export async function getStaticPaths() { <aside> <div> <Graphic project={organization} title={title} path={`organization/${organization}`} data={meta?.graphics?.[0]} /> </div> Loading src/pages/[project].astro +1 −2 Original line number Diff line number Diff line Loading @@ -46,8 +46,7 @@ export async function getStaticPaths() { <aside> <div> <Graphic project={project} title={title} path={`project/${project}`} data={meta?.graphics?.[0]} /> </div> Loading Loading
src/components/Graphic.astro +4 −4 Original line number Diff line number Diff line Loading @@ -6,11 +6,11 @@ import { TbTextCaption } from "react-icons/tb"; import Lightbox from "../components/Lightbox.astro"; import GraphicCornerLabel from "./GraphicCornerLabel.astro"; const { project, data, title } = Astro.props; const { path, data } = Astro.props; const { href, caption } = data; const DEFAULT_IMAGE_PATH = "/src/assets/default.png"; const images = import.meta.glob<{ default: ImageMetadata }>("src/**/*.{png,jpg,jpeg}", { import: 'default' }); const re = new RegExp(`/src/data/project/${project}/${href}`); const re = new RegExp(`/src/data/${path}/${href}`); const maybeImagePath = Object.keys(images).find((key) => re.test(key)); const src = images[maybeImagePath ? maybeImagePath : DEFAULT_IMAGE_PATH](); --- Loading @@ -23,7 +23,7 @@ const src = images[maybeImagePath ? maybeImagePath : DEFAULT_IMAGE_PATH](); </script> <div class="graphic-wrapper"> <GraphicCornerLabel /> <Image src={src} title={title} alt={title} width={380} height={200} /> <Image src={src} title={caption} alt={caption} width={380} height={200} /> { caption && ( <div class="graphic-caption"> Loading @@ -34,7 +34,7 @@ const src = images[maybeImagePath ? maybeImagePath : DEFAULT_IMAGE_PATH](); ) } </div> <Lightbox src={src} title={title} caption={caption} /> <Lightbox src={src} title={caption} caption={caption} /> <style> .graphic-wrapper { cursor: pointer; Loading
src/pages/[organization].astro +1 −2 Original line number Diff line number Diff line Loading @@ -43,8 +43,7 @@ export async function getStaticPaths() { <aside> <div> <Graphic project={organization} title={title} path={`organization/${organization}`} data={meta?.graphics?.[0]} /> </div> Loading
src/pages/[project].astro +1 −2 Original line number Diff line number Diff line Loading @@ -46,8 +46,7 @@ export async function getStaticPaths() { <aside> <div> <Graphic project={project} title={title} path={`project/${project}`} data={meta?.graphics?.[0]} /> </div> Loading