You've already forked wp-bootstrap
v0.1.1 - Bootstrap frontend rendering via Twig templates
Replace FSE block markup on the frontend with proper Bootstrap 5 HTML rendered through Twig templates. The Site Editor remains functional for admin editing while the public site outputs Bootstrap navbar, cards, pagination, grid layout, and responsive components. New PHP classes: TemplateController, ContextBuilder, NavWalker New Twig templates: 20 files (base, pages, partials, components) Enhanced TwigService with WordPress functions and globals Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
17
views/components/card-post-grid.html.twig
Normal file
17
views/components/card-post-grid.html.twig
Normal file
@@ -0,0 +1,17 @@
|
||||
<article class="card h-100">
|
||||
{% if post.thumbnail %}
|
||||
<a href="{{ post.url }}">
|
||||
<img src="{{ post.thumbnail }}" class="card-img-top"
|
||||
alt="{{ post.title|e('html_attr') }}"
|
||||
style="aspect-ratio: 3/2; object-fit: cover;">
|
||||
</a>
|
||||
{% endif %}
|
||||
<div class="card-body">
|
||||
<h3 class="card-title h6">
|
||||
<a href="{{ post.url }}" class="text-decoration-none text-body">{{ post.title }}</a>
|
||||
</h3>
|
||||
<p class="card-text text-body-secondary small">
|
||||
<time datetime="{{ post.date_iso }}">{{ post.date }}</time>
|
||||
</p>
|
||||
</div>
|
||||
</article>
|
||||
21
views/components/card-post.html.twig
Normal file
21
views/components/card-post.html.twig
Normal file
@@ -0,0 +1,21 @@
|
||||
<article class="card mb-4 border-0 border-bottom rounded-0 pb-4">
|
||||
{% if post.thumbnail %}
|
||||
<a href="{{ post.url }}">
|
||||
<img src="{{ post.thumbnail }}" class="card-img-top rounded" alt="{{ post.title|e('html_attr') }}">
|
||||
</a>
|
||||
{% endif %}
|
||||
<div class="card-body px-0">
|
||||
<h2 class="card-title h4">
|
||||
<a href="{{ post.url }}" class="text-decoration-none text-body">{{ post.title }}</a>
|
||||
</h2>
|
||||
<div class="text-body-secondary small mb-2">
|
||||
<time datetime="{{ post.date_iso }}">{{ post.date }}</time>
|
||||
<span class="mx-1">·</span>
|
||||
<a href="{{ post.author.url }}" class="text-body-secondary text-decoration-none">{{ post.author.name }}</a>
|
||||
</div>
|
||||
<p class="card-text">{{ post.excerpt|raw }}</p>
|
||||
<a href="{{ post.url }}" class="btn btn-outline-primary btn-sm">
|
||||
{{ post.read_more }}
|
||||
</a>
|
||||
</div>
|
||||
</article>
|
||||
11
views/components/post-loop.html.twig
Normal file
11
views/components/post-loop.html.twig
Normal file
@@ -0,0 +1,11 @@
|
||||
{% if posts|length > 0 %}
|
||||
{% for post in posts %}
|
||||
{% include 'components/card-post.html.twig' with {'post': post} only %}
|
||||
{% endfor %}
|
||||
|
||||
{% include 'partials/pagination.html.twig' %}
|
||||
{% else %}
|
||||
<div class="alert alert-secondary" role="alert">
|
||||
{{ __('No posts were found.') }}
|
||||
</div>
|
||||
{% endif %}
|
||||
Reference in New Issue
Block a user