Main | MT-ShrinkFInfo »

MTTruncateURL Plugin

mt-truncateurl.pl

0.01(2004.09.29): First Release

Lots of built-in MT tags, such as MTEntryPermalink or MTArchiveLink, always generate canonical URLs (e.g. http://www.domain.tld/blog/index.html). It is sometimes inconvenient because generated HTML files grow large and make hard to distinguish between internal links and external links. MTTruncateURL Plugin allows you to simply replace cannonical URLs with relative URLs.

<MTTruncateURL>...</MTTruncateURL>

Container tag that converts its contents (more precisely saying, all of "href", "src", and "action" attributes) into relative URLs if possible. The converted URLs will be relative to the blog server, such as "/blog/index.html" and "/blog/archives/photo/index.php".

For example, in the index template, this container tag allows you to convert one single MTEntryPermalink tag to a relative, and to convert a whole document as well.

SEE ALSO

Ogawa::Memoranda (totally in Japanese)

LICENSE

This code is released under the Artistic License. The terms of the Artistic License are described at http://www.perl.com/language/misc/Artistic.html.

AUTHOR & COPYRIGHT

Copyright 2004, Hirotaka Ogawa (hirotaka.ogawa at gmail.com)

TrackBack

TrackBack URL for this entry:
http://as-is.net/mt/en_US/mt-tb.cgi/1

Post a comment

(If you haven't left a comment here before, you may need to be approved by the site owner before your comment will appear. Until then, it won't appear on the entry. Thanks for waiting.)