From: pho Date: Wed, 14 Nov 2007 03:59:22 +0000 (+0900) Subject: Added suffixes to each page files X-Git-Url: https://git.cielonegro.org/gitweb.cgi?a=commitdiff_plain;h=02cf9c5f184e1ee977479fa43cadce79f8f93d09;p=Rakka.git Added suffixes to each page files darcs-hash:20071114035922-62b54-f66a5ab9f916c74eb329ec97c93252464a3d9d36.gz --- diff --git a/Rakka.cabal b/Rakka.cabal index d54dfd8..1551208 100644 --- a/Rakka.cabal +++ b/Rakka.cabal @@ -13,14 +13,14 @@ Tested-With: GHC == 6.6.1 Cabal-Version: >= 1.2 Data-Files: - defaultpages/Help/SampleImage/Large - defaultpages/Help/SampleImage/Small - defaultPages/Help/Syntax - defaultPages/MainPage - defaultPages/PageTitle - defaultPages/SideBar/Left - defaultPages/SideBar/Right - defaultPages/StyleSheet/Default + defaultpages/Help/SampleImage/Large.xml + defaultpages/Help/SampleImage/Small.xml + defaultPages/Help/Syntax.xml + defaultPages/MainPage.xml + defaultPages/PageTitle.xml + defaultPages/SideBar/Left.xml + defaultPages/SideBar/Right.xml + defaultPages/StyleSheet/Default.xml schemas/rakka-page-1.0.rng Extra-Source-Files: diff --git a/Rakka/Storage/DefaultPage.hs b/Rakka/Storage/DefaultPage.hs index 8e79a6d..de1e3a1 100644 --- a/Rakka/Storage/DefaultPage.hs +++ b/Rakka/Storage/DefaultPage.hs @@ -49,14 +49,14 @@ findAllDefaultPages findAllIn dirPath = find always (fileType ==? RegularFile) dirPath >>= - return . S.fromList . map (decodePageName . makeRelative dirPath) + return . S.fromList . map (decodePageName . makeRelative dirPath . dropExtension) loadDefaultPage :: PageName -> IO (Maybe Page) loadDefaultPage name - -- ./defaultPages が存在するなら、./defaultPages/Foo を探す。無けれ - -- ば Cabal で defaultPages/Foo を探す。 - = do let pagePath = "defaultPages" encodePageName name + -- ./defaultPages が存在するなら、./defaultPages/Foo.xml を探す。無 + -- ければ Cabal で defaultPages/Foo.xml を探す。 + = do let pagePath = "defaultPages" (encodePageName name `addExtension` "xml") localDirExists <- doesLocalDirExist if localDirExists then diff --git a/Rakka/Storage/Repos.hs b/Rakka/Storage/Repos.hs index 3b7fe54..d42fdb9 100644 --- a/Rakka/Storage/Repos.hs +++ b/Rakka/Storage/Repos.hs @@ -51,7 +51,7 @@ findAllPagesInRevision repos rev DirNode -> traverse path decodePath :: FilePath -> PageName - decodePath = decodePageName . makeRelative root + decodePath = decodePageName . makeRelative root . dropExtension loadPageInRepository :: Repository -> PageName -> Maybe RevNum -> IO (Maybe Page) @@ -69,7 +69,7 @@ loadPageInRepository repos name rev -> return Nothing where path :: FilePath - path = "pages" encodePageName name + path = "pages" (encodePageName name `addExtension` "page") loadPage' :: Rev Page loadPage' = do redirect <- getNodeProp path "rakka:redirect" diff --git a/defaultPages/Help/SampleImage/Large b/defaultPages/Help/SampleImage/Large.xml similarity index 100% rename from defaultPages/Help/SampleImage/Large rename to defaultPages/Help/SampleImage/Large.xml diff --git a/defaultPages/Help/SampleImage/Small b/defaultPages/Help/SampleImage/Small.xml similarity index 100% rename from defaultPages/Help/SampleImage/Small rename to defaultPages/Help/SampleImage/Small.xml diff --git a/defaultPages/Help/Syntax b/defaultPages/Help/Syntax.xml similarity index 100% rename from defaultPages/Help/Syntax rename to defaultPages/Help/Syntax.xml diff --git a/defaultPages/MainPage b/defaultPages/MainPage.xml similarity index 100% rename from defaultPages/MainPage rename to defaultPages/MainPage.xml diff --git a/defaultPages/PageTitle b/defaultPages/PageTitle.xml similarity index 100% rename from defaultPages/PageTitle rename to defaultPages/PageTitle.xml diff --git a/defaultPages/SideBar/Left b/defaultPages/SideBar/Left.xml similarity index 100% rename from defaultPages/SideBar/Left rename to defaultPages/SideBar/Left.xml diff --git a/defaultPages/SideBar/Right b/defaultPages/SideBar/Right.xml similarity index 100% rename from defaultPages/SideBar/Right rename to defaultPages/SideBar/Right.xml diff --git a/defaultPages/StyleSheet/Default b/defaultPages/StyleSheet/Default.xml similarity index 100% rename from defaultPages/StyleSheet/Default rename to defaultPages/StyleSheet/Default.xml