{{> head}}
    {{> navbar}}
    <main class="main page page--tag">
        {{#tag}}
            <div class="hero">
                {{#if tagViewConfig.displayPostCounter}}
                    <span class="hero__suptitle">
                       {{postsNumber}}
                       {{ translate "listing.post" (math postsNumber '+' 0)}}
                    </span>
                {{/if}}
                <h1>{{name}}</h1>
                {{#if tagViewConfig.displayDescription}} 
                    {{#if description}}
                        <div class="hero__meta wrapper">
                            {{{description}}}
                        </div>
                    {{/if}}
                {{/if}}
            </div>
            {{#if tagViewConfig.displayPostList}} 
                <div class="l-cards{{#if @config.custom.cardsReverse}} l-cards--reverse{{/if}}">
                    {{#each ../posts}}
                        <article class="c-card{{#if @config.custom.cardsFeaturedBadge}}{{#isFeatured}} c-card--featured{{/isFeatured}}{{/if}}">
                            {{#featuredImage}}
                                {{#if url}}
                                    <a href="{{../url}}" class="c-card__image">
                                        <img
                                            src="{{url}}"
                                            {{#if @config.site.responsiveImages}}
                                                {{responsiveImageAttributes 'featuredImage' srcset.cards sizes.cards}}
                                            {{/if}}
                                            {{ lazyload "lazy" }}
                                            height="{{height}}"
                                            width="{{width}}"
                                            alt="{{alt}}">
                                    </a>
                                {{/if}}
                            {{/featuredImage}}
                            <div class="c-card__text">
                                <header>
                                    <h2>
                                        <a href="{{url}}" class="inverse">
                                            {{title}}
                                        </a>
                                    </h2>
                                    {{#checkIfAny @config.custom.cardsAuthor @config.custom.cardsDate}}
                                        <p class="c-card__meta">
                                            {{#author}}
                                                {{#if @config.custom.cardsAuthor}}
                                                    <a href="{{url}}" title="{{name}}">{{name}}</a>
                                                {{/if}}
                                            {{/author}}
                                            {{#if @config.custom.cardsDate}}
                                                <time datetime="{{date createdAt 'YYYY-MM-DDTHH:mm'}}">
                                                    {{#checkIf @config.custom.formatDate '!=' 'custom'}}
                                                        {{date createdAt @config.custom.formatDate}}
                                                    {{else}}
                                                        {{date createdAt @config.custom.formatDateCustom}}
                                                    {{/checkIf}}
                                                </time>
                                            {{/if}}
                                        </p>
                                    {{/checkIfAny}}
                                </header>
                                {{#if @config.custom.cardsExcerpt}}
                                    {{#if excerpt}}
                                        <p class="c-card__desc">{{{excerpt}}}</p>
                                    {{/if}}
                                {{/if}}
                                {{#if @config.custom.cardsReadmore}}
                                    <a href="{{url}}" class="btn c-card__btn">{{ translate 'post.readMore' }}</a>
                                {{/if}}
                            </div>
                        </article>
                    {{/each}}
                </div>
                {{> pagination}}
            {{/if}}
        {{/tag}}
    </main>
{{> footer}}

