1
0

Add more events.

This commit is contained in:
Kevin Matsubara 2025-12-20 15:16:54 +01:00
parent 4966f9a134
commit 58ffb1215e
7 changed files with 64 additions and 2 deletions

View File

@ -5,6 +5,6 @@ date: 2025-10-18
logosub: Congoer 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! 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!

View File

@ -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.

View File

@ -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.

View File

@ -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.

View File

@ -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.

View File

@ -7,5 +7,6 @@ executable site
main-is: site.hs main-is: site.hs
build-depends: base == 4.* build-depends: base == 4.*
, hakyll == 4.16.* , hakyll == 4.16.*
, time == 1.12.2
ghc-options: -threaded -rtsopts -with-rtsopts=-N ghc-options: -threaded -rtsopts -with-rtsopts=-N
default-language: Haskell2010 default-language: Haskell2010

View File

@ -1,6 +1,9 @@
-------------------------------------------------------------------------------- --------------------------------------------------------------------------------
{-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE OverloadedStrings #-}
import Control.Monad (filterM)
import Data.Maybe (fromMaybe)
import Data.Monoid (mappend) import Data.Monoid (mappend)
import Data.Time
import Hakyll import Hakyll
@ -79,7 +82,14 @@ main = hakyll $ do
route idRoute route idRoute
compile $ do compile $ do
posts <- recentFirst =<< loadAll "posts/*" 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 = let indexCtx =
-- (<> is the modern version of `mappend`.) -- (<> is the modern version of `mappend`.)
@ -100,3 +110,13 @@ postCtx :: Context String
postCtx = postCtx =
dateField "date" "%e %B %Y" `mappend` dateField "date" "%e %B %Y" `mappend`
defaultContext 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)