Tag Archives: mt

Googlify your Movable Type Blog

With the recent release of the new version of Google’s toolbar for Internet Explorer on Windows, it’s now possible to make your own custom buttons for the popular browser extension. Once installed, the button gives you easy access to your most recent entries and provides you with a simple way to search your site for a word or phrase you highlight on any web page.
 
In addition to just being a cool feature for your own personal use, by providing it to your visitors, it’s also a great vehicle for promoting and increasing traffic to your Movable Type-powered blog.
 
Creating a Google Toolbar button for your site
So how do you do it? Easy. You can just make use of the template that Niall Kennedy created, which uses the power of Movable Type’s publishing engine to automatically generate the code for the button.
 
First, create a new index template. You might want to name it "Google Toolbar Button" and then set the Output File to toolbar_button.xml. Then, copy the following text and paste it in as the body of the template.
 
<?xml version="1.0" encoding="utf-8"?>
<custombuttons xmlns="http://toolbar.google.com/custombuttons/">
  <button>
    <title><$MTBlogName remove_html="1" encode_xml="1"$></title>
    <description><$MTBlogDescription remove_html="1" encode_xml="1"$></description>
    <site><$MTBlogURL$></site>
    <search><$MTCGIPath$><$MTSearchScript$>?search={query}&IncludeBlogs=<$MTBlogID$></search>
    <send><$MTCGIPath$><$MTSearchScript$>?search={selection}&IncludeBlogs=<$MTBlogID$></send>
    <feed refresh-interval="3600"><$MTBlogURL$>atom.xml</feed>
     <icon mode="base64" type="image/x-icon">AAABAAEAEBAAAAAAAABoBQAAFgAAACgAAAAQAAAAIAAAAAEACAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAD///8A//f3APf39wD39+8A9+/vAO/v5wDv5+cA5+feAN7e1gDe3s4A3tbOAN7WxgDW1sYA
1s7GAM7GvQDOxrUAxr2tAMa9pQDGtaUAvbWlAL21nAC1rZQAtaWMAK2ljACllHsApZRzAJyMawCU
hGMAlHtaAIx7WgCMe1IAjHNSAIRzUgCEc0oAhGtKAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAA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AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAHR0dHR0dHR0dHR0dHR0dHR0dHR0dHR0dHRoNGh0dHR0dHR0dIR0dHR0EECIdHSIdHR0dHR0d
HSIVABciHR0YHR0dHR0dHR0iDgAFHSIdBx0dHR0dHR0dHQUAAAcNBQkdHR0dHR0dIhMAAAAAAAUa
HR0dHSIdHRUAAAAFCRAcHR0dHR0UDQQAAAAQGiIiHR0dHRoIDQ4IAAAQIh0dIR0dHR0JDSIiGgUE
HR0dHR0dHR0dBBoiHSIQDSIdHR0dHR0dHQUXIh0dDRAhHR0dHR0dHR0VABodFQAaIh0dHR0dHR0d
HRUHAAkaHR0dHR0dHR0dHR0dHR0dHR0dHR0dHR0dHQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=</icon>
  </button>
</custombuttons>

Save the template, rebuild it (if necessary), and your new button code should be all set. By default, your output should look something like this. Then, your last step is to make a simple link to your new file. That should look like:

 <a href="http://toolbar.google.com/buttons/add?url=[your blog URL]toolbar_button.xml">Add to Google Toolbar</a>

The results will give you a link that says Add to Google Toolbar. So what are you waiting for? Click the button! Then you’ll have a new toolbar button updating you on the latest Movable Type news, along with a new search function that lets you have direct access to the Movable Type knowledge base and help documentation. Then be sure to post your own button link on your blog.

Still not appeased the Googlebot enough? Be sure to check out Niall’s Sitemap instructions, which let you simply and easily make a Google Sitemap XML file, which lets you instruct Google’s spiders on how to crawl your site, while letting you as the site owner have access to more statistics and information about your site.

If you want to make your site as reader-friendly (and Google-friendly) as possible, it’s easy to start with Movable Type today and you’ll be button-making, sitemapping and blogging in no time.

 

 

关于在mt中显示最新评论的完整代码

matt给了我下面这段代码,用来解决上篇文章提到的问题
 
<h2>最近收到的评注</h2>
<ul>
<MTComments lastn="12"  sort_order="descend">
<MTCommentEntry>
<li><a href="<$MTEntryPermalink$>#comment-<$MTCommentID$>">
Re:
<$MTEntryTitle$>
   </a>
   </MTCommentEntry>
  , by
  <$MTCommentAuthor$>
  (
   <$MTCommentDate format="%b %d"$>
)
</li>
</MTComments>
</ul>
 <p class="entry-footer">
 </p>
 
 
针对自己的css,修改了下,我使用就是下面这段
 
<div>
<h2 class="module-header">Recent Comments</h2>
<ul class="module-list">
<MTComments lastn="24" sort_order="descend">
<MTCommentEntry>
<li class="module-list-item">
<a href="<$MTEntryPermalink$>#more">
<$MTCommentBody$></a></li>
</MTCommentEntry>
</MTComments>
</ul>
</div>

关于在mt中显示最新评论的

如何在mt中显示最新评论,官方给的代码是
 
<MTComments lastn="6" sort_order="descend">
<p><$MTCommentAuthor$> said:<br />
<$MTCommentBody$></p>
</MTComments>
 
但是,这样的话,是没有链接的,效果不好。
我修改之后的是
 
<div>
<h2 class="module-header">Recent Comments</h2>
<MTEntries lastn="***">
<MTComments lastn="10" sort_order="descend">
<div id="c<$MTCommentID$>">
<ul class="module-list">
<li class="module-list-item">
<a href="<$MTEntryPermalink$>#more">
<$MTCommentBody$></a>
</div>
</MTComments></MTEntries>
</MTEntryIfCommentsActive>
</li>
</ul>
</div>
 
似乎mtcomments 中参数lastn现在不起作用。
这里的问题就是,<mtcomments>,必须在<MTEntries></MTEntries> 中,而在这一段代码中,如果不给<MTEntries>制订lastn的数目,默认就为首页显示的文章数目。从而导致显示的评论是首页上出现的文章的评论
我的这段代码,只能够实现显示指定数目文章的所有评论,而不能显示指定数目的评论。
继续研究

google与baidu搜索的分析

这个域名已经使用了大概3个月了。文章有了253篇了。
使用mt,也是为了生成静态,便于搜索引擎查找。现在看看效果:
 
google:可以搜索到384篇。平均1天扫描站点2-3次
baidu:可以搜索到8380篇,每小时扫描2次
但还有一个Inktomi Slurp的搜索引擎,扫描次数也是不低,仅仅次于baidu。但我不知道是从何而来
 
 
2006-01-31_11-27-15.jpg
 
 
再看看搜索后的结果:
对于google,搜索到的排名靠前的,都是分类或者日期的归档,几乎所有的单篇归档或者文章,都被忽略。
而对于baidu,几乎所有的归档都可以搜索到。且排序上不能很严格的看出是单篇归档,还是分类等。
 
然后对比车东的blog,却可以在google上得到比baidu多的多得结果。
 
再来看网站的来自于搜索引擎的页面:
可以看到,baidu对比google,已经是10倍的关系了。这个也是和收录的网页数目有关。

2006-01-31_11-38-37.jpg

 
所以分析来,主要有以下几点原因吧:
 
1、google的扫描似乎会判断文件日期。而对于mt,每次修改模版,都会重建所有页面,导致了google中认为你的网站不稳定,而google对于经常变动的文章不会收录。而baidu似乎则相对宽松。几乎我发布的文章,第二天就会出现。
 
2、google对于一个页面的判断,还是偏重于<h1></h1>标签。google认为,一个页面的标题,或者主要内容,主要是有<h1>中的内容决定,而不是考虑<title></title>。这样就导致对于mt的一个问题。mt所有页面在默认模版中,都是使用<h1>来标定blog的名字。也就是说,我所有的页面的这一部分信息,都是meteor’s blog。对于google来说,这就是类似页面,或者说是相同页面,也就会在搜索结果中忽略,不被收录。而baidu则要好得多,采用<title>来重点判断我的页面信息。以<title>来进行收录。
 
所以来说,mt对于google来说,优势主要在于,使用静态页面,便于搜索。而且目录结构合理,最多2级,符合google的习惯。而缺点也很明显,默认的<h1>内容不适合google的搜索,导致重复结果太多。
 
由此可见,如果想要得到更好的收录,需要重新来订制下网页结构。
下一步要做的,就是重新修改模版。使得blog的题目在<h1>中出现。并且减少模版修改次数,使得生成的页面可以保持长时间不用重建。
 

官方提供的集成fckeditor到mt中的方法

在fckeditor的网站上发现的,链接点这里
 
这一个的集成方法比较好,可以让日记主要内容、更多日记内容、日记关键字,都集成fckeditor。
 
其实对比以前的方法,在edit_entry.tmpl文件的<head>与</head>中间,加入
<script type="text/javascript" src="你的fckeditor的js地址"></script>
<script type="text/javascript">
window.onload = function()
 {
 var oFCKeditor = new FCKeditor( ‘text’ ) ;
  oFCKeditor.Height = "400" ;
  oFCKeditor.Width = "580" ;
  oFCKeditor.CheckBrowser = true ;
  oFCKeditor.ReplaceTextarea() ;
 
  pFCKeditor = new FCKeditor( ‘text_more’ ) ;
  pFCKeditor.Height = "400" ;
  pFCKeditor.Width = "580" ;
  pFCKeditor.CheckBrowser = true ;
  pFCKeditor.ReplaceTextarea() ;
}
    </script>
 
就可以实现了如果需要让关键字也增加格式

Continue reading

mt生成的页面使用相对路径

MT默认生成的所有页面,都是使用的绝对路径。而这样就带来了2个问题
1、生成的页面代码长度会变大。虽然在宽带已经普及,但少一点总没有坏处
2、我使用mt,就是因为可以生成html。这样就可以把静态文件备份下来。如果服务器有问题的时候,依然有资料可以看。但使用绝对路径,当服务器有问题的时候, 本地备份的文件中,样式表依然是指向服务器,而且文章之间的关联也是指向的服务器。也就是说,当服务器有问题的时候,本地文件浏览起来非常麻烦。
第2个问题,就是主要问题,所以,我用MTTruncateURL Plugin来把mt生成的绝对路径都转换成了相对路径:
下载MTTruncateURL Plugin,放到plugin目录,地址如下 http://as-is.net/blog/archives/misc/mt-truncateurl.pl 然后在需要转换的地方加上<mttruncateurl></mttruncateurl就可以了。对于我们来说,当然是在<html></html>之外加上了>:)
下面是效果,可以看到,连图片的地址都替换了,很不错的 2006-01-14_21-52-24.jpg