Skip to content
This repository has been archived by the owner on Feb 24, 2021. It is now read-only.

Support for favicon or custom head template #14

Closed
pseudobjorn opened this issue Oct 4, 2017 · 4 comments
Closed

Support for favicon or custom head template #14

pseudobjorn opened this issue Oct 4, 2017 · 4 comments

Comments

@pseudobjorn
Copy link

pseudobjorn commented Oct 4, 2017

I don't want to modify layout.ejs, since that would make it difficult to upgrade the module, but I see no other way of making changes to the <head>-section in the produced HTML.

My foremost need is to add a favicon, so that is my basic request. A default favicon in the images-folder could be used, for example, and then overridden similarly to the way it is done with the logo-image.

However, I can foresee other needs as well (such adding Google Analytics, and various-sized apple-touch-icons), so a more general solution would also be welcome (such as a custom head-template-file that can be inserted dynamically, if it exists, or if it is specified as an option).

@MikeRalphson
Copy link
Contributor

MikeRalphson commented Oct 4, 2017

Both approaches sound like very worthwhile enhancements. I'll see if anyone wants to pick them up as Hacktoberfest projects. If not, I'll get something done.

In the immediate term, does placing a favicon.ico file in the root of your web structure work?

@pseudobjorn
Copy link
Author

pseudobjorn commented Oct 5, 2017

Adding a favicon.ico file in the root of my web structure does not work. However, for now, I am simply opening the index.html file from my local filesystem, and it may be that your suggestion works once the site gets served by a webserver, such as IIS. I don't know.

But the following approach worked for me: I added a couple of favicons to the source\images folder (.png-files in different sizes, not the 16x16 favicon.ico-file I tried adding to the root-folder), and manually modified the index.html file by adding the following to the head-section:

<link rel="icon" type="image/png" href="source/images/favicon-32x32.png" sizes="32x32" />
<link rel="icon" type="image/png" href="source/images/favicon-16x16.png" sizes="16x16" />

This worked perfectly, even when opening the index.html from the filesystem.

@MikeRalphson
Copy link
Contributor

Thanks for the additional info.

@MikeRalphson
Copy link
Contributor

I've added source/includes/_head.md (which is now very unlikely to change / cause merge conflicts), so you should be fine to modify it to contain any html you need to appear in the head element.

Included in v2.1.1-0

Please feel free to reopen the issue if it doesn't meet your needs.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants