From 4123d458c8f8bbcb37cf581c80b958691d2f3949 Mon Sep 17 00:00:00 2001 From: Simon Michael Date: Sun, 20 Oct 2013 12:36:46 -0700 Subject: [PATCH] site: copy instead of symlinking source files so hakyll preview works --- site/site.hs | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/site/site.hs b/site/site.hs index e25c8d8f9..b63d0853c 100755 --- a/site/site.hs +++ b/site/site.hs @@ -12,7 +12,10 @@ import Text.Pandoc.Options import Text.Printf main = do + -- preview doesn't detect changes in symlinked files symlinkPagesFromParentDir + -- copyPagesFromParentDir + symlinkProfsDir hakyll $ do match ("images/*" .||. "js/**" .||. "robots.txt") $ do @@ -42,8 +45,12 @@ main = do >>= relativizeUrls symlinkPagesFromParentDir = do + filter (".md" `isSuffixOf`) `fmap` getDirectoryContents ".." + >>= mapM_ (\f -> system $ printf "[ -f %s ] || ln -s ../%s" f f) + +copyPagesFromParentDir = do fs <- filter (".md" `isSuffixOf`) `fmap` getDirectoryContents ".." - forM_ fs $ \f -> system $ printf "[ -f %s ] || ln -s ../%s" f f + forM_ fs $ \f -> system $ printf "cp ../%s ." f symlinkProfsDir = ensureSiteDir >> system "ln -sf ../../profs _site/profs"