Insert these useful templates into markdown documents to embed images into articles. There are variations for left/center/right images along with text-style or caption-style. Each template is paired with an html include file you save in your _includes folder.


Contents


Centered image

Use conventional markdown syntax for most centered images without a caption,

![Ant in amber](/i/ant_in_amber.jpg){: .centered }{: height="200px" :}

Ant in amber

or with a caption,

![Ant in amber](/i/ant_in_amber.jpg){: .centered }{: height="200px" :}

An ant preserved in amber.
{: .caption :}

Ant in amber

An ant preserved in amber.

Image_left_without_caption

Insert template into markdown,

{% capture image %}IMAGE FILE NAME{% endcapture %} 
{% capture alt %}ALT TEXT{% endcapture %}  
{% capture height %}200px{% endcapture %}  
{% capture description %} 
DESCRIPTION 
{% endcapture %}{% include image_left_without_caption.html %}

Include file: _includes/image_left_without_caption.html

<div>
  <p><img height="{{ height }}" src="../i/{{ image }}" alt="{{ alt }}"></p>
</div> 
<div style="clear: both;"></div>

Example,

Ant in droplet of amber

Regular text follows.

Image_left_with_caption

Insert template into markdown,

{% capture image %}IMAGE_FILE_NAME{% endcapture %}
{% capture alt %}ALT TEXT{% endcapture %}
{% capture height %}200px{% endcapture %} 
{% capture caption %}
CAPTION
{% endcapture %}{% include image_left_with_caption.html %}

Include file: _includes/image_left_with_caption.html

<div style="clear: both;">
  <div style="float: left; margin-right: 1em;">
    <img height="{{ height }}" src="../i/{{ image }}" alt="{{ alt }}">
  </div>
  <div class="caption">
    {{ caption | markdownify }}
  </div>
</div>
<div style="clear: both;">&nbsp;</div>

Example,

Ant in droplet of amber

This is an ant captured in a fossilized droplet of amber.

 

Image_left_with_text

Insert template into markdown,

{% capture image %}IMAGE FILE NAME{% endcapture %} 
{% capture alt %}ALT TEXT{% endcapture %}  
{% capture height %}200px{% endcapture %}  
{% capture description %} 
DESCRIPTION 
{% endcapture %}{% include image_left_with_text.html %}

Include file: _includes/image_left_with_text.html

<div style="clear: both;">
  <div style="float: left; margin-right: 1em;">
    <img height="{{ height }}" src="../i/{{ image }}" alt="{{ alt }}">
  </div>
  <div>
    {{ description | markdownify }}
  </div>
</div>
<div style="clear: both;">&nbsp;</div>

Example,

Ant encased in a drop of amber

Amber is the fossilized form of tree resin, basically a natural form of plastic.

 

Image_right_with_caption

Insert template into markdown,

{% capture image %}IMAGE FILE NAME{% endcapture %} 
{% capture alt %}ALT TEXT{% endcapture %} 
{% capture height %}200px{% endcapture %}   
{% capture caption %} 
CAPTION 
{% endcapture %}{% include image_right_with_caption.html %}

Include file: _includes/image_right_with_caption.html

<div style="clear: both;">
  <div style="float: right; margin-left: 1em;">
    <img height="{{ height }}" src="../i/{{ image }}" alt="{{ alt }}">
  </div>
  <div class="caption">
    {{ caption | markdownify }}
  </div>
</div>
<div style="clear: both;">&nbsp;</div>

Example,

ALT TEXT

Dial of a typical multimeter.

 

Image_right_with_text

Insert template into markdown,

{% capture image %}IMAGE FILE NAME{% endcapture %} 
{% capture alt %}ALT TEXT{% endcapture %} 
{% capture height %}200px{% endcapture %}    
{% capture description %} 
DESCRIPTION 
{% endcapture %}{% include image_right_with_text.html %}

Include file: _includes/image_right_with_text.html

<div style="clear: both;">
  <div style="float: right; margin-left: 1em;">
    <img height="{{ height }}" src="../i/{{ image }}" alt="{{ alt }}">
  </div>
  <div>
    {{ description | markdownify }}
  </div>
</div>
<div style="clear: both;">&nbsp;</div>

Example,

ALT TEXT

Find the ‘diode’ setting on your multimeter. This can be used to determine the forward conducting direction of the diode. Use this if the marking on the diode is unclear.

 

Caption style

Typical style for a caption, specified in assets/main.scss,

$grey-color:         #757575 !default;

.caption {
    color: $grey-color;
    font-size: $small-font-size;
}