Trac wiki links refresher -- from Rich

Rich suggests us to use attachment instead of absolute URLs to create links in documents. So instead of things like

http://astrobear.pas.rochester.edu/trac/attachment/wiki/u/ehansen/Bvec_movie.gif

it's better to use

[attachment:Bvec_movie.gif:wiki:u/ehansen]

This dynamic way also has a convenient direct download link next to the file attachment link.

Rich found a workaround to make those old posts which use the former way still work but to be on the safe side we should start using the dynamic way to do the links.

Here's Rich's original email:

Hi Baowei, and folks:

For what it is worth…

I would take the time to read the Trac Links page here: http://trac.edgewall.org/wiki/TracLinks

It provides very helpful information on creating links in documents you create on the blog, wiki, etc 
that are *dynamic* rather than hardcoded, absolute URLS (e.g. 

http://astrobear.pas.rochester.edu/trac/attachment/wiki/u/ehansen/Bvec_movie.gif)


Taking this as our example, say we wanted to link to an attachment on another wiki page in a blog post.

*** The incorrect way of doing this would be:
[http://astrobear.pas.rochester.edu/trac/attachment/wiki/u/ehansen/Bvec_movie.gif Eddie's Bvec Movie]

*** The correct way would be:
[attachment:Bvec_movie.gif:wiki:u/ehansen]

Where:
  * 'attachment:' is a keyword indicating you are referencing a Wiki file attachment
  * 'wiki' is a keyword referring to the wiki module of Trac
  * 'Bvec_movie.gif' is the literal referring to the filename of the attachment
  * 'u/ehansen/' is the wiki page containing this attachment.
     Do NOT LEAD OR END this reference with a "/", i.e "/u/ehansen/" is incorrect.

Your links at this point will be created automatically and correctly and even include a handy
 'direct download' attachment link in the page next to the file attachment link.

If anything changes on the server, which is what seems to have happened today, your links 
are broken. I have placed a workaround redirect to fix those broken links. Still, I highly 
recommend you all follow the Trac best-practices for making links.


Rich

Comments

No comments.