hacks-guide-minimal-mistake.../_posts/2010-08-05-post-image-standard.md

44 lines
1.2 KiB
Markdown
Raw Normal View History

2016-03-04 18:37:24 +01:00
---
title: "Post: Image (Standard)"
categories:
- Post Formats
tags:
- image
- Post Formats
---
2016-03-07 15:51:50 +01:00
2016-03-15 19:11:31 +01:00
The preferred way of using images is placing them in the `/images/` directory and referencing them with an absolute path. Prepending the filename with `{% raw %}{{ site.url }}{{ site.baseurl }}/images/{% endraw %}` will make sure your images display properly in feeds and such.
2016-03-04 18:37:24 +01:00
Standard image with no width modifier classes applied.
**HTML:**
```html
{% raw %}<img src="{{ site.url }}{{ site.baseurl }}/images/filename.jpg" alt="">{% endraw %}
```
**or Kramdown:**
```markdown
{% raw %}![alt]({{ site.url }}{{ site.baseurl }}/images/filename.jpg){% endraw %}
```
![Unsplash image 9]({{ site.url }}{{ site.baseurl }}/images/unsplash-image-9.jpg)
Image that fills page content container by adding the `.full` class with:
**HTML:**
```html
{% raw %}<img src="{{ site.url }}{{ site.baseurl }}/images/filename.jpg" alt="" class="full">{% endraw %}
```
**or Kramdown:**
```markdown
{% raw %}![alt]({{ site.url }}{{ site.baseurl }}/images/filename.jpg)
{: .full}{% endraw %}
```
![Unsplash image 10]({{ site.url }}{{ site.baseurl }}/images/unsplash-image-10.jpg)
{: .full}