Statocles icon indicating copy to clipboard operation
Statocles copied to clipboard

Add url() template helper

Open preaction opened this issue 10 years ago • 0 comments

See e9be65ec64687d497149f776e4f2a958e25e54d3

The blog now has a page_url method that, given a page, gives an absolute (/2015/01/01/page) URL to the page (removing unnecessary things like /index.html). The Site object also has a url() method that adds the current base URL (from the site, or from the current deploy).

These sound like they could be combined into a url( $page ) template helper. A template should know whether or not it needs the full URLs, but we could also add a nested helper for full URLs (url.full $page).

The helper may be extended to do more than just pages. If given a string, they could do the same thing, which will help with the Site navs attribute or the Document links attribute.

preaction avatar Feb 22 '15 20:02 preaction