{# A detail page's rating; IMDb's opens the title's IMDb page in a new tab. #} {% macro rating(text, imdb_url) %} {% if text and imdb_url and text.startswith('IMDb') %} {{ text }} {%- elif text %} {{ text }} {%- endif %} {% endmacro %}