Dear hakyll group
I am running into a little bit of a problem, and I would like to ask
use your collective wisdom.
I want to use a latex bibliography file to generate a list of my
publications. I can parse the file, turn each publication into
a Context, and then apply some templates to generate the code.
Roughly this looks like so:
```
bibRule :: Bib -> Rules ()
bibRule b@(Bib ty name its) =
create [fromFilePath $ "pubs/" <> name <> ".html"] $ do
route idRoute
compile $ do
makeItem "" >>= loadAndApplyTemplate "templates/pub.html" (bibToContext b)
```
and then in the main I just do:
```
forM_ bibs bibRule
```
This works fine, except when I run `./site watch` it does not pickup
changes in the bib file (any ideas how to fix this?).
However, a more annoying problem is that when I am creating a list
of publications, I want to create a context that roughly looks like
this:
```
[
"pub1": [("key","val"),("key1", "val1")],
"pub2": [("key","val"),("key1", "val1")],
...
]
```
so that I could feed it into `$for` template. The problem is that
lists in contexts internally store a list of `Item`-s, and so then
each item is looked-up, and the actual matching happens. But I don't
have an `Item` for the publication, as it is not coming from a file.
It doesn't have a filepath, as it is purely virtual.
Is there a way to pre-generate a constant list that I could feed into
the `$for` template without creating actual files on the filesystem?
You can find the code that I have so far here:
https://gitlab.sac-home.org/tema/artem-blogCheers,
Artem