stakx-io / stakx

An opinionated, powerful, and simple static website generator built in PHP
https://stakx.io/
MIT License
14 stars 3 forks source link

Allow 'url' filter to accept external URLs #95

Closed allejo closed 5 years ago

allejo commented 5 years ago

The url filter is the standard way of creating links to internal stakx documents. However, they may be times where it references external URLs.

jumbotron:
    image: https://placehold.it/1920x500
    alt: ~
<img src="{{ url(this.jumbotron.image) }}"
     alt="{{ this.jumbotron.alt }}"
     class="landing-jumbotron__image"
>

Given the above example, the url() filter will return

/https://placehold.it/1920x500

Which breaks the image. When a string is feed into the function and contains ://, then it should return the value as is.