diff options
author | Gabriel Aumala <gabrielfima@live.com> | 2018-09-30 14:38:57 -0500 |
---|---|---|
committer | Jasper Van der Jeugt <jaspervdj@gmail.com> | 2018-10-02 11:05:52 -0400 |
commit | c85198d8cb6ce055c788e287c7f2470eac0aad36 (patch) | |
tree | 082fdd0e820e33ee66f8936206467a9151eaa885 /lib/Hakyll/Web | |
parent | da52a2aabfdbc83693574b192ed75c252d12b972 (diff) | |
download | hakyll-c85198d8cb6ce055c788e287c7f2470eac0aad36.tar.gz |
Drop extension when parsing dates in filepaths
Drop the file extension when parsing the date from the filepath of a
resource.
Diffstat (limited to 'lib/Hakyll/Web')
-rw-r--r-- | lib/Hakyll/Web/Template/Context.hs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/Hakyll/Web/Template/Context.hs b/lib/Hakyll/Web/Template/Context.hs index dae241c..0d71386 100644 --- a/lib/Hakyll/Web/Template/Context.hs +++ b/lib/Hakyll/Web/Template/Context.hs @@ -50,7 +50,7 @@ import Hakyll.Core.Metadata import Hakyll.Core.Provider import Hakyll.Core.Util.String (needlePrefix, splitAll) import Hakyll.Web.Html -import System.FilePath (splitDirectories, takeBaseName) +import System.FilePath (splitDirectories, takeBaseName, dropExtension) -------------------------------------------------------------------------------- @@ -300,7 +300,7 @@ getItemUTC :: MonadMetadata m getItemUTC locale id' = do metadata <- getMetadata id' let tryField k fmt = lookupString k metadata >>= parseTime' fmt - paths = splitDirectories $ toFilePath id' + paths = splitDirectories $ (dropExtension . toFilePath) id' maybe empty' return $ msum $ [tryField "published" fmt | fmt <- formats] ++ |