<div>

<h4>Recent posts</h4>
<ul>
    {% for post in site.posts limit:5 %}
    <li><a href="{{ post.url | relative_url }}">{{ post.title | strip }}</a></li>
    {% endfor %}
</ul>

{%- if page.categories.size > 0 -%}
<h4>Categories</h4>
<ul>
    {% for category in page.categories limit:5 %}
    {%- capture link -%}  
        /categories/#posts_in_{{ category | slugify }}_heading
    {%- endcapture -%}
    <li><a href="{{ link | relative_url }}">{{ category | strip }}</a>
    </li>
    {% endfor %}
</ul>
{%- endif -%}

{%- if page.tags.size > 0 -%}
<h4>Tags</h4>
<ul>
    {% for tag in page.tags limit:5 %}
    {%- capture link -%}
        /tags/#posts_in_{{ tag | slugify }}_heading
    {%- endcapture -%}
    <li><a href="{{ link | relative_url }}">{{ tag | strip }}</a></li>
    {% endfor %}
</ul>
{%- endif -%}

{% if page.show_ads %}
    {%- include ads.html ad_src="google-adsense" ad_type="links" -%}
{% endif %}

</div>