I am using an OptionalSubsite as shown here: https://gist.github.com/snoyberg/8d85d41c5b4d0da002ae
How can I create a hamlet link/route to a file that is served in this subsite?
$if servingOptionalSite
<a href="@{StaticR (routeToOptionalFile)}">Docs
I can not rely on template haskell functions such as staticFiles to generate routes for the contents of the served folder because it is not always existent, hence OptionalSubsite.
I solved it with
which can then be used in hamlet