news-reader-php/templates/entry/_single.html.twig

39 lines
1.7 KiB
Twig
Raw Permalink Normal View History

<article>
<h1><a href="{{ path('entry', {slug: entry.slug}) }}">{{ entry.name }}</a></h1>
<time>{{ entry.published | format_datetime(dateFormat = 'medium', timeFormat = 'short') }}</time>
<main>
{% if short is defined and short %}
{{ entry.content | striptags() | u.truncate(1000, '…') }}
<p><a href="{{ path('entry', {slug: entry.slug}) }}">Read more …</a></p>
{% else %}
{# TODO: Use something like parsefunc from TYPO3 to output allowed and secured content #}
{# Also in entries.html.twig? But with different configuration #}
{# <main>{{ entry.content | striptags('<p>,<a>,<strong>,<i>,<h1>,<h2>,<h3>,<h4>,<ul>,<li>') | raw }}</main> #}
{{ entry.content | striptags('<p>,<a>,<strong>,<i>,<h1>,<h2>,<h3>,<h4>,<ul>,<li>') | raw }}
{% endif %}
</main>
<nav>
{% if entry.url %}
<a href="{{ entry.url }}" target="_blank"
rel="external nofollow noopener noreferrer"
referrerpolicy="no-referrer">Entry URL</a>
{% endif %}
<a href="{{ entry.feed.url }}" target="_blank"
rel="external nofollow noopener noreferrer"
referrerpolicy="no-referrer">Feed URL</a>
<a href="{{ path('bucket', {slug: entry.feed.bucket.slug}) }}">{{ entry.feed.bucket.name }} bucket</a>
<a href="{{ path('feed', {slug: entry.feed.slug}) }}">{{ entry.feed.name }} feed</a>
{% if entry.wasRead %}
<a href="{{ path('entry-mark-as-un-read', {slug: entry.slug}) }}">Mark as unread</a>
{% else %}
<a href="{{ path('entry-mark-as-read', {slug: entry.slug}) }}">Mark as read</a>
{% endif %}
</nav>
</article>