Add text to <head> element?

Topics: User Forum
Feb 17, 2010 at 3:02 PM

Is there a hook (property?) to add constant text to the <head> element of a generated web page? I want to add a <link> element specifying my favicon for the documentation set. I do not find anything in the existing SHFB properties, the SHFB help file, or this forum.

Feb 17, 2010 at 8:17 PM

There isn't currently a way to do that.  The PostTransformComponent could probably be extended to insert the link for the favorites icon.  A more generalized build component could also be written to insert any kind of metadata into the head element.  However, in this case, it might be more appropriate to update Index.aspx and/or Index.html to include the favorites icon reference since they are usually the pages that are loaded for viewing the website output.  You can find them in the Web\ folder in the main SHFB installation folder.  Would that work for you?  If so, let me know as I can update them to include a basic favorites icon file that could be replaced on a project by project basis by including a like named file as a content item.



Feb 24, 2010 at 4:16 PM

That sounds fine. As a workaround I have added a post-processing step to my build that adds a reference not only to the Index.html but also to all the htm files. (Probably overkill but it allows the favicon to still appear if someone views a page outside of the frameset:-)

For reference, this is the format that I have tested in both IE and Firefox:

<link rel="SHORTCUT ICON" href="path-to-my-ico-file"/>