{% extends 'base.html' %}
{% block content %}
<div class="container mt-5">
    <div class="row">
        <div class="col-md-8 offset-md-2">
            <h1 class="mb-4">Knowledge Base</h1>
            {% for article in articles %}
                <div class="card mb-3">
                    <div class="card-body">
                        <h2 class="card-title"><a href="#">{{ article.title }}</a></h2>
                        <p class="card-text">{{ article.content|truncatewords:50 }}</p>
                        <p class="card-text"><small class="text-muted">Published on {{ article.created_at|date:"F d, Y" }} by {{ article.author }}</small></p>
                    </div>
                </div>
            {% empty %}
                <p>No articles found.</p>
            {% endfor %}
        </div>
    </div>
</div>
{% endblock %}
