feat(ext-blog): Add Markdown support and featured images to Plugi Blog Extension
Updated README.md to document Markdown rendering and image authoring capabilities. Added PostContentRenderer class for safe Markdown parsing with XSS protection. Updated PostsRepository to fetch and resolve featured image data from the uploads table. Added UI controls in EditPost.php for selecting images and inserting inline Markdown. Updated views to display featured images on post cards and detail pages.
This commit is contained in:
@@ -31,6 +31,12 @@ $searchParameters = $search === '' ? [] : ['q' => $search];
|
||||
<div class="grid gap-6 md:grid-cols-2">
|
||||
<?php foreach ($posts as $post): ?>
|
||||
<article class="card h-full border border-base-300 bg-base-100 shadow-sm">
|
||||
<?php if (!empty($post['featured_image_url'])): ?>
|
||||
<?php $featuredImageAlt = trim((string) ($post['featured_image_alt_text'] ?? '')) ?: $post['title']; ?>
|
||||
<figure class="px-6 pt-6">
|
||||
<img src="<?= phpb_e($post['featured_image_url']) ?>" alt="<?= phpb_e($featuredImageAlt) ?>" class="aspect-video w-full rounded-box object-cover">
|
||||
</figure>
|
||||
<?php endif; ?>
|
||||
<div class="card-body gap-4">
|
||||
<div class="flex flex-wrap items-center gap-3 text-sm text-base-content/60">
|
||||
<?php if (!empty($post['category_name'])): ?>
|
||||
|
||||
Reference in New Issue
Block a user