Jump to content
MediaWiki

扩展:Add HTML Meta and Title

From mediawiki.org
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+
数据库更改
‎<seo>
许可证 MIT License
下載
前往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" />

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

安裝

  • 下载文件,并解压AddHTMLMetaAndTitle文件夹到extensions/目录中。
    开发者和代码贡献人员应改从Git安装此扩展,输入:
    cdextensions/
    gitclonehttps://gerrit.wikimedia.org/r/mediawiki/extensions/AddHTMLMetaAndTitle
    
  • 請新增下列代码到您的LocalSettings.php 文件的底部:
    wfLoadExtension( 'AddHTMLMetaAndTitle' );
    
  • Yes 完成 – 請导航至您的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 uninitialized 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

AltStyle によって変換されたページ (->オリジナル) /