from flask import Blueprint, render_template, current_app
from flask_htmx import htmx
from jinja2_fragments import render_block

changelog_bp = Blueprint('changelog', __name__)

@changelog_bp.route('/')
def show_changelog():
    """Renders the changelog page."""
    template_name = 'changelog/changelog.html' # Path relative to templates/
    if htmx:
        # If request is from HTMX, render only the content block
        return render_block(current_app.jinja_env, template_name, 'content')
    # Otherwise, render the full page
    return render_template(template_name)