{% extends request.ajax ? "layout_blank.html.twig" : "layout_default.html.twig" %}
{% set active_menu = 'kb' %}

{% block meta_title %}{{ article.title }}{% endblock %}
{% block meta_description %}{{ (article.content ?? '')|markdown_to_html|striptags|trim|truncate(160) }}{% endblock %}

{% block body_class %}kb-article{% endblock %}
{% block breadcrumb %}
<li class="breadcrumb-item">
    <a href="{{ 'support/kb'|url }}">{{ 'Knowledge Base'|trans }}</a>
</li>
<li class="breadcrumb-item">
    <a href='{{ "support/kb/#{article.category.slug}"|url }}'>{{ article.category.title }}</a>
</li>
<li class="breadcrumb-item active" aria-current="page">{{ article.title }}</li>
{% endblock %}

{% block content %}
<div class="row">
    <div class="col-md-12">
        <div class="card mb-4">
            <div class="card-header py-3 py-3">
                <div class="d-flex justify-content-between align-items-center">
                        <h1 class="mb-1">{{ article.title }}</h1>
                        <span class="small text-muted">{{ article.views }} {{ 'Views'|trans }}</span>
                </div>
            </div>
            <div class="card-body">
                <div class="list-group ms-2">
                    {{ (article.content ?? '')|markdown_to_html }}
                </div>
            </div>
            <div class="card-footer">
                <a href="{{ 'support/kb'|url }}" class="btn btn-primary btn-sm" type="button">{{ 'Go Back'|trans }}</a>

                <a href='{{ "support/kb/#{article.category.slug}"|url }}' class="btn btn-primary btn-sm" type="button">{{ 'Similar Articles'|trans }}</a>
            </div>
        </div>
    </div>
</div>
{% endblock %}
