Changeset 1162 for lang/haskell/blosxkel

Show
Ignore:
Timestamp:
11/06/07 02:06:38 (6 years ago)
Author:
jknaoya
Message:

lang/haskell/blosxkel/story.html,
lang/haskell/blosxkel/blosxkel.hs:

すこしシンプルにしました

Location:
lang/haskell/blosxkel
Files:
2 modified

Legend:

Unmodified
Added
Removed
  • lang/haskell/blosxkel/blosxkel.hs

    r1161 r1162  
    9191    } 
    9292 
     93strftime = formatCalendarTime defaultTimeLocale 
     94strfctime format ct = strftime format (toUTCTime ct) 
    9395 
    9496filterByPathInfo :: String -> [Entry] -> [Entry] 
    9597filterByPathInfo pathinfo entries 
    9698    | length spath == 2 && 
    97       all isDigit (spath !! 1) = filter (\e -> (formatCalendarTime defaultTimeLocale "/%Y" (toUTCTime (time e))) == joinPath spath) entries 
     99      all isDigit (spath !! 1) = filter (\e -> (strfctime "/%Y"       (time e)) == joinPath spath) entries 
    98100    | length spath == 3 && 
    99       all isDigit (spath !! 1) = filter (\e -> (formatCalendarTime defaultTimeLocale "/%Y/%m" (toUTCTime (time e))) == joinPath spath) entries 
     101      all isDigit (spath !! 1) = filter (\e -> (strfctime "/%Y/%m"    (time e)) == joinPath spath) entries 
    100102    | length spath == 4 && 
    101       all isDigit (spath !! 1) = filter (\e -> (formatCalendarTime defaultTimeLocale "/%Y/%m/%d" (toUTCTime (time e))) == joinPath spath) entries 
     103      all isDigit (spath !! 1) = filter (\e -> (strfctime "/%Y/%m/%d" (time e)) == joinPath spath) entries 
    102104    | otherwise                = filter (\e -> isPrefixOf (joinPath spath) (path e)) entries 
    103105    where 
     
    114116               [("title"  , title e), 
    115117                ("body"   , concat (body e)), 
    116                 ("time"   , formatCalendarTime defaultTimeLocale "%Y-%m-%d %H:%M:%S" (toUTCTime (time e))), 
    117                 ("yr"     , formatCalendarTime defaultTimeLocale "%Y" (toUTCTime (time e))), 
    118                 ("mo"     , formatCalendarTime defaultTimeLocale "%b" (toUTCTime (time e))), 
    119                 ("mo_num" , formatCalendarTime defaultTimeLocale "%m" (toUTCTime (time e))), 
    120                 ("da"     , formatCalendarTime defaultTimeLocale "%d" (toUTCTime (time e))), 
    121                 ("dw"     , formatCalendarTime defaultTimeLocale "%a" (toUTCTime (time e))), 
    122                 ("hr"     , formatCalendarTime defaultTimeLocale "%H" (toUTCTime (time e))), 
    123                 ("min"    , formatCalendarTime defaultTimeLocale "%M" (toUTCTime (time e))), 
    124                 ("hr12"   , formatCalendarTime defaultTimeLocale "%I" (toUTCTime (time e))), 
    125                 ("ampm"   , formatCalendarTime defaultTimeLocale "%p" (toUTCTime (time e))), 
    126                 ("ti"     , formatCalendarTime defaultTimeLocale "%X" (toUTCTime (time e))), 
     118                ("time"   , strfctime "%Y-%m-%d %H:%M:%S" (time e)), 
     119                ("yr"     , strfctime "%Y"  (time e)), 
     120                ("mo"     , strfctime "%b"  (time e)), 
     121                ("mo_num" , strfctime "%m"  (time e)), 
     122                ("da"     , strfctime "%d"  (time e)), 
     123                ("dw"     , strfctime "%a"  (time e)), 
     124                ("hr"     , strfctime "%H"  (time e)), 
     125                ("min"    , strfctime "%M"  (time e)), 
     126                ("hr12"   , strfctime "%I"  (time e)), 
     127                ("ampm"   , strfctime "%p"  (time e)), 
     128                ("ti"     , strfctime "%X"  (time e)), 
    127129                ("fn"     , path e), 
    128130                ("path"   , path e)]) 
  • lang/haskell/blosxkel/story.html

    r1160 r1162  
    11<div class="hentry"> 
    2     <h3 title="entry-title">$title</h3> 
     2    <h3 title="entry-title"><a href="$home$path" rel="bookmark">$title</a></h3> 
    33    <div class="entry-content"> 
    44        $body