Skip to content

Commit dfeed01

Browse files
authored
Merge pull request #248 from haskellfoundation/board-election-news
Prominently display board election on homepage
2 parents fa1e9f1 + aab9bd1 commit dfeed01

File tree

4 files changed

+39
-1
lines changed

4 files changed

+39
-1
lines changed
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
---
2+
title: Board Vacancies
3+
link: https://discourse.haskell.org/t/2023-call-for-nominations-for-the-haskell-foundation/5803
4+
---
5+
6+
The Haskell Foundation [is seeking four new members for the board](https://discourse.haskell.org/t/2023-call-for-nominations-for-the-haskell-foundation/5803). The Board provides the strategic leadership for the Foundation, and is the final decision-making body for everything the Foundation does. More specifically, it ensures that the Foundation is working toward achieving its mission, and it appoints and supervises senior members of Foundation staff.
7+
8+
Nominations are due by March 1, 2023.

site.hs

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
{-# Language ScopedTypeVariables #-}
22
{-# Language OverloadedStrings #-}
33
{-# Language ViewPatterns #-}
4+
{-# Language TypeApplications #-}
45

56
import Hakyll
67
import Data.List (sortOn)
@@ -213,10 +214,13 @@ main = hakyll $ do
213214
compile $ do
214215
sponsors <- buildBoilerplateCtx (Just "Haskell Foundation")
215216
podcastsCtx <- podcastCtx . take 1 . reverse . sortOn podcastOrd <$> loadAll ("podcast/*/index.markdown" .&&. hasVersion "raw")
217+
careers <- loadAll @String "careers/*.markdown"
216218
careersCtx <- careersCtx . reverse <$> loadAll "careers/*.markdown"
219+
announces <- take 1 <$> (recentFirst =<< loadAll @String "news/*/**.markdown")
220+
let announceCtx = announcementsCtx announces
217221

218222
makeItem ""
219-
>>= loadAndApplyTemplate "templates/homepage.html" (podcastsCtx <> careersCtx)
223+
>>= loadAndApplyTemplate "templates/homepage.html" (podcastsCtx <> careersCtx <> announceCtx)
220224
>>= loadAndApplyTemplate "templates/boilerplate.html" sponsors
221225
>>= relativizeUrls
222226

@@ -401,6 +405,12 @@ hiringSponsorsCtx sponsors =
401405
listField "hiringsponsors" defaultContext (filterMetadataField "careersUrl" sponsors) <>
402406
defaultContext
403407

408+
-- Anouncements
409+
410+
announcementsCtx :: [Item String] -> Context String
411+
announcementsCtx ads =
412+
listField "announcements" defaultContext (pure ads)
413+
404414
--------------------------------------------------------------------------------------------------------
405415
-- UTILS -----------------------------------------------------------------------------------------------
406416
--------------------------------------------------------------------------------------------------------

templates/homepage.html

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,12 @@ <h3 class="mb-4 text-xl text-gray-500">Amplify Haskell’s impact on humanity.</
2323
$endfor$
2424
$endif$
2525

26+
$if(announcements)$
27+
$for(announcements)$
28+
$partial("templates/news/frontpage.html")$
29+
$endfor$
30+
$endif$
31+
2632
$for(episodes)$
2733
<div class="bg-white border border-gray-300 rounded py-8 px-6 sm:px-12 text-center">
2834
<div class="bg-gray-100 px-6 sm:px-12 lg:px-16 py-6 lg:py-24">

templates/news/frontpage.html

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
<div class="bg-white border border-gray-300 rounded py-8 px-6 sm:px-12 text-center">
2+
<div class="bg-gray-100 px-6 sm:px-12 lg:px-16 py-6 lg:py-24">
3+
<div class="space-y-4">
4+
<h2 class="text-center text-2xl-4xl font-normal">$title$</h2>
5+
<p>$body$</p>
6+
7+
$if(link)$
8+
<div class="mt-4">
9+
<a class="arrow-link" href="$link$">&gt;&gt; Read more</a>
10+
</div>
11+
$endif$
12+
</div>
13+
</div>
14+
</div>

0 commit comments

Comments
 (0)