Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow 'url' filter to accept external URLs #95

Closed
allejo opened this issue Dec 11, 2018 · 0 comments
Closed

Allow 'url' filter to accept external URLs #95

allejo opened this issue Dec 11, 2018 · 0 comments
Labels
Core: Twig Relating to the internal use of Twig; i.e. templating, filters, functions Difficulty: Easy Simple fix that won't be invasive Feature: Enhancement The feature already exists but this is a request for it to be improved
Milestone

Comments

@allejo
Copy link
Member

allejo commented Dec 11, 2018

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.

@allejo allejo added Feature: Enhancement The feature already exists but this is a request for it to be improved Core: Twig Relating to the internal use of Twig; i.e. templating, filters, functions Difficulty: Easy Simple fix that won't be invasive labels Dec 11, 2018
@allejo allejo added this to the v0.2.0 milestone Dec 11, 2018
allejo added a commit to BZFlag-Dev/bzflag.org that referenced this issue Dec 11, 2018
- Give the navigation bar a solid color if there's no jumbotron image
- Add 'jumbotron' FrontMatter spec to allow for pages to specify
  jumbotrons

Blocked by stakx-io/stakx#95
@allejo allejo closed this as completed in 29bf5e5 Dec 12, 2018
allejo added a commit to BZFlag-Dev/style-guide that referenced this issue May 18, 2019
- Give the navigation bar a solid color if there's no jumbotron image
- Add 'jumbotron' FrontMatter spec to allow for pages to specify
  jumbotrons

Blocked by stakx-io/stakx#95
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Core: Twig Relating to the internal use of Twig; i.e. templating, filters, functions Difficulty: Easy Simple fix that won't be invasive Feature: Enhancement The feature already exists but this is a request for it to be improved
Projects
None yet
Development

No branches or pull requests

1 participant