summaryrefslogtreecommitdiff
path: root/lib/Hakyll/Web
diff options
context:
space:
mode:
authorncaq <ncaq@ncaq.net>2018-12-20 00:07:52 +0900
committerJasper Van der Jeugt <jaspervdj@gmail.com>2019-05-09 11:19:46 +0200
commit5ac95e9b9b62baf417a69557f40078af1a5ad92a (patch)
treec870967abbc2e0b563793628586a3600651103ec /lib/Hakyll/Web
parent7783ec77e0e42ef849aaf013c9e568a1b47c33eb (diff)
downloadhakyll-5ac95e9b9b62baf417a69557f40078af1a5ad92a.tar.gz
fixed: auto complete `published` overwrites user's context
I like following, has written a context to complement from the file name `published`. [www.ncaq.net/site.hs at d8b7eb3426eae36ee0ea5788f32306b9ffa6f9f2 ยท ncaq/www.ncaq.net](https://github.com/ncaq/www.ncaq.net/blob/d8b7eb3426eae36ee0ea5788f32306b9ffa6f9f2/site.hs#L120) Looking at feed today, I noticed that time is not reflected in `published`. This is because `getItemUTC` overwrites my `published`. Adding a format to `getItemUTC` was not a solution because I live with JST. Also, it is not realistic to write `published` in the yaml metadata of all files, and I think that you want to be delivered as JST as much as possible. Since `updated` does not overwrite the context, I tried to rewrite so that `published` does not overwrite the context. I have confirmed in the local environment that all things work well, is this the intended overwrite? If not, I think it is natural to prioritize the user's context.
Diffstat (limited to 'lib/Hakyll/Web')
-rw-r--r--lib/Hakyll/Web/Feed.hs2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/Hakyll/Web/Feed.hs b/lib/Hakyll/Web/Feed.hs
index 531d653..6f6d699 100644
--- a/lib/Hakyll/Web/Feed.hs
+++ b/lib/Hakyll/Web/Feed.hs
@@ -177,4 +177,4 @@ renderAtom = renderAtomWithTemplates atomTemplate atomItemTemplate
-- | Copies @$updated$@ from @$published$@ if it is not already set.
makeItemContext :: String -> Context a -> Context a
makeItemContext fmt context = mconcat
- [dateField "published" fmt, context, dateField "updated" fmt]
+ [context, dateField "published" fmt, dateField "updated" fmt]