fallbackRender :: Environment -> [String] -> IO (Maybe ResourceDef)
fallbackRender env path
- | null path = return Nothing
- | null $ head path = return Nothing
- | not $ isUpper $ head $ head path = return Nothing -- /Foo/bar のような形式でない。
+ | null path = return Nothing
+ | null $ head path = return Nothing
+ | isLower $ head $ head path = return Nothing -- 先頭の文字が小文字であってはならない
| otherwise
= return $ Just $ ResourceDef {
resUsesNativeThread = False
handleGet :: Environment -> PageName -> Resource ()
handleGet env name
= runIdempotentA $ proc ()
- -> do pageM <- getPageA (envStorage env) -< name
+ -> do pageM <- getPageA (envStorage env) -< (name, Nothing)
case pageM of
Nothing
-> handlePageNotFound env -< name
{-
<page site="CieloNegro"
- styleSheet="http://example.org/object/StyleSheet/Default"
name="Foo/Bar"
type="text/x-rakka"
lang="ja" -- 存在しない場合もある
revision="112"> -- デフォルトでない場合のみ存在
lastModified="2000-01-01T00:00:00">
+ <styleSheets>
+ <styleSheet src="http://example.org/object/StyleSheet/Default" />
+ </styleSheets>
+
+ <scripts>
+ <script src="http://example.org/js" />
+ </scripts>
+
<summary>
blah blah...
</summary> -- 存在しない場合もある
+= txt " - "
+= getXPathTreesInDoc "/page/@name/text()"
)
- += ( eelem "link"
+ += ( getXPathTreesInDoc "/page/styleSheets/styleSheet"
+ >>>
+ eelem "link"
+= sattr "rel" "stylesheet"
+= sattr "type" "text/css"
+= attr "href"
- ( getXPathTreesInDoc "/page/@styleSheet/text()" )
+ ( getXPathTrees "/styleSheet/@src/text()" )
+ )
+ += ( getXPathTreesInDoc "/page/scripts/script"
+ >>>
+ eelem "script"
+ += sattr "type" "text/javascript"
+ += attr "src"
+ ( getXPathTrees "/script/@src/text()" )
)
)
+= ( eelem "body"