Adding <link> headers

Is there a “Grav” way of injecting material into the final output’s <head> tag? Specifically I want to add some <link> tags. I know I can just grab the final output from onOutputGenerated and just append some stuff just before </head>, but I thought I’d check to make sure there wasn’t a “better” way. Thanks!

I am no expert, but if you look in the template partial that generates the <head> section you should be able to put anything you want in there.

Thanks. Yes I could, but this is for a plugin. I want it to inject the tags so the user doesn’t have to mess with their templates if they don’t want to. I want it to be automatic and transparent.

Right. As I said, I’m not nearly expert enough to do that. But as plugins seem to be able to inject content into other partials, I’m pretty sure someone could do it.

Hmm… actually there really isn’t programatically. You can do it via Twig of course but that depends completely on the theme because it may or may not define the block head.

I think your approach is best for now. It will take some wholesale changes in all themes to support adding arbitrary header options.

OK. I’ll go with the brute force method. Thanks :slight_smile: