eiriksm/twigjs-drupal8

View on GitHub
templates/node.html.twig

Summary

Maintainability
Test Coverage
{#
/**
 * @file
 */
#}
<article{{ attributes.addClass(classes) }}>

  <header>
    {{ title_prefix }}
    {% if not page %}
      <h2 class="node__title">
        <a href="{{ url }}" rel="bookmark">{{ label }}</a>
      </h2>
    {% else %}
      <h2 class="node__title">
        {{ label }}
      </h2>
    {% endif %}
    {{ title_suffix }}

    {% if display_submitted %}
      <div class="node__meta">
        {{ author_picture }}
        <span{{ author_attributes }}>
          {% trans %}Submitted by {{ author_name }} on {{ date }}{% endtrans %}
        </span>
        {{ metadata }}
      </div>
    {% endif %}
  </header>

  {% if page %}
  <div class="node__content clearfix" {{ content_attributes.addClass('node__content', 'clearfix') }}>
    {{ content|without('comment', 'links') }}
  </div>
  {% endif %}

  {% if not page %}
  <div class="readmore-link">
    <a href="{{ url }}" rel="bookmark">{% trans %}Read more{% endtrans %}</a>
  </div>
  {% endif %}

  {{ content.comment }}

</article>