扩展:Add HTML Meta and Title

This page is a translated version of the page Extension:Add HTML Meta and Title and the translation is 60% complete.
MediaWiki扩展手册
Add HTML Meta and Title
发行状态: 不再維護
实现 标签
描述 为MediaWiki带来更加易用的搜索引擎优化(SEO)
作者 Jim Wilson, Dennis Roczek (dennisroczek留言)
最新版本 0.7 (2015-09-29)
MediaWiki 1.24+
数据库更改
许可协议 MIT授權條款
下載
‎<seo>
前往translatewiki.net翻譯Add HTML Meta and Title扩展

Add HTML Meta and Title扩展为MediaWiki带来了更加易用的搜索引擎优化(SEO)。 它部分基于扩展 MetaKeywordsTag

用法

当你在一个wiki页面输入下面内容:

<seo title="word1,word2" metakeywords="word3,word4" metadescription="word5,word6" google-site-verification="123456789-abfd123456" />

...或更短...

<seo title="word1,word2" metak="word3,word4" metad="word5,word6" google-site-verification="123456789-abfd123456" />

...这些词被添加到HTML标题和元数据中。这使得MediaWiki的SEO更加容易。

例如,上面的例子会变成:

<title>word1,word2 - Wiki Name</title>         (the string "word1,word2" replaces page title)
<meta name="keywords" content="word3,word4" />
<meta name="description" content="word5,word6" />
<meta google-site-verification="123456789-abfd123456" />

(这些是新的元标签——已有的元标签会被保留)

安裝

  • 下载文件,并将其放置在您extensions/文件夹中的AddHTMLMetaAndTitle目录内。
    开发者和代码贡献人员应从Git安装扩展,输入:cd extensions/
    git clone https://gerrit.wikimedia.org/r/mediawiki/extensions/AddHTMLMetaAndTitle
  • 将下列代码放置在您的LocalSettings.php 的底部:
    wfLoadExtension( 'AddHTMLMetaAndTitle' );
    
  •   完成 – 在您的wiki上导航至Special:Version,以验证已成功安装扩展。

更新日誌

v0.7.0
  • 添加PHP CodeSniffer检查支持
  • 修复所有剩余的错误和警告
v0.6.0
  • 添加谷歌的站点认证标签
v0.5.1
  • modified to work with MW versions 1.1.2 and up (Revision by Mic)
v0.4.0
  • have put $emt=""; in the parseSEO function because I got some nasty PHP notice for an unitialised variable...
v0.2.0
  • added htmlspecialchars() as a filter to the text that is displayed in the title and meta - anything else needed to prevent malicious people? I think no. (If you are an English speaker you may want to use the htmlentities PHP function, which is more restrictive.)
v0.1.0
  • Initial version - everything works.

See also