From 58ffb1215e4da801743812018998670d72159998 Mon Sep 17 00:00:00 2001 From: Kevin Matsubara Date: Sat, 20 Dec 2025 15:16:54 +0100 Subject: [PATCH] Add more events. --- portfolio/events/2025-10-18-smc.md | 2 +- portfolio/events/2026-04-17-animecon.md | 10 ++++++++++ portfolio/events/2026-05-31-scaleworld.md | 8 ++++++++ portfolio/events/2026-10-17-smc.md | 13 +++++++++++++ portfolio/events/2026-10-22-spiel.md | 10 ++++++++++ portfolio/portfolio.cabal | 1 + portfolio/site.hs | 22 +++++++++++++++++++++- 7 files changed, 64 insertions(+), 2 deletions(-) create mode 100644 portfolio/events/2026-04-17-animecon.md create mode 100644 portfolio/events/2026-05-31-scaleworld.md create mode 100644 portfolio/events/2026-10-17-smc.md create mode 100644 portfolio/events/2026-10-22-spiel.md diff --git a/portfolio/events/2025-10-18-smc.md b/portfolio/events/2025-10-18-smc.md index 5798c32..caf7544 100644 --- a/portfolio/events/2025-10-18-smc.md +++ b/portfolio/events/2025-10-18-smc.md @@ -5,6 +5,6 @@ date: 2025-10-18 logosub: Congoer --- -I have been to the Scale Model Challenge, this being my second time now. +I have been to the [Scale Model Challenge](https://www.scalemodelchallenge.com/), this being my second time now. And I participated with a Gundam, but did not win any prize with it. Still, it was fun to add my Gundam figure to the competition. Next time I will have to do a better job! \ No newline at end of file diff --git a/portfolio/events/2026-04-17-animecon.md b/portfolio/events/2026-04-17-animecon.md new file mode 100644 index 0000000..b80ad48 --- /dev/null +++ b/portfolio/events/2026-04-17-animecon.md @@ -0,0 +1,10 @@ +--- +title: Animecon 2026 +author: Kevin Matsubara +date: 2026-04-17 +logosub: Congoer +--- + +I will be at [Animecon 2026](https://animecon.nl/) for all three days in Rijswijk, the Netherlands. + +There I will be part of the SIG Plamo group, where we will show everyone about the Plamo hobby. \ No newline at end of file diff --git a/portfolio/events/2026-05-31-scaleworld.md b/portfolio/events/2026-05-31-scaleworld.md new file mode 100644 index 0000000..3025819 --- /dev/null +++ b/portfolio/events/2026-05-31-scaleworld.md @@ -0,0 +1,8 @@ +--- +title: ScaleWorld 2026 +author: Kevin Matsubara +date: 2026-05-31 +logosub: Congoer +--- + +I will visit [ScaleWorld 2026](https://kmk-scaleworld.be/scaleworld-2026/) for the first time in Geel, Belgium. \ No newline at end of file diff --git a/portfolio/events/2026-10-17-smc.md b/portfolio/events/2026-10-17-smc.md new file mode 100644 index 0000000..6c22de2 --- /dev/null +++ b/portfolio/events/2026-10-17-smc.md @@ -0,0 +1,13 @@ +--- +title: SMC 2026 - Scale Model Challenge +author: Kevin Matsubara +date: 2026-10-17 +logosub: Congoer +--- + +I will be visiting the [Scale Model Challenge 2026](https://www.scalemodelchallenge.com/) in Veldhoven, the Netherlands. Both the 17th and 18th of October. + +So far, this is my list of models to bring to the contest: + +- Sopwith Camel, 1/72 by Eduard. +- Raccoon Maschinen Krieger, 1/20 by Wave Corporation. \ No newline at end of file diff --git a/portfolio/events/2026-10-22-spiel.md b/portfolio/events/2026-10-22-spiel.md new file mode 100644 index 0000000..6a32fe4 --- /dev/null +++ b/portfolio/events/2026-10-22-spiel.md @@ -0,0 +1,10 @@ +--- +title: Spiel 2026 +author: Kevin Matsubara +date: 2026-10-22 +logosub: Congoer +--- + +I plan to visit [Spiel](https://www.spiel-essen.de/en/) in Essen, Germany. + +I have not yet decided which days. \ No newline at end of file diff --git a/portfolio/portfolio.cabal b/portfolio/portfolio.cabal index 2c84f1f..c8007c0 100644 --- a/portfolio/portfolio.cabal +++ b/portfolio/portfolio.cabal @@ -7,5 +7,6 @@ executable site main-is: site.hs build-depends: base == 4.* , hakyll == 4.16.* + , time == 1.12.2 ghc-options: -threaded -rtsopts -with-rtsopts=-N default-language: Haskell2010 diff --git a/portfolio/site.hs b/portfolio/site.hs index 9e8a791..92a742a 100644 --- a/portfolio/site.hs +++ b/portfolio/site.hs @@ -1,6 +1,9 @@ -------------------------------------------------------------------------------- {-# LANGUAGE OverloadedStrings #-} +import Control.Monad (filterM) +import Data.Maybe (fromMaybe) import Data.Monoid (mappend) +import Data.Time import Hakyll @@ -79,7 +82,14 @@ main = hakyll $ do route idRoute compile $ do posts <- recentFirst =<< loadAll "posts/*" - events <- recentFirst =<< loadAll "events/*" + + now <- unsafeCompiler getCurrentTime + let cutoff = addUTCTime (7 * 24 * 60 * 60) now + + events <- + loadAll "events/*" + >>= filterM (isUpcoming cutoff) + >>= chronological let indexCtx = -- (<> is the modern version of `mappend`.) @@ -100,3 +110,13 @@ postCtx :: Context String postCtx = dateField "date" "%e %B %Y" `mappend` defaultContext + +isUpcoming :: UTCTime -> Item a -> Compiler Bool +isUpcoming cutoff item = do + metadata <- getMetadata (itemIdentifier item) + case lookupString "date" metadata of + Nothing -> return False + Just ds -> + case parseTimeM True defaultTimeLocale "%Y-%m-%d" ds of + Nothing -> return False + Just date -> return (date >= cutoff)