]> gitweb @ CieloNegro.org - Rakka.git/commitdiff
Added suffixes to each page files
authorpho <pho@cielonegro.org>
Wed, 14 Nov 2007 03:59:22 +0000 (12:59 +0900)
committerpho <pho@cielonegro.org>
Wed, 14 Nov 2007 03:59:22 +0000 (12:59 +0900)
darcs-hash:20071114035922-62b54-f66a5ab9f916c74eb329ec97c93252464a3d9d36.gz

Rakka.cabal
Rakka/Storage/DefaultPage.hs
Rakka/Storage/Repos.hs
defaultPages/Help/SampleImage/Large.xml [moved from defaultPages/Help/SampleImage/Large with 100% similarity]
defaultPages/Help/SampleImage/Small.xml [moved from defaultPages/Help/SampleImage/Small with 100% similarity]
defaultPages/Help/Syntax.xml [moved from defaultPages/Help/Syntax with 100% similarity]
defaultPages/MainPage.xml [moved from defaultPages/MainPage with 100% similarity]
defaultPages/PageTitle.xml [moved from defaultPages/PageTitle with 100% similarity]
defaultPages/SideBar/Left.xml [moved from defaultPages/SideBar/Left with 100% similarity]
defaultPages/SideBar/Right.xml [moved from defaultPages/SideBar/Right with 100% similarity]
defaultPages/StyleSheet/Default.xml [moved from defaultPages/StyleSheet/Default with 100% similarity]

index d54dfd837f660e564b0428af714af312003237c5..1551208aaaede96ec9c74d386f20fff2e4c6c29d 100644 (file)
@@ -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:
index 8e79a6dbc9470062677d8a2a1a64e2d8e9aa930c..de1e3a1321029aa3dcd19b7a72dd373f53651068 100644 (file)
@@ -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 を探す。無けれ
-    -- ã\81° Cabal ã\81§ defaultPages/Foo を探す。
-    = do let pagePath = "defaultPages" </> encodePageName name
+    -- ./defaultPages が存在するなら、./defaultPages/Foo.xml を探す。無
+    -- ã\81\91ã\82\8cã\81° Cabal ã\81§ defaultPages/Foo.xml を探す。
+    = do let pagePath = "defaultPages" </> (encodePageName name `addExtension` "xml")
 
          localDirExists <- doesLocalDirExist
          if localDirExists then
index 3b7fe542804fe5b0dd9c74d82fcfd786075986d3..d42fdb90bd3c46ac28bc0aeee9989c528e36fe0b 100644 (file)
@@ -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"