sintaxi/terraform — pull request #31 by kennethormandy (2014-01-17 02:49:46+00:00)
Title: Add current.base and tests for all of current

I accidentally did this on top of the branch with all the preprocessor updates, sorry about that.

#### current.source and current.path tests

Unfortunately my git skills aren’t good enough to sort all that out. I believe you would want everything from https://github.com/kennethormandy/terraform/commit/2826c382c6f839cbf3494792fb3e29548f39441d though, as it has the `current.path` and `current.source` tests.

#### current.base

Essentially, `current.base` is a string of `../`s for `current.path.length`. I haven’t tested it on Windows yet, I’m not sure where your path fixes happen, so that could be an issue.

#### Alternatively, some kind of url function

For `current.base`, as we discussed, it’d probably be better to have a function, something like:
```jade
a(href=path("about")) About
```

…so you could compile with with relative or absolute links, or have an `.html` extension tacked on as appropriate. It would also have to check to see if there was an extension already, because if you had an image, you might still want the relative pathing:

```ejs
/>
```

It’s possible that `current.base` could still be useful, and the `path()` function or whatever we call it could use it.