Skip to Content
StoreOSv0.27.1
ThemesContexts

Blog post

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

The blog post context renders a single article. Its document page is blog-post, and its object is article.

Route

/blog/:handle

:handle is the article's handle, such as /blog/spring-lookbook. A handle that matches no article isn't rendered by the theme.

Widgets

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

{ "pages": { "blog-post": ["article-content"] } }

Data

ObjectContents
articleThe article being viewed. See article
page_titleThe article's title
page_descriptionA short description made from the start of the article

Plus the data on every page.

article.content is HTML written by the merchant, printed as-is.

Example

{% comment %} widgets/article-content.fluid {% endcomment %}
<article class="article">
  <header>
    <h1>{{ article.title }}</h1>
    <p>
      {{ article.author }}
      <time datetime="{{ article.published_at }}">{{ article.published_at | date: "%B %-d, %Y" }}</time>
    </p>
    {% if article.image %}
      <img src="{{ article.image | image_url }}" alt="{{ article.title }}">
    {% endif %}
  </header>

  <div class="article-content">{{ article.content }}</div>

  {% if article.tags.size > 0 %}
    <ul class="tags">
      {% for tag in article.tags %}<li>{{ tag }}</li>{% endfor %}
    </ul>
  {% endif %}
</article>

On this page