Docs contents

Templates

A template decides the text of each post. Every route has its own, so one feed can read differently on each destination.

Where to edit one

  1. Open the feed, and choose Edit next to a destination under Posts to.
  2. Write in Template. The buttons below it insert a field or a filter at the cursor.
  3. Watch Preview. It renders the template against the 3 latest items in the feed the way the destination would post them, and shows how each post's length compares to the destination's limit.
  4. Choose Save. You should see Changes saved, and the next item posts with the new template.

To start over, choose Use the default, which puts back the destination's default template.

If a post comes out too long, Preview shows it over the limit before you save. A post that's still too long when it's sent gets cut to fit, and Activity notes the cut.

The syntax

A template is plain text with two kinds of tags: output tags in {{ }} and condition tags in {% %}.

Output

{{ title }} writes the item's title. A filter after a | changes the value:

{{ summary | strip_html | truncate: 200 }}
  • Filters run left to right, and each one works on the result of the one before it.
  • A filter's arguments go after a colon and are separated by commas. Put text in quotes, as in {{ url | with_campaign: "mastodon", "social" }}.

Conditions

{{ title }}{% if tags %}

{{ tags | as_hashtags }}{% else %} (no tags){% endif %}
  • {% if field %} is true when the field isn't empty. That means text with something in it, a list with at least one entry, or a date that the feed provided.
  • {% else %} is optional, but every if needs an {% endif %} to close it.
  • You can nest an if inside another up to 8 levels deep.

Whitespace

A - inside a tag's brace, as in {{- or -%}, removes every space and line break on that side. Use it to keep a condition from leaving a blank line behind.

Limits

There are no loops and no variables, which means every template finishes running. A template can be up to 4000 characters long.

An example

This template:

{{ title }}

{{ summary | strip_html | truncate: 148 }}

{{ url | without_tracking }}{% if tags %}

{{ tags | as_hashtags }}{% endif %}

turns an item titled "I'm not excited about tech anymore" into this post:

I'm not excited about tech anymore

I'm not excited about tech any more. For the longest time I was excited about new devices, new apps, new platforms—all of it. I've gradually lost...

https://www.coryd.dev/posts/2026/im-not-excited-about-tech-anymore

Defaults

A new route starts with its destination's default template. A webhook doesn't have one, because its body includes the item instead. See Webhook.

Mastodon:

{{ title }}

{{ url }}{% if tags %}

{{ tags | as_hashtags }}{% endif %}

Bluesky:

{{ title }}

{{ url }}

Discord:

{{ title }}
{{ url }}

Telegram:

{{ title }}
{{ url }}

Micropub:

{{ title }}

{{ url }}

Matrix:

{{ title }}

{{ url }}

Repository:

{{ summary }}

{{ url }}

Mistakes

The editor shows each mistake where it is, with its line and column, and how to fix it. A name that isn't a field, a filter that doesn't exist, and an if without its endif are all mistakes. A template with a mistake won't save, and you'll see the same message when you try.

Fields

Field Type What it contains
title text The item's title.
url text The item's link.
summary text The item's summary. It may include HTML; strip_html removes it.
content text The item's full content, as HTML.
author text The item's author.
tags list The item's tags.
image text The address of the item's first image.
published date When the item was published. Empty when the feed gives no date. Format it with date.
feed.title text The feed's name, or its own title when you didn't name it.
feed.url text The feed's site address, not the feed's own address.

Filters

Filter Example Takes Gives What it does
truncate truncate: 200 text text Cuts text to at most that many characters, ... included. A second argument sets the ending, as in truncate: 100, "".
strip strip text text Removes spaces and line breaks from both ends.
strip_html strip_html text text Removes HTML tags and decodes entities, leaving plain text.
downcase downcase text text Lowercases the text.
upcase upcase text text Uppercases the text.
join join: ", " list text Joins a list with the text you give, or a space.
first first list text The list's first entry.
default default: "New post" anything text The text you give when the value is empty. Otherwise the value, with a list joined by commas.
date date: "%b %-d, %Y" date text Formats a date. It knows %a %A %b %B %d %-d %e %H %I %-I %m %-m %M %p %Y %y %Z and %%. A second argument names a time zone, as in date: "%H:%M", "America/New_York"; without one, it's UTC.
slugify slugify text text Lowercases, leaves letters and digits, and turns each run of anything else into one -.
as_hashtags as_hashtags list text Writes tags as hashtags: open source becomes #OpenSource. A repeated tag appears once.
without_tracking without_tracking text text Drops tracking parameters from a link: every utm_ parameter and common click IDs.
with_campaign with_campaign: "mastodon", "social" text text Adds utm_source and utm_medium to a link, replacing any already there.

Something wrong on this page? Contact support@publishedt.app.