Closed
Description
A common use case is to put a favicon in the head config option:
<link rel="apple-touch-icon" href="/favicon.png">
<link rel="icon" type="image/png" href="/favicon.png" sizes="512x512">
There are two problems with this approach:
- The
favicon.png
isn’t detected as a referenced file, so unless some other code references this, it won’t be included in the built site. - The
/favicon.png
link will work locally, but it won’t get rewritten to a relative link on build, and so will result in a broken link if the built site isn’t served at the root of a domain.
We’ve talked about having a “public” assets folder #169 but that only addresses problem (1), not problem (2). If we resolved reference assets in the head, header, and footer, then we’d solve both problems at once: we’d include the referenced files in the built output, and we’d rewrite the links to be relative. We already do this for the scripts option, so it seems reasonable to extend it to these other HTML fragments. (Though it’s extra tricky because these options can be overridden by the page.)