@@ -10,6 +10,7 @@ import SingleColumn from "../components/SingleColumn";
1010import BackgroundImage from "../components/BackgroundImage";
1111import TabCarousel from "../components/TabCarousel";
1212import Section from "../components/Section";
13+import PostPreview from "../components/PostPreview";
1314import GrantPreview from "../components/GrantPreview";
1415import {
1516 getAllPosts,
@@ -67,6 +68,7 @@ export default function Grants({
6768 types,
6869 featuredGrants,
6970 search,
71+ gifts,
7072}) {
7173 const [activeTags, setTags] = useState([]);
7274 const [activeTypes, setTypes] = useState(types);
@@ -177,11 +179,37 @@ export default function Grants({
177179 // Gift Grants
178180 }
179181 <Section wide>
180− <div className="measure pb-16">
182+ <div className="pb-16">
181183 <h2 className="pb-16">Gifts</h2>
182184 <p className="mb-8">
183− Gifts are given post facto for exceptional contributions.
185+ Gifts are given post-facto for exceptional contributions.
184186 </p>
187+ <div className="flex flex-wrap">
188+ <PostPreview
189+ post={gifts[0]}
190+ className={`w-full md:w-1/2 pr-0 pb-8 md:pr-4`}
191+ key={gifts[0].slug}
192+ section={gifts[0].section}
193+ />
194+ <PostPreview
195+ post={gifts[1]}
196+ className={`w-full md:w-1/2 pl-0 pb-8 md:pl-4`}
197+ key={gifts[1].slug}
198+ section={gifts[1].section}
199+ />
200+ <PostPreview
201+ post={gifts[2]}
202+ className={`w-full md:w-1/2 pr-0 pb-8 md:pr-4`}
203+ key={gifts[2].slug}
204+ section={gifts[2].section}
205+ />
206+ <PostPreview
207+ post={gifts[3]}
208+ className={`w-full md:w-1/2 pl-0 pb-8 md:pl-4`}
209+ key={gifts[3].slug}
210+ section={gifts[3].section}
211+ />
212+ </div>
185213 </div>
186214 </Section>
187215 {
@@ -291,6 +319,20 @@ export async function getStaticProps() {
291319 ["title", "slug", "date", "description", "extra", "taxonomies"],
292320 "grants"
293321 );
322+ let gifts = getAllPosts(
323+ ["title", "slug", "date", "description", "extra", "taxonomies"],
324+ "blog"
325+ );
326+ gifts.map((e) => (e.section = "blog"));
327+ let updates = getAllPosts(
328+ ["title", "slug", "date", "description", "extra", "taxonomies"],
329+ "updates"
330+ );
331+ updates.map((e) => (e.section = "updates"));
332+ gifts.push(...updates);
333+ gifts = gifts
334+ .filter((e) => e?.taxonomies?.grant_type?.includes("Gift"))
335+ .sort((a, b) => (a.date > b.date ? -1 : 1));
294336
295337 // The layout expects exactly 3
296338 const featuredGrants = [
@@ -302,6 +344,6 @@ export async function getStaticProps() {
302344 );
303345
304346 return {
305− props: { posts: posts, categories, types, featuredGrants },
347+ props: { posts: posts, categories, types, featuredGrants, gifts },
306348 };
307349}