terraform icon indicating copy to clipboard operation
terraform copied to clipboard

Add current.base and tests for all of current

Open kennethormandy opened this issue 11 years ago • 1 comments

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:

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:

<img src="<%- url("img/example.jpg") %> />

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

kennethormandy avatar Jan 17 '14 02:01 kennethormandy

What is the status on this?

agibsen avatar Aug 05 '15 10:08 agibsen