Hi,
There seems to be an issue with the 'url' template filter :
<a href="{{ 'http://google.fr/' | url }}">Google</a>
will generate
http://localhost:5000/services/register/http:/google.fr
(where of course http://localhost:5000/services/register/ is my source page)
Maybe i've done something wrong ?
using Lektor 2.3
The filter is for generating relative links.. you wouldn't use it for an external link so just <a href="http://google.fr">Google</a> is fine.
my real code is {{ this.url | url}} where url is a string field of my model ; which can either be a relative path to a page (like /company/about-us or products) but also can be an external URL like http://google.fr as stated in my example.
It just works as expected with a 鈥渓ocal" URL but just doesn鈥檛 work with an external one.
We could imagine a fix in the url filter with a regex detecting <scheme>:// at start of filtered URL.
Adding a +1 to this...having the url filter be agnostic to relative and absolute paths is nice for when an instance of a data model can have a more_info_url attribute that could point to either.
Most helpful comment
Adding a +1 to this...having the
urlfilter be agnostic to relative and absolute paths is nice for when an instance of a data model can have amore_info_urlattribute that could point to either.