Closed avocade closed 3 years ago
The only thing passed to html-head
is {:to-format :html}
, so I'm guessing this is hard-coded somewhere, rather than merged in with options provided from build!
. I'm unable to make sense of where, though.
So it seems like html-head
is not used in the output at all, but rather it is the index.html
in resources
that's used?
Hi @avocade and @eneroth. Thanks for posting.
It looks like these options weren't getting passed through the call to export!
in build-and-view-file!
(which build!
calls out to). This has been fixed in a the 0.0.1-alpha2
release.
However, please note that style changes will not be reflected in the live view (unfortunately; see #5). As you suggest @eneroth, this is because the index.html
is what is served for the live view. However, for the sake of clarity, this is not at all involved in the statically compiled output. Happy to accept a PR on this if anyone feels like sorting out a good way of handling that.
Thanks again for bringing this to my attention!
Great re: the options! Thanks, will try out the new version.
Yeah, I ran into this issue as well with the index.html
in toto being only used for live views and the code for the rendered files… That's extremely frustrating since we of course need to have a consistent view of what we're building. We'll see if we can come up with a solution for that. Maybe rendering the toto index.html
file from hiccup and spitting it out to public/
on startup, using the same code as html-head
?
Thanks for the follow up.
That's an interesting idea, and something like that may work. I'll consider this further. It may be hard though since different pages could have different header content. But maybe there could be a way to customize the top level index.html
with styles etc shared between pages. Won't cover testing that meta data like titles are coming through properly, but is maybe a good start.
For right now, you can try just including your styles inline in your hiccup templates, since those would override whatever global styles are in use if scoped properly. These should then work the same everywhere.
Thanks again!
We can't get the overriding options to work for head, have tried adding these options to our build config map:
But nothing seems to be passed along.
Re: the following docs: