-
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #8 from charlesrocket/image
- Loading branch information
Showing
3 changed files
with
11 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,7 @@ | ||
{%- if src is starting_with("https://") %}{% set image = src %}{% else %}{% set image = get_url(path=src, cachebust=true) %}{% set meta = get_image_metadata(path=src) %}{%- endif %} | ||
{%- if src is starting_with("https://") %}{% set image = src %}{%- elif src is starting_with("/") %}{% set image = get_url(path=src, cachebust=true) %}{% set meta = get_image_metadata(path=src) %}{% else %}{% set file = page.path ~ src %}{% set image = get_url(path=file, cachebust=true) %}{% set meta = get_image_metadata(path=file) %}{%- endif %} | ||
<figure> | ||
<center> | ||
{%- if link %}<a href={{ link | safe }}>{%- endif %} | ||
<img class="align-center page-image" src="{{ image | safe }}"{% if meta %} width="{{ meta.width }}" height="{{ meta.height }}"{% endif %}{% if alt %} alt="{{ alt | safe }}"{% endif %}/> | ||
{%- if link %}</a>{%- endif %} | ||
{%- if link %}<a href={{ link | safe }}>{%- endif %} | ||
<img class="align-center page-image" src="{{ image | safe }}"{% if meta %} width="{{ meta.width }}" height="{{ meta.height }}"{% endif %}{% if alt %} alt="{{ alt | safe }}"{% endif %}/> | ||
{%- if link %}</a>{%- endif %} | ||
{%- if caption %}<figcaption>{{ caption | safe }}</figcaption>{%- endif %} | ||
</center> | ||
</figure> | ||
</figure> |