~xdavidwu/xdavidwu.link

ref: 6c0144ff2935eb19f35937a016721dcfdcad2b9c xdavidwu.link/example/_posts/2010-08-05-post-image-standard.md -rwxr-xr-x 1.2 KiB
6c0144ff — Michael Rose Merge branch 'release/4.0.4' 8 years ago

title: "Post: Image (Standard)" categories:

  • Post Formats tags:
  • image
  • Post Formats

The preferred way of using images is placing them in the /assets/images/ directory and referencing them with an absolute path. Prepending the filename with {% raw %}{{ site.url }}{{ site.baseurl }}/assets/images/{% endraw %} will make sure your images display properly in feeds and such.

Standard image with no width modifier classes applied.

HTML:

{% raw %}<img src="{{ site.url }}{{ site.baseurl }}/assets/images/filename.jpg" alt="">{% endraw %}

or Kramdown:

{% raw %}![alt]({{ site.url }}{{ site.baseurl }}/assets/images/filename.jpg){% endraw %}

![Unsplash image 9]({{ site.url }}{{ site.baseurl }}/assets/images/unsplash-image-9.jpg)

Image that fills page content container by adding the .full class with:

HTML:

{% raw %}<img src="{{ site.url }}{{ site.baseurl }}/assets/images/filename.jpg" alt="" class="full">{% endraw %}

or Kramdown:

{% raw %}![alt]({{ site.url }}{{ site.baseurl }}/assets/images/filename.jpg)
{: .full}{% endraw %}

![Unsplash image 10]({{ site.url }}{{ site.baseurl }}/assets/images/unsplash-image-10.jpg) {: .full}