{#
/**
 * @file
 * Gutenberg Base theme override to display a node.
 *
 * Wraps Gutenberg block content with entry-content and is-layout-constrained
 * classes so block alignment (alignwide, alignfull) works on the frontend
 * just like in the editor.
 *
 * Available variables:
 * - node: The node entity with limited access to object properties and methods.
 * - label: (optional) The title of the node.
 * - content: All node items.
 * - author_picture: The node author user entity, rendered using the "compact"
 *   view mode.
 * - date: (optional) Themed creation date field.
 * - author_name: (optional) Themed author name field.
 * - url: Direct URL of the current node.
 * - display_submitted: Whether submission information should be displayed.
 * - attributes: HTML attributes for the containing element.
 * - title_attributes: Same as attributes, except applied to the main title tag.
 * - content_attributes: Same as attributes, except applied to the main
 *   content tag.
 * - author_attributes: Same as attributes, except applied to the author of
 *   the node tag.
 * - title_prefix: Additional output populated by modules.
 * - title_suffix: Additional output populated by modules.
 * - view_mode: View mode; for example, "teaser" or "full".
 * - teaser: Flag for the teaser state.
 *
 * @see \Drupal\node\Hook\NodeThemeHooks::preprocessNode()
 */
#}
{%
  set classes = [
    'node',
    'node--type-' ~ node.bundle|clean_class,
    node.isPromoted() ? 'node--promoted',
    node.isSticky() ? 'node--sticky',
    not node.isPublished() ? 'node--unpublished',
    view_mode ? 'node--view-mode-' ~ view_mode|clean_class,
  ]
%}

<article{{ attributes.addClass(classes) }}>

  <header class="node__header">
    {{ title_prefix }}
    {% if label and view_mode != "full" %}
      <h2{{ title_attributes.addClass('node__title') }}>
        <a href="{{ url }}" rel="bookmark">{{ label }}</a>
      </h2>
    {% endif %}
    {{ title_suffix }}

    {% if display_submitted %}
      <div class="node__meta">
        {% if author_picture %}
          <div class="node__author-image">
            {{ author_picture }}
          </div>
        {% endif %}
        <span{{ author_attributes }}>
          {{ 'By'|t }} <span class="node__author">{{ author_name }}</span>, {{ date }}
        </span>
        {{ metadata }}
      </div>
    {% endif %}
  </header>

  <div{{ content_attributes.addClass('node__content', 'entry-content', 'is-layout-constrained') }}>
    {{ content }}
  </div>

</article>
