You've already forked wp-bootstrap
- Register sidebar widget area via register_sidebar() - Render WordPress widgets in Twig sidebar with fallback to built-in content - Update README.md with accurate feature counts and descriptions - Update translation files with widget area strings - Bump version to 1.0.0 Co-Authored-By: Claude <noreply@anthropic.com>
49 lines
1.7 KiB
Twig
49 lines
1.7 KiB
Twig
<aside aria-label="{{ __('Blog sidebar') }}">
|
|
{% if sidebar.widgets_active %}
|
|
{{ sidebar.widgets_html|raw }}
|
|
{% else %}
|
|
{% if sidebar.recent_posts is defined and sidebar.recent_posts|length > 0 %}
|
|
<div class="mb-4">
|
|
<h3 class="sidebar-heading h6 text-uppercase fw-semibold">
|
|
{{ __('Recent Posts') }}
|
|
</h3>
|
|
<ul class="list-unstyled">
|
|
{% for post in sidebar.recent_posts %}
|
|
<li class="mb-2">
|
|
<a href="{{ post.url }}" class="text-decoration-none">{{ post.title }}</a>
|
|
<br>
|
|
<small class="text-body-secondary">{{ post.date }}</small>
|
|
</li>
|
|
{% endfor %}
|
|
</ul>
|
|
</div>
|
|
|
|
<hr>
|
|
{% endif %}
|
|
|
|
<div class="mb-4">
|
|
<h3 class="sidebar-heading h6 text-uppercase fw-semibold">
|
|
{{ __('Search') }}
|
|
</h3>
|
|
{% include 'partials/search-form.html.twig' %}
|
|
</div>
|
|
|
|
<hr>
|
|
|
|
{% if sidebar.tags is defined and sidebar.tags|length > 0 %}
|
|
<div class="mb-4">
|
|
<h3 class="sidebar-heading h6 text-uppercase fw-semibold">
|
|
{{ __('Tags') }}
|
|
</h3>
|
|
<div>
|
|
{% for tag in sidebar.tags %}
|
|
<a href="{{ tag.url }}" class="badge bg-secondary text-decoration-none me-1 mb-1">
|
|
{{ tag.name }}
|
|
</a>
|
|
{% endfor %}
|
|
</div>
|
|
</div>
|
|
{% endif %}
|
|
{% endif %}
|
|
</aside>
|