Skip to content

Commit

Permalink
feature: figure support url. (#2586)
Browse files Browse the repository at this point in the history
This PR allows the `figure` to accept url as the src of the`<img>`.
currently, it only supports the relative path.

```
// raw img
<img src="{{ image.url }}" alt="{{ image.description }}">

// assign url to figure                 
{% assign image_url = image.url %}
{% include figure.liquid url=image_url class="img-fluid rounded z-depth-1" zoomable=true %}
```

---------

Signed-off-by: ifuryst <[email protected]>
Co-authored-by: George <[email protected]>
  • Loading branch information
iFurySt and george-gca authored Oct 1, 2024
1 parent c20074c commit caddec2
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion _includes/figure.liquid
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
>
{% endif %}
<img
src="{% if include.cache_bust %}{{ include.path | relative_url | bust_file_cache }}{% else %}{{ include.path | relative_url }}{% endif %}"
src="{% if include.url %}{{ include.url }}{% elsif include.cache_bust %}{{ include.path | relative_url | bust_file_cache }}{% else %}{{ include.path | relative_url }}{% endif %}"
{% if include.class %}
class="{{ include.class }}"
{% endif %}
Expand Down

0 comments on commit caddec2

Please sign in to comment.