Skip to content

Commit

Permalink
Leadership page is feature complete, but stil needs more details
Browse files Browse the repository at this point in the history
  • Loading branch information
Powerlated committed Sep 14, 2024
1 parent b000fe5 commit 887a41d
Show file tree
Hide file tree
Showing 20 changed files with 353 additions and 188 deletions.
4 changes: 4 additions & 0 deletions astro.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ import {
responsiveTablesRehypePlugin,
lazyImagesRehypePlugin,
} from './src/utils/frontmatter.mjs';
import dsv from '@rollup/plugin-dsv';

const __dirname = path.dirname(fileURLToPath(import.meta.url));

Expand Down Expand Up @@ -90,5 +91,8 @@ export default defineConfig({
'~': path.resolve(__dirname, './src'),
},
},
plugins: [
dsv(),
]
},
});
115 changes: 115 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
"@astrolib/seo": "^1.0.0-beta.5",
"@fontsource-variable/anek-devanagari": "^5.0.13",
"@fontsource-variable/inter": "^5.0.19",
"@rollup/plugin-dsv": "^3.0.4",
"astro": "^4.13.1",
"astro-embed": "^0.7.2",
"astro-icon": "^1.1.0",
Expand Down
Binary file added src/assets/images/staff/Brian Jia.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/assets/images/staff/Hanshu Kotta.webp
Binary file not shown.
Binary file added src/assets/images/staff/Julian Hooks.webp
Binary file not shown.
Binary file added src/assets/images/staff/Lauren Clar.webp
Binary file not shown.
Binary file added src/assets/images/staff/Matthew Heinzman.webp
Binary file not shown.
Binary file added src/assets/images/staff/Ray Saracene.webp
Binary file not shown.
Binary file added src/assets/images/staff/unknown.webp
Binary file not shown.
4 changes: 2 additions & 2 deletions src/components/widgets/Hero.astro
Original file line number Diff line number Diff line change
Expand Up @@ -45,11 +45,11 @@ const {
/>
)
}
<div class="max-w-3xl mx-auto">
<div class="max-w-7xl mx-auto">
{subtitle && <p class="text-xl mb-6" set:html={subtitle} />}
{
actions && (
<div class="max-w-mdt sm:max-w-lg m-auto flex flex-nowrap flex-col sm:flex-row sm:justify-center gap-4">
<div class="max-w-3xl m-auto flex flex-nowrap flex-col sm:flex-row sm:justify-center gap-4">
{Array.isArray(actions) ? (
actions.map((action) => (
<div class="flex w-full sm:w-auto">
Expand Down
4 changes: 2 additions & 2 deletions src/components/widgets/Staff.astro
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
import getLeadershipData from "~/leadershipData";
import getStaffRecord from "~/staffData"
import Socials from "./Socials.astro";
export interface Props {
Expand All @@ -13,5 +13,5 @@ const { title, name } = Astro.props;
<div class="">
<h2 class="text-xl font-bold">{title}</h2>
<h2 class="text-xl font-bold text-primary">{name}</h2>
<Socials {...getLeadershipData(name)}/>
<Socials {...getStaffRecord(name)}/>
</tr>
40 changes: 34 additions & 6 deletions src/components/widgets/StaffCard.astro
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
---
import getLeadershipData from "~/leadershipData";
import getStaffRecord from "~/staffData";
import { Image } from "astro:assets";
import Socials from "./Socials.astro";
import { Logger } from "node_modules/astro/dist/core/logger/core";
export interface Props {
name: string;
Expand All @@ -10,16 +11,43 @@ export interface Props {
const { name, noSocials } = Astro.props;
let leadershipData = getLeadershipData(name);
const basePath = "/src/assets/images/staff/";
let leadershipData = getStaffRecord(name);
const images = import.meta.glob<{ default: ImageMetadata }>(
"/src/assets/images/staff/*.{jpeg,jpg,png}",
"/src/assets/images/staff/*.{jpeg,jpg,png,webp}",
);
const imagePath = "/src/assets/images/staff/" + name + ".png";
function getImagePath(name) {
let imagePath;
for (let i in images) {
if (i.startsWith(basePath + name)) {
imagePath = i;
}
}
return imagePath;
}
let imagePath = getImagePath(name);
if (getImagePath(name) == null) {
imagePath = getImagePath("unknown");
// throw new Error(
// `Staff image not found for ${name} in ${basePath}
// Images considered:
// ${Object.keys(images).join("\n")}
// `,
// );
}
const image = images[imagePath]();
---

<div class="inline-block">
<div class="border border-[#ffffff29] bg-page rounded-md p-4 flex flex-col gap-4 shadow-lg m-auto">
<div
class="border border-[#ffffff29] bg-page rounded-md p-4 flex flex-col gap-4 shadow-lg m-auto"
>
<Image class="rounded-sm" src={image} alt={name} width="400" />
<div>
<p class="text-primary font-bold text-xl">{name}</p>
Expand All @@ -30,7 +58,7 @@ const image = images[imagePath]();
{leadershipData.major && <p>{leadershipData.major}</p>}
</div>

{!noSocials && <Socials {...getLeadershipData(name)} />}
{!noSocials && <Socials {...getStaffRecord(name)} />}
</div>
</div>
</div>
4 changes: 2 additions & 2 deletions src/components/widgets/SubteamInfo.astro
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import Socials from "./Socials.astro";
import Image from "../common/Image.astro";
import { type TeamMember } from "~/types";
import { type ImageProps } from "~/utils/images-optimization";
import getLeadershipData from "~/leadershipData";
import getStaffRecord from "~/staffData";
export interface Props {
title: string;
Expand All @@ -26,7 +26,7 @@ const { title, leads = [], images = [] } = Astro.props;
leads.map((name) => (
<div>
{name}
<Socials {...getLeadershipData(name)} />
<Socials {...getStaffRecord(name)} />
</div>
))
}
Expand Down
4 changes: 2 additions & 2 deletions src/components/widgets/TeamOverviewLeader.astro
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
import getLeadershipData from "~/leadershipData";
import getStaffRecord from "~/staffData";
import Socials from "./Socials.astro";
export interface Props {
Expand All @@ -17,7 +17,7 @@ const { title, people = [] } = Astro.props;
people.map((name) => (
<div class="flex flex-col items-end">
{name}
<Socials classes={["flex-col items-end justify-end"]} {...getLeadershipData(name)}/>
<Socials classes={["flex-col items-end justify-end"]} {...getStaffRecord(name)}/>
</div>
))
}
Expand Down
Loading

0 comments on commit 887a41d

Please sign in to comment.