Typecho是默认所有链接都在当前窗口打开,个人认为这样挺不适合阅读以及增大跳出率,所以本人修改为“弹出新窗口”,有了这个,再也不需要每个链接都加“target=_blank”。
- 让评论者的主页在新窗口打开
首先打开\var\Widget\Abstract\Comments.php这个文件。找到第376行(或附近):
echo '<a href="' , $this->url , '"' , ($noFollow ? ' rel="external nofollow"'
: NULL) , '>' , $this->author , '</a>';
替换为
echo '<a href="' , $this->url , '"' , ($noFollow ? ' rel="external nofollow"'
: NULL) , ' target="_blank">' , $this->author , '</a>';
- 让文章里的链接在新窗口打开
打开/var/CommonMark/HtmlRenderer.php文件,找到104行
case CommonMark_Element_InlineElement::TYPE_LINK:
替换为
case CommonMark_Element_InlineElement::TYPE_LINK:
$attrs['href'] = $this->escape($inline->getAttribute('destination'), true);
$attrs['target'] = $this->escape(_blank, true);
if ($title = $inline->getAttribute('title'))
{
$attrs['title'] = $this->escape($title, true);
}
此文仅作为备份。
最新评论
确实就是一台电脑了
用过,还不错。
使用了博主的gravatar头像镜像源,特来表示感谢!
大赞,跟着你的步骤刷机切卡成功。按这个步骤应该也能刷openwrt吧,不知道有没有固件。
价格如何
能玩2077?真不错
hi,帮我换下链接吧,https://h4ck.org.cn 换成https://zhongxiaojie.cn