Modifying head_tag.html template

While you can add to it - like you’ve already discovered - you can’t modify the existing contents of the <head> tag in a theme because it’s generated based on .erb files and themes don’t have access to that.

https://github.com/discourse/discourse/blob/eae22548de4eedad875555e7353b8abfdce2452b/app/views/layouts/application.html.erb#L3-L64

with a another file that’s loaded as a partial here

https://github.com/discourse/discourse/blob/eae22548de4eedad875555e7353b8abfdce2452b/app/views/layouts/_head.html.erb

It’s possible that there maybe JavaScript workarounds to achieve what you’re trying to do. I might be able to advise if you can give me a simple example of the desired changes.

5 curtidas