redmine 使用位于的 favicon/usr/share/redmine/public/favicon.ico
我发现很多代码片段使用cd /usr/share/redmine/; grep -HR favicon app/
app/helpers/application_helper.rb: def favicon
app/helpers/application_helper.rb: "<link rel='shortcut icon' href='#{favicon_path}' />".html_safe
app/helpers/application_helper.rb: # Returns the path to the favicon
app/helpers/application_helper.rb: def favicon_path
app/helpers/application_helper.rb: icon = (current_theme && current_theme.favicon?) ? current_theme.favicon_path : '/favicon.ico'
app/helpers/application_helper.rb: # Returns the full URL to the favicon
app/helpers/application_helper.rb: def favicon_url
app/helpers/application_helper.rb: path = favicon_path
app/views/journals/index.builder: xml.icon favicon_url
app/views/common/feed.atom.builder: xml.icon favicon_url
app/views/layouts/base.html.erb:<%= favicon %>
但没有找到有关如何设置的更多信息favicon_path
or favicon_url
.
解决方法:
我在主题文件夹中添加了一个小 javascript:javascripts/theme.js
:
document.head = document.head || document.getElementsByTagName('head')[0];
function changeFavicon(src) {
var link = document.createElement('link'),
oldLink = document.getElementById('dynamic-favicon');
link.id = 'dynamic-favicon';
link.rel = 'shortcut icon';
link.href = src;
if (oldLink) {
document.head.removeChild(oldLink);
}
document.head.appendChild(link);
}
changeFavicon('../themes/freifunk-red-andy/images/favicon.ico');
(但该解决方法仅在访问者使用 JavaScript 时才有效)
Redmine 会自动加载它在其中找到的第一个文件favicon
你的主题的子目录。因此,如果您将网站图标放入例如favicon/favicon.ico
,Redmine 会自动使用它。
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)