Zou.Yun

关注:电子商务,网络营销,搜索引擎优化(SEO),搜索引擎营销(SEM),乐意与您分享经验。

SEO for Movable Type 4.x

写于2008-10-21 @ 分类:, |评论(1)

上次说MT天生就是为SEO准备的,近乎完美。MT默认的模板中并未对keywordsdescription进行设置,不用担心,MT有主够完美的模板标签让你来进行设置,今天我们就来说说如何对Movable Type 4.x设置keywords and description

Movable Type 4.X的模板引入了模块的概念,一个模块可以供多个模板来使用。所以在设置标签的时候要考虑到很多种情况,针对不同的模板设置不同的keywords and description。不能一概而论,事实上一概而论的话在重建模板的时候也不会通过的。:-) 。

keywords and description的设置在HTML Head这个模块中,我们先看看有那几个模板会用到HTML Head这个模块:Main indexentrypageCategory Entry ListingArchive Index,我使用的是Mid-Century template这个模板,也许每个人的模板不一样,其中包括这个模块的模板也不一样,你可以根据自己的情况来定。

先前我们说了根据每个不同的模板来设定不同的keywords and description,我们先来看看上面我们提到的每个模板都怎么设置:

Main index#

  1. <meta name="keywords" content="keywords1,keywords2,keywords3" />
  2. <meta name="description" content="<$mt:BlogDescription$>" />

Entry

  1. <meta name="keywords" content="<$mt:EntryKeywords$>" />
  2. <meta name="description" content="<$mt:EntryExcerpt$>" />

Page

  1. <meta name="keywords" content="<$mt:PageKeywords$>" />
  2. <meta name="description" content="<$mt:PageExcerpt$>" />

Category Entry Listing

  1. <meta name="keywords" content="<mt:Entries lastn="3"><mt:If name="__first__"><mt:EntryCategories glue=","><$mt:CategoryLabel $></mt:EntryCategories><mt:ElseIf name="__last__"><mt:EntryIfTagged>,<mt:EntryTags glue=","><$mt:TagName$></mt:EntryTags></mt:EntryIfTagged></mt:If></mt:Entries>" />
  2. <meta name="description" content="<mt:Entries lastn="3"><$mt:EntryTitle$>,</mt:Entries>" />

Archive Index

  1. <meta name="keywords" content="<mt:Entries lastn="3"><mt:If name="__first__"><mt:EntryCategories glue=","><$mt:CategoryLabel $></mt:EntryCategories><mt:ElseIf name="__last__"><mt:EntryIfTagged>,<mt:EntryTags glue=","><$mt:TagName$></mt:EntryTags></mt:EntryIfTagged></mt:If></mt:Entries>" />
  2. <meta name="description" content="<mt:Entries lastn="3"><$mt:EntryTitle$>,</mt:Entries>" />

前面两个也许很好理解,后面两个的基本相同,对于keywords,取前三篇文章的类别名称和Tag,对于description取前三篇文章的标题。

我们把上面的代码整理一下,并加上其他的元素,就可以得到一个比较完整的:

  1. <mt:If name="main_index"> /*首页的keywords和description的定义*/
  2. <meta name="robots" content="all" />
  3. <meta name="googlebot" content="index, follow" />
  4. <meta name="keywords" content="keywords1,keywords2,keywords3" />
  5. <meta name="description" content="<$mt:BlogDescription$>" />
  6. <mt:ElseIf name="archive index"> /*总归档的keywords和description的定义*/
  7. <meta name="keywords" content="<mt:Entries lastn="3"><mt:If name="__first__"><mt:EntryCategories glue=","><$mt:CategoryLabel $></mt:EntryCategories><mt:ElseIf name="__last__"><mt:EntryIfTagged>,<mt:EntryTags glue=","><$mt:TagName$></mt:EntryTags></mt:EntryIfTagged></mt:If></mt:Entries>" />
  8. <meta name="description" content="<mt:Entries lastn="3"><$mt:EntryTitle$>,</mt:Entries>" />
  9. <mt:ElseIf name="entry"> /*日志的keywords和description的定义*/
  10. <meta name="robots" content="all" />
  11. <meta name="googlebot" content="index, follow" />
  12. <meta name="keywords" content="<$mt:EntryKeywords$>" />
  13. <meta name="description" content="<$mt:EntryExcerpt$>" />
  14. <mt:ElseIf name="page"> /*页面的keywords和description的定义*/
  15. <meta name="robots" content="all" />
  16. <meta name="googlebot" content="index, follow" />
  17. <meta name="keywords" content="<$mt:PageKeywords$>" />
  18. <meta name="description" content="<$mt:PageExcerpt$>" />
  19. <mt:ElseIf name="Category Entry Listing"> /*按类别或日期归档页面的keywords和description的定义*/
  20. <meta name="keywords" content="<mt:Entries lastn="3"><mt:If name="__first__"><mt:EntryCategories glue=","><$mt:CategoryLabel $></mt:EntryCategories><mt:ElseIf name="__last__"><mt:EntryIfTagged>,<mt:EntryTags glue=","><$mt:TagName$></mt:EntryTags></mt:EntryIfTagged></mt:If></mt:Entries>" />
  21. <meta name="description" content="<mt:Entries lastn="3"><$mt:EntryTitle$>,</mt:Entries>" />
  22. </mt:If>

No TrackBacks

TrackBack URL: http://www.zouyun.org/cgi-bin/mt/mt-tb.cgi/31

评论(1)

不错,兄弟研究的挺不错~

发表评论