ʕ ꈍᴥꈍʔ Bear docs

Embedding blog post lists

The blog post embed allows you to inject a list of blog posts into your content dynamically. This can be done in any content on your blog including posts, the homepage, and footer. This feature supports various filters and settings that you can apply to customize the output.

Syntax

The base syntax for embedding posts is as follows:

{{ posts }}

Optional Filters and Parameters

Additional filters and parameters can be appended to the base syntax following a separator |.

1. tag: Filters posts by a specific tag.

## Posts with tag "news"
{{ posts|tag:"news" }}

2. limit: Limits the number of posts to display.

## Check out my last 5 posts
{{ posts|limit:5 }}

3. order: Orders the posts by publication date. Posts are descending by default.

## Ordered ascending
{{ posts|order:asc }}

## Or descending 
{{ posts|order:desc }}

4. description: Controls the visibility of the meta_description of the post.

## Show excerpt
{{ posts|description:True }}

Note: Additional CSS work will be required to format the blog list with descriptions correctly. The embedded posts have a classname of embed.

5. content: Controls the visibility of the full content of the post.

## Show full post content
{{ posts|limit:3|content:True }}

Note: Content can only be active on pages and the homepage (not posts). Additional CSS work will be required to format the blog list with descriptions correctly. The embedded posts have a classname of embed. The following CSS will do 90% of the work in styling the content:

ul.embedded.blog-posts li {
    display: flex;
    flex-flow: row wrap;
}

Patterns can be combined in any order:

{{ posts|tag:"tagname"|limit:5|order:asc|description:True }}

Spaces are optional around the filter delimiters. The following examples are equivalent:

{{ posts|limit:5 }}
{{ posts | limit:5 }}

Here's an example running on this site:

### Most recent posts
{{ posts|limit:5 }}

Most recent posts