在我的 Dokuwiki 的 header 中隐藏标题

Hide title in header of my Dokuwiki

因为我在 header 中使用徽标,所以我不需要 title-text。但是我想要一个browser-title。 所以我需要设置一个标题并且必须将它隐藏在 header 中 - 但是如何?

我假设您的 wiki 看起来像 dokuwiki.org(这意味着您使用的是最新版本之一和默认模板)。如果不是,方法应该仍然相同,请在模板中搜索 $conf['title']

lib/tpl/dokuwiki/tpl_header中有一个块。php:

        // display logo and wiki title in a link to the home page
        tpl_link(
            wl(),
            '<img src="'.$logo.'" '.$logoSize[3].' alt="" /> <span>'.$conf['title'].'</span>',
            'accesskey="h" title="[H]"'
        );

从中删除 <span>'.$conf['title'].'</span>

Dokuwiki 引擎的每次更新都会覆盖此更改。您需要在每次更新后手动重复此操作,或将 doku 模板复制粘贴到新模板中并手动更新此新模板。

也可以通过适当的 CSS display: none 设置隐藏标题文本。它可以放入 conf/userstyle.css 文件中,因此不会被更新覆盖。文本仍在页面中,但变得不可见。它也可能会提高 search-engine 的点击率,也许吧。

可能的CSS代码:

div.headings h1 span { display: none !important; }

Possible also to hide the title text with a proper CSS display: none setting. It can be put into the conf/userstyle.css file, so it wont be overwritten by updates. The text resides still in the page but becomes invisible. It may improve the search-engine hits also, maybe.

Possible CSS code:

div.headings h1 span { display: none !important; }

这个答案很好。它对我有用。