Sha256: 04e4361f9a95fd1b1584196e3a46b7e8472fec2f20176ae56df7f1d43e636e5f

Contents?: true

Size: 1.14 KB

Versions: 1

Compression:

Stored size: 1.14 KB

Contents

{%- assign count = include.count | default: 3 -%}
{%- assign posts = include.posts -%}
{%- unless posts -%}
  {%- include functions/get_recent_posts.liquid count=count -%}
  {%- assign posts = return -%}
{%- endunless -%}

<div class="c-blog-grid">
  {%- for post in posts -%}
    {%- assign html = post.content | markdownify -%}
    {%- capture page_title -%}
      {%- include functions/get_page_title.liquid page=post -%}
    {%- endcapture -%}
    {%- capture thumbnail -%}
      {%- include functions/get_page_thumbnail.liquid page=post html=html autodetect=true -%}
    {%- endcapture -%}

    <a class="c-blog-grid__item" href="{{- post.url | relative_url -}}">
      <div class="c-blog-grid__thumbnail">
        {%- if thumbnail.size > 0 -%}
            <img src="{{- thumbnail -}}" />
        {%- endif -%}
      </div>
      <div class="c-blog-grid__body">
        <div class="c-blog-grid__title">
            {{- page_title -}}
        </div>
        <div class="c-blog-grid__content">
          {{- html | strip_html | truncate: 200 -}}
        </div>
      </div>
      <div class="c-blog-grid__footer">
      </div>
    </a>
  {%- endfor -%}
</div>

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
databook-theme-0.1.2 _includes/blog/features.liquid