Tag Archives: plugin

Install WP-syntax Plugin

You can download the plugin from http://wordpress.org/extend/plugins/wp-syntax/. And it supports highlighting with or without line numbers and maintains formatting while copying snippets of code from the browser.

But it’s not very convenient to use it, when edit a post, I must use the ‘html view’ mode, and add

public class Hello {
  public static void main(String[] args) {
    System.out.println("Hello World!");
  }
}
class Example
  def example(arg1)
    return "Hello: " + arg1.to_s
  end
end

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

给blog增加了个tag

首先下载:Tagwire
安装很简单,解压后上传tagwire.pl文件到你MT的plugin目录就行了。
现在登录到MT后台,在plugin中应该可以看到这个插件了,现在我们来修改单篇文章模板使用这个插件。
编辑Individual Entry Archive模板,找到
 

<div id="more" class="entry-more">
<$MTEntryMore$>

 
在下面加上以下代码
 

<p>Tags:  <MTEntryTags>
<a href="http://www.technorati.com/tag/<$MTTag glue="," case_sensitive="1" encode_urlplus="1" $>" rel="TAG" title="TAG:<$MTTag$>"><$MTTag$></a>
</MTEntryTags>
</p>

保存并重建,好了,我们现在可以使用这个插件了。
 
关于Tag的输入格式,多Tag推荐使用逗号隔开
 
ps: 顺便可以在页面上加上,当然是为了方便搜索引擎了:)

<meta name="keywords" content="<$MTEntryKeywords$>" />