wiki:ExtLinkRewriterPlugin

Version 19 (modified by otaku42, 5 years ago) (diff)

Use #!sh instead of #!bash; use of #!ini processor for additional eye-candy.

Plugin for Rewriting External Link URLs

Description

Rewrite external link location, to hide referers for private sites, to use social bookmark sites, and so on.

For example, trac link:

[http://foo.bar.com outgoing site]

becomes in html:

<a class="ext-link" href="http://foo.bar.com">outgoing site</a>

But, ExtLinkRewriter converts it as:

<a class="ext-link" href="/myredirector.html?http://foo.bar.com" target="_blank">outgoing site</a>

Jumping outgoing site via single redirector, referers with detailed page names could be hidden. it is useful for private/secret sites; e.g. project sites in local networks. (this plugin contains simple redirectors).

Or, using bookmark site; del.icio.us:

<a class="ext-link" href="http://del.icio.us/url?url=http://foo.bar.com">outgoing site</a>

Bugs/Feature Requests

Existing bugs and feature requests for ExtLinkRewriterPlugin are here.

If you have any issues, create a new ticket.

Download

Download the zipped source from here.

Source

You can check out ExtLinkRewriterPlugin from here using Subversion, or browse the source with Trac.

Install

make the egg package

python setup.py bdist_egg

copy egg into your trac plugins dir.

cp dist/ExtLinkRewriter*.egg /where/to/trac/plugins/

To activate the plugin, edit conf/trac.ini:

[components]
ExtLinkRewriter.* = enabled

Example

Redirector

  1. copy redirector/rediretor.html at accessible point.
    $ cp redirector/rediretor.html /var/www/
    

Check redirect function at your brower, e.g. goto http://.../redirector.html?http://google.com .

  1. edit conf/trac.ini

example options:

[extlinkrewriter]
format = /redrector.html?%s
namespaces = http,https,ftp
target = _blank

Social Bookmark

del.icio.us

[extlinkrewriter]
format = http://del.icio.us/url?url=%s
namespaces = http,https

hatena bookmark

[extlinkrewriter]
format = http://b.hatena.ne.jp/entry/%s
namespaces = http,https

Mix redirector and bookmark

[extlinkrewriter]
format = /redirector.html?http://del.icio.us/url?url=%s
namespaces = http,https,ftp
target = _blank

Recent Changes

[4051] by bellbind on 2008-07-22 07:59:23
make compliant with trac 0.11
[2186] by bellbind on 2007-04-20 05:14:11
ExtLinkRewriterPlugin:

change default rewrite format to send del.icio.us

[2183] by bellbind on 2007-04-19 20:55:10
ExtLinkRewriterPlugin:

add site info in README.txt

Author/Contributors

Author: bellbind
Contributors: