Skip to content

v0.0.1

Choose a tag to compare

@paqstd-dev paqstd-dev released this 29 Oct 07:12
· 8 commits to main since this release

Django Simple Components is a small package to easily create components inside your templates without saving them in the templates folder.

{% load simple_components %}

{% set_component "first_component" %}
    <div class="card">
        <h3>{{ title }}</h3>
        <p>{{ description }}</p>
    </div>
{% end_set_component %}

<div class="card-list">
    {% component "first_component" title="Hello world!" description="Some text..." %}
    {% component "first_component"
        title="Some lines"
        description="Other text..."
    %}

    {% with value="this text will be capitalized later" %}
        {% component "first_component" title=123 description=value|capfirst %}
    {% endwith %}
</div>