From aab9bd13d684c6ac8061693406d4820dd459a49a Mon Sep 17 00:00:00 2001 From: David Christiansen Date: Thu, 23 Feb 2023 22:09:48 +0100 Subject: [PATCH] Prominently display board election on homepage Enable the display of the latest news item on the front page, together with podcast episodes and open positions. Add a news item that encourages applications for the open board seats. --- news/2023-02-23/board-vacancies.markdown | 8 ++++++++ site.hs | 12 +++++++++++- templates/homepage.html | 6 ++++++ templates/news/frontpage.html | 14 ++++++++++++++ 4 files changed, 39 insertions(+), 1 deletion(-) create mode 100644 news/2023-02-23/board-vacancies.markdown create mode 100644 templates/news/frontpage.html diff --git a/news/2023-02-23/board-vacancies.markdown b/news/2023-02-23/board-vacancies.markdown new file mode 100644 index 00000000..02ca232b --- /dev/null +++ b/news/2023-02-23/board-vacancies.markdown @@ -0,0 +1,8 @@ +--- +title: Board Vacancies +link: https://discourse.haskell.org/t/2023-call-for-nominations-for-the-haskell-foundation/5803 +--- + +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. + +Nominations are due by March 1, 2023. diff --git a/site.hs b/site.hs index ce062f99..cb104729 100644 --- a/site.hs +++ b/site.hs @@ -1,6 +1,7 @@ {-# Language ScopedTypeVariables #-} {-# Language OverloadedStrings #-} {-# Language ViewPatterns #-} +{-# Language TypeApplications #-} import Hakyll import Data.List (sortOn) @@ -213,10 +214,13 @@ main = hakyll $ do compile $ do sponsors <- buildBoilerplateCtx (Just "Haskell Foundation") podcastsCtx <- podcastCtx . take 1 . reverse . sortOn podcastOrd <$> loadAll ("podcast/*/index.markdown" .&&. hasVersion "raw") + careers <- loadAll @String "careers/*.markdown" careersCtx <- careersCtx . reverse <$> loadAll "careers/*.markdown" + announces <- take 1 <$> (recentFirst =<< loadAll @String "news/*/**.markdown") + let announceCtx = announcementsCtx announces makeItem "" - >>= loadAndApplyTemplate "templates/homepage.html" (podcastsCtx <> careersCtx) + >>= loadAndApplyTemplate "templates/homepage.html" (podcastsCtx <> careersCtx <> announceCtx) >>= loadAndApplyTemplate "templates/boilerplate.html" sponsors >>= relativizeUrls @@ -401,6 +405,12 @@ hiringSponsorsCtx sponsors = listField "hiringsponsors" defaultContext (filterMetadataField "careersUrl" sponsors) <> defaultContext +-- Anouncements + +announcementsCtx :: [Item String] -> Context String +announcementsCtx ads = + listField "announcements" defaultContext (pure ads) + -------------------------------------------------------------------------------------------------------- -- UTILS ----------------------------------------------------------------------------------------------- -------------------------------------------------------------------------------------------------------- diff --git a/templates/homepage.html b/templates/homepage.html index 6e72f9f9..459d316e 100644 --- a/templates/homepage.html +++ b/templates/homepage.html @@ -23,6 +23,12 @@

Amplify Haskell’s impact on humanity.
diff --git a/templates/news/frontpage.html b/templates/news/frontpage.html new file mode 100644 index 00000000..91ce6710 --- /dev/null +++ b/templates/news/frontpage.html @@ -0,0 +1,14 @@ +
+
+
+

$title$

+

$body$

+ + $if(link)$ + + $endif$ +
+
+