Sha256: 21271021939329e71451cbb61c5454c3214bb937b991659415d56213f3cca113

Contents?: true

Size: 1.3 KB

Versions: 11

Compression:

Stored size: 1.3 KB

Contents

---
title: Webgen::Tag::Relocatable
used_options:
  - tag.relocatable.path
---
## Description

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

When the tag is used, it changes the directory part of the supplied path name to a relative path to
the destination 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.

> You can only use the `relocatable` tag with paths that are handled by webgen. If you want to
> handle paths that are not normally handled by webgen, create a virtual path for them.
{.exclamation}

If the specified path is an absolute URL (like `http://webgen.rubyforge.org`), it will just return
it. And if you specify an URL fragment, this fragment has to exist. If you don't want to resolve a
fragment, just don't specify it in the tag but afterwards!

## Examples

<table class="examples">
<tr>
  <th>Usage</th><th>Output</th>
</tr>
<tr>
  <td>\{relocatable: /default.css}</td>
  <td>{relocatable: /default.css}</td>
</tr>
<tr>
  <td>\{relocatable: ../}</td>
  <td>{relocatable: ../}</td>
</tr>
</table>

Version data entries

11 entries across 11 versions & 2 rubygems

Version Path
gettalong-webgen-0.5.4.20080929 doc/tag/relocatable.page
gettalong-webgen-0.5.5.20081001 doc/tag/relocatable.page
gettalong-webgen-0.5.5.20081010 doc/tag/relocatable.page
gettalong-webgen-0.5.5.20081012 doc/tag/relocatable.page
gettalong-webgen-0.5.6.20081020 doc/tag/relocatable.page
webgen-0.5.2 doc/tag/relocatable.page
webgen-0.5.3 doc/tag/relocatable.page
webgen-0.5.1 doc/tag/relocatable.page
webgen-0.5.4 doc/tag/relocatable.page
webgen-0.5.6 doc/tag/relocatable.page
webgen-0.5.5 doc/tag/relocatable.page