module WWW.Base ( baseConfig , baseHakyll , domain , wwwRoot ) where import Prolog import Hakyll import System.Process hakyllVersion :: IsString s => s hakyllVersion = "Hakyll 4.16.2.2" -- | mathematicaster.org domain :: IsString s => s domain = "mathematicaster.org" -- | /var/www wwwRoot :: IsString s => s wwwRoot = "/var/www" baseConfig :: FilePath -> Configuration baseConfig p = defaultConfiguration { destinationDirectory = "output" , storeDirectory = ".cache" , tmpDirectory = ".cache/tmp" , deploySite = \cfg -> rawSystem "rsync" [ "-aP" , "--delete-after" , "--chown=nginx:nginx" , destinationDirectory cfg <> "/" , "root@" <> domain <> ":" <> wwwRoot <> "/" <> p ] } baseHakyll :: MonadIO m => FilePath -> Rules a -> m () baseHakyll p = liftIO . hakyllWith (baseConfig p)