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

add image helper for easier image insertion in posts #572

Closed
wants to merge 4 commits into from
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Do not assume images would be placed in /assets/images/
In order to add an image to a post, just use the following syntax:

{% include image image_path="/full/path/to/MyPostImage.png" caption="The optional image caption" %}

or

{% include image image_path="https://example.com/images/MyPostImage.png" caption="The optional image caption" alt="The optional alt text" %}
  • Loading branch information
fa-ribeiro authored Nov 8, 2016
commit da9525974307e85bae3f4f676f7d20fc79541cfc
2 changes: 1 addition & 1 deletion _includes/image
Original file line number Diff line number Diff line change
@@ -3,7 +3,7 @@
{% if include.image_path contains "://" %}
"{{ include.image_path }}"
{% else %}
"{{ include.image_path | prepend: "/assets/images/" | absolute_url }}"
"{{ include.image_path | absolute_url }}"
{% endif %}
alt="{% if include.alt %}{{ include.alt }}{% endif %}">
{% if include.caption %}