Is there a way to do this? I have a template which outputs one blog article.

Now, on index page I show 10 articles by including that template in for loop and on show page I only show one.

index:

{% block stylesheets %}
    {# some stylesheets here #}
{% endblock %}

{% for article in articles %}
        {% include VendorBundle:article.html.twig with { 'article': article } %}
{% endfor %}

show:

{% block stylesheets %}
      {# some stylesheets here #}
{% endblock %}

{% include VendorBundle:article.html.twig with { 'article': article } %}

Now is there a way to make article.html.twig add something to {% block stylesheets %} of templates that included it automatically? If it is possible, how do I prevent it from adding that 10 times when using for loop?

I'm trying to make my "fragment" templates (templates used for inclusion) define stylesheets that they use and make them "inject" those into page.

Edit
Report