Skip to content

Commit

Permalink
Merge pull request #41 from skylogic004/master
Browse files Browse the repository at this point in the history
Fix links and description. And added an example.
  • Loading branch information
eteubert authored Jun 21, 2024
2 parents cf967f3 + 9f7eabb commit 47480bd
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 5 deletions.
4 changes: 2 additions & 2 deletions publisher/api.json
Original file line number Diff line number Diff line change
Expand Up @@ -6954,12 +6954,12 @@
"AssetId": {
"name": "asset_id",
"in": "path",
"description": "Unique identifier for the asset.",
"description": "Unique identifier for the asset. Each asset in an episode's set of assets has an ID starting from 1 (e.g., the first asset has asset_id=1, the second asset has asset_id=2, and so on).",
"required": true,
"schema": {
"type": "string"
}
}
}
}
}
}
24 changes: 21 additions & 3 deletions publisher/guides/templates.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,24 @@ To use them in another template, you need to import the macros before using them
{% endraw %}
```

### Filters

Twig filters can be used to filter the list of episodes. For example, this filter selects only the episodes from the year 2024:

```handlebars
{% set filtered_episodes = podcast.episodes|filter(episode => episode.publicationDate.format('Y') == "2024") %}
<ul>
{% for episode in filtered_episodes %}
<li>
<a href="{{ episode.url }}">
{{ episode.title }}
</a> — {{ episode.subtitle }}
</li>
{% endfor %}
</ul>
```

## Creating PHP Templates — For Theme Developers

_Available from Podlove Publisher version 2.3_
Expand Down Expand Up @@ -254,7 +272,7 @@ echo get_podcast()->title();
?>
```

[1]: http://twig.sensiolabs.org/
[2]: http://twig.sensiolabs.org/doc/templates.html
[1]: https://twig.symfony.com/
[2]: https://twig.symfony.com/doc/3.x/templates.html
[3]: /podlove-publisher/reference/templates/template-tags/podcast
[4]: http://twig.sensiolabs.org/doc/tags/macro.html
[4]: https://twig.symfony.com/doc/3.x/tags/macro.html

0 comments on commit 47480bd

Please sign in to comment.