Actually do relative paths right
Getty Ritter
7 years ago
16 | 16 | import qualified System.Directory as Dir |
17 | 17 | import qualified System.Environment as Env |
18 | 18 | import qualified System.Exit as Exit |
19 |
import System.FilePath ((</>) |
|
19 | import System.FilePath ((</>), makeRelative) | |
20 | 20 | import qualified Text.Pandoc as Pandoc |
21 | 21 | |
22 | 22 | data FrontitOpts = FrontitOpts |
79 | 79 | |
80 | 80 | fetchPage :: FrontitConf -> FilePath -> IO Result |
81 | 81 | fetchPage conf path = do |
82 |
let localPath = fcData conf </> |
|
82 | let localPath = fcData conf </> (makeRelative "/" path) | |
83 | 83 | exists <- Dir.doesFileExist localPath |
84 | 84 | if not exists |
85 | 85 | then return NotFound |