From 999252ece13cd695d65fed9cd01960f5ef3c60ff Mon Sep 17 00:00:00 2001 From: Jorge Israel Peña Date: Thu, 29 Aug 2013 22:43:57 -0700 Subject: add preview port Configuration field Make it possible to specify the default port to listen on when the preview server is run. This is useful if another service on the system already runs on port 8000 (the default), since it's a hassle to keep providing the port overriding option. For example: ./site preview vs. ./site preview -p 4000 --- src/Hakyll/Core/Configuration.hs | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src/Hakyll/Core') diff --git a/src/Hakyll/Core/Configuration.hs b/src/Hakyll/Core/Configuration.hs index a4bc90b..f9927de 100644 --- a/src/Hakyll/Core/Configuration.hs +++ b/src/Hakyll/Core/Configuration.hs @@ -69,6 +69,10 @@ data Configuration = Configuration , -- | Use an in-memory cache for items. This is faster but uses more -- memory. inMemoryCache :: Bool + , -- | Override default port for preview server. Default is 8000. + -- One can also override the port as a command line argument: + -- ./site preview -p 1234 + previewPort :: Int } -------------------------------------------------------------------------------- @@ -87,6 +91,7 @@ defaultConfiguration = Configuration , deployCommand = "echo 'No deploy command specified' && exit 1" , deploySite = system . deployCommand , inMemoryCache = True + , previewPort = 8000 } where ignoreFile' path -- cgit v1.2.3