Skip to Content
StoreOSv0.27.1
ThemesContexts

Blog

The blog context in a StoreOS Fluid theme, with its route, widgets, the blog object and an example widget.

The blog context renders the list of articles.

Route

/blog

Widgets

The widgets listed under pages.blog in the theme document.

{ "pages": { "blog": ["blog-header", "article-list"] } }

Data

ObjectContents
blogtitle, url, articles and articles_count. See blog
page_titleBlog

Plus the data on every page.

blog.articles holds the latest 24 articles. Each is an article.

Filters

date formats published_at: {{ article.published_at | date: "%B %-d, %Y" }}. image_url prints an article's image.

Example

{% comment %} widgets/article-list.fluid {% endcomment %}
<section class="articles">
  <h1>{{ blog.title }}</h1>
  <ul>
    {% for article in blog.articles %}
      <li>
        <a href="{{ article.url }}">
          {% if article.image %}<img src="{{ article.image | image_url }}" alt="{{ article.title }}" loading="lazy">{% endif %}
          <h2>{{ article.title }}</h2>
        </a>
        <p>
          {{ article.author }}
          <time datetime="{{ article.published_at }}">{{ article.published_at | date: "%B %-d, %Y" }}</time>
        </p>
      </li>
    {% else %}
      <li>No articles yet.</li>
    {% endfor %}
  </ul>
</section>

On this page