Pika Variables
You can use various special variables in your posts and pages to do things like add some recent blog posts to a custom home page. Note: They don’t work inside inline code or code blocks. Here’s what Pika supports:
- Blog post variables
- Blog tag variables
- Letterbird contact form variable
- Newsletter subscribe form variable
- Search form variable
- Table of contents variable
Output your blog posts
There are three variables to output your blog posts:
- {{ posts }} and {{ posts_by_year }} output your posts in a list layout.
- {{ posts_in_stream }} outputs your posts in a stream layout.
They can all be customized by a number of parameters, like this example:
{{ posts limit: 10 skip: 5 tag: "Bill Murray" without_tag: "Chevy Chase" has_title: yes sent_as_newsletter: no sort: alpha }}
These lists are paginated by default. Set page_size to control how many posts appear per page
(the default is 100 for post lists and 20 for post streams).
Add paginate: no to turn pagination off and show the whole list, up to limit.
{{ posts page_size: 10 }}
Optional parameters
limit-
With pagination on (the default),
limitcaps the total number of posts you can page through. There is no maximum — leave it off to page through every post. When pagination is off (paginate: no),limitis the number of posts shown: it defaults to 500 for post list variables and 20 for post stream variables, and is capped at 500 (lists) and 50 (streams). skip- Skip the first n posts.
tag- Only include posts with the specified tag.
without_tag- Exclude posts with the specified tag.
has_titleyes(only posts with titles) orno(only posts without titles).sent_as_newsletteryes(only posts sent as newsletters) orno(only posts not sent as newsletters).year-
Only include posts published in the given year. Example: {{ posts year: 2025 }}
Use
currentto always show posts from the current year: {{ posts year: current }} Usenot_currentto show posts from every year except the current one: {{ posts year: not_current }} on_this_month,on_this_week,on_this_day-
“On this day”–style filters that show posts from your entire blog history (any year):
on_this_month— posts published during the current month. Example: {{ posts on_this_month }}on_this_week— posts published during the current calendar week. Weeks run Monday through Sunday. Example: {{ posts on_this_week }}on_this_day— posts published on the current month and day. Example: {{ posts on_this_day }}
on_this_daybeatson_this_weekbeatson_this_month. sort- Use
alphato override the default sorting by date. This parameter only works with the {{ posts }} variable. random-
To show posts in random order, use
yesto override the default, which isno. Pagination is not allowed with random ordering and will automatically be disabled if you include the random option. A page containing a random list reshuffles periodically (about every 30 seconds) rather than on every single visit. Random ordering is not available on {{ posts_by_year }}. Example: {{ posts random: yes }} with_excerpts- Use
noto override the default, which isyes(showing excerpts with “Continue reading” links). This parameter only works with the {{ posts_in_stream }} variable. paginate-
Pagination is on by default. Use
noto disable it and render the entire list (up tolimit) with no page navigation. Each list variable on a post or page paginates independently, each with its own page link. Pages are navigated on the web; in email newsletters the list shows its first page. page_size-
When paginating, the number of posts shown per page. Defaults to 100
for post list variables and 20 for post stream variables.
The maximum page size is 500 for post list variables and
50 for post stream variables.
limitstill caps the total number of posts paginated across all pages.
Output your blog tags
There are two variables to output your blog post tags:
- {{ tags }} outputs an alphabetical, comma-separated list of your blog tags.
- {{ tag_list }} outputs an alphabetical HTML list of your blog tags.
Optional parameters
separator- Use a custom tag separator in place of a comma in the {{ tags }} variable. Example: {{ tags separator: " | " }}
Output your Letterbird contact form
Letterbird is another service from Good Enough that allows you to create a simple contact form. While it has its own embed code, Pika has a first-class variable for you to embed your form (like on a contact page):
{{ letterbird_form user: yourusername }}
Optional parameters
user- Your Letterbird username. This is a required parameter.
showheader- Include your Letterbird form header.
Output your Newsletter subscribe form
While there’s an option in Newsletter Settings to automatically include your subscription form on your site, you can also embed your form anywhere with this variable:
{{ newsletter_subscription_form }}
There are no parameters for this variable.
Output your Search form
If you have Site Search enabled, you can embed a search form anywhere with this variable:
{{ search_form }}
There are no parameters for this variable.
Output a table of contents
Automatically generate a linked table of contents from all the headings (h1–h6) in the body of your post or page:
{{ table_of_contents }}
It can be customized by a couple of parameters, like this example:
{{ table_of_contents heading: "On This Page" only_headers: "h2 h3" }}
Optional parameters
heading- A title to display above the table of contents as an H2, which is not included in the table of contents list itself.
only_headers- A space-separated list of heading levels (h1-h6) to include.