想要修改dokuwiki站点的logo、favicon以及bookmark icon,取决于主题的实现。
我使用的是内置主题,根据其描述页的changing the logo节:
The Logo, Favicon and Apple Touch (bookmark) icons are looked up from multiple locations. The default icons (DokuWiki logo) provided by the template can be easily exchanged by uploading the image files to their correct locations using the Media Manager popup or Fullscreen Media Manager.
Here are the locations checked by the template code:
- The site’s logo
- :wiki:logo.svg
- :logo.svg
- :wiki:logo.png
- :logo.png
- lib/tpl/dokuwiki/images/logo.png
- The favicon
- :wiki:favicon.ico
- :favicon.ico
- lib/tpl/dokuwiki/images/favicon.ico
- The bookmark icon used by Apple and Android devices
- :wiki:apple-touch-icon.png
- :apple-touch-icon.png
- lib/tpl/dokuwiki/images/apple-touch-icon.png
Please make sure that those namespaces (either root or wiki:) are readable -to all users. Otherwise the image will be broken to users who are not -logged in.
根据描述与源码实现,它会按照先后顺序检查这几个文件,存在则返回,因此可直接替换:wiki:logo.svg资源文件,或是删除它后上传logo到:logo.svg或者:logo.png,favicon与bookmark icon同理。
我看到有些人推荐直接修改lib/tpl/dokuwiki/images/*文件,我认为这是不好的行为,因为如果主题模板未来进行了更新,可能存在这个目录下的文件被重置的问题。