webgen logo

webgen / static website generator

static website generation made easy!

Latest news

2007-09-08: Small bug fix release. More...

2007-06-29: Some bug fixes and one small feature enhancement. More...

2007-05-20: Fixed bug which prevented installation via Rubygems. More...

Links

Generated by webgen

General Information

Plugin name:Tag/Relocatable (Tag/Default)
Author:Thomas Leitner <t_leitner@gmx.at>
Summary:Adds a relative path to the specified name if necessary
Parameters:

path (=default mandatory parameter): nil
The path which should be relocatable

resolveFragmenttrue
Specifies if the fragment part (#something) in the path should also be resolved

Handled tags:relocatable

Description

This tag ensures that the relative path to the referenced file is always correct.

It is used to change the directory part of the supplied path name and is most often used in template files. A relocatable tag looks like this: {relocatable: default.css}. If this was put into a template and the template was used by a file in a subdirectory, then the relocatable tag would put ../default.css into the output file; thus ensuring that the relative path to file is valid!

However, if the specified path is an absolute URL, it will just return it.

Be aware that the tag resolves the specified path by using the output names (and the standardized page names) of the nodes. Also, if the path points to a directory, the path to its index file is returned.

Additionally, if you add an URL fragment to the path, it will also be checked if it exists. This can be turned off by setting the parameter resolveFragment to false.

Examples

UsageOutput
{relocatable: /default.css} ../../../default.css
{relocatable: ../core/configuration.page} ../core/configuration.html
{relocatable: ../core} ../core/index.html