github happytodev/blogr v0.12.0

latest releases: v0.17.1, v0.17.0, v0.16.0...
pre-release5 months ago

What's Changed

πŸ”’ Security

  • Settings Access Control: Restricted BlogrSettings page to admin role only
    • Added canAccess() method to prevent writers from viewing/editing settings
    • Only users with 'admin' role can access the settings page
    • Settings link automatically hidden from navigation for non-admin users
    • Added 3 comprehensive tests validating access control

✨ Features

  • TOC Position Configuration: Three-position Table of Contents system

    • New toc.position config supporting 3 modes: 'center', 'left', or 'right' (default: 'center')
    • Center mode: TOC remains inline with content (traditional flow layout)
    • Sidebar modes (left/right): Sticky TOC in dedicated sidebar
      • 280px fixed-width sidebar that stays visible during scroll
      • Responsive grid layout with lg:sticky positioning
      • Automatic TOC extraction from content for sidebar rendering
    • Dynamic CSS classes (blogr-toc-center, blogr-toc-sidebar, blogr-toc-{position})
    • Admin setting in BlogrSettings page to configure position
    • View automatically adjusts layout based on position (inline vs. sidebar)
    • Added 5 comprehensive tests validating functionality and styling
  • CSS Variables Theming System: Complete theming system with CSS variables for colors

    • Primary, category, tag, and author colors with dark mode support
    • Hover effects and link styling using CSS variables
    • Applied across navigation, footer, cards, breadcrumbs, and all components
    • ColorHelper class for automatic dark mode color adjustments
  • Blog Series Translations: Full translation support for series

    • Added slug column to blog_series_translations table for localized URLs
    • Series routes now use translated slugs (/blog/series/{translatedSlug})
    • Automatic slug generation and fallback to default locale
    • Updated navigation, breadcrumbs, and cards to use translated slugs
  • Publication Date Configuration: Granular control over date display

    • Master toggle: ui.dates.show_publication_date (global enable/disable)
    • ui.dates.show_publication_date_on_cards - Show dates on post cards
    • ui.dates.show_publication_date_on_articles - Show dates on article pages
    • Replaces deprecated ui.blog_post_card.show_publication_date
  • Default Image Management: Improved fallback logic for post images

    • BlogPost::getPhotoUrlAttribute() with priority chain:
      1. Post photo (database)
      2. config('blogr.posts.default_image')
      3. Legacy config('blogr.default_cover_image') (backward compatibility)
      4. Hardcoded fallback: /vendor/blogr/images/default-post.svg
    • Works with translated content and author pages
  • Tags Position Configuration: Control where tags appear on articles

    • ui.posts.tags_position setting: 'top' or 'bottom'
    • Configurable via BlogrSettings admin panel
  • Heading Permalink Configuration: Customizable anchor links for headings

    • Symbol: '#', 'Β§', 'ΒΆ', 'πŸ”—', etc.
    • Spacing: 'none', 'before', 'after', 'both'
    • Visibility: 'always' or 'hover'
    • Copy-to-clipboard functionality with visual feedback
  • Author Profile Enhancements:

    • Bio rendered as Markdown with MarkdownHelper class
    • Avatar with gradient background using primary colors
    • Improved hover effects with primary color ring
    • Author name tooltip on avatar hover
    • Proper display of pseudo vs full name based on display.show_author_pseudo
  • Blog Post Card Component: New reusable blog-post-card.blade.php

    • Translation support with automatic locale detection
    • Dynamic content rendering (title, tldr, image, tags)
    • Consistent styling across index, category, tag, and author views
  • Series Card Component: New reusable series-card.blade.php

    • Responsive design with author avatars
    • Author limit display (series_authors_limit config)
    • Translated slug support for all links
  • RSS Feed System: Complete RSS 2.0 feed implementation with multilingual support

    • Routes: /{locale}/blog/feed for main feed
    • Category feeds: /{locale}/blog/feed/category/{slug}
    • Tag feeds: /{locale}/blog/feed/tag/{slug}
    • RSS 2.0 format with Atom and Dublin Core namespaces
    • Automatic language detection per locale
    • 1-hour public cache (Cache-Control: public, max-age=3600)
    • Published posts only with proper date formatting
    • Configurable items limit via blogr.rss.items_limit (default: 20)
    • Uses TL;DR field for description (falls back to first 300 characters)
    • XML escaping for security
    • Full documentation in RSS_FEED.md

πŸ”§ Improvements

  • Excerpt Field Removed: Simplified content management by removing redundant excerpt field

    • Rationale: The excerpt field duplicated the tldr (Too Long; Didn't Read) functionality
    • Now uses only tldr field throughout the application
    • Updated BlogPostTranslation model: removed excerpt from $fillable array
    • Enhanced tldr form field: Changed from TextInput (255 chars) to Textarea (500 chars, 3 rows)
    • Updated all controllers to use tldr instead of excerpt
    • Simplified blog post card component (no excerpt fallback logic)
    • Updated RSS feed to use tldr for description
    • Updated migration command (MigratePostsToTranslations)
    • Migration Note: Existing excerpt data can be manually migrated to tldr if needed
    • All 476 tests updated and passing
  • Table of Contents Styling: Enhanced TOC appearance and functionality

  • Author Bio Component: Improved rendering with markdown support and avatar display options

  • Series Navigation: Better layout and responsiveness with CSS variables

  • Language Switcher: Updated styling for better visibility and theming

  • Footer Social Links: Added Bluesky, YouTube, Instagram, TikTok, Mastodon support

  • Breadcrumb Navigation: Improved hover effects and translated slug support

  • BlogrSettings: Enhanced admin panel with better tab structure and color options

  • Translations: Added French translations for author information and featured series

πŸ› Bug Fixes

  • RSS Feed 404 Error: Fixed RSS feed routes returning 404 errors

    • Root Cause 1: Invalid type hint string $locale = null in RssFeedController (should be ?string $locale = null)
    • Root Cause 2: Route ordering issue - catch-all {slug} route was matching /feed before RSS routes
    • Solution: Moved RSS route registration BEFORE catch-all routes in BlogrServiceProvider (lines 195-202, 273-278)
    • Added comments to prevent future route ordering issues
    • All RSS routes now working: main feed, category feed, tag feed
    • Tests: 6 comprehensive RSS feed tests (18 assertions) all passing
  • Photo Fallback Logic: Fixed default images not loading on author pages

    • Author page now correctly uses config('blogr.posts.default_image')
    • Proper asset() path resolution for vendor images
    • Consistent fallback across all views
  • TOC Display Logic: Clarified priority checks in BlogPost model

    • Fixed nullable display_toc column in migration
    • Proper cascade: post setting β†’ strict mode β†’ global setting
  • TOC Position Test: Fixed TocPositionTest failing on "respects display_toc setting"

    • Updated test to check for actual HTML elements (<aside class="toc-sidebar-wrapper">) instead of CSS class names
    • CSS class definitions in <style> tags were causing false positives
    • Test now correctly validates that TOC elements are not rendered when display_toc is false
  • Series Image Overlay: Commented out gradient overlay for better image visibility

πŸ§ͺ Tests

  • Added comprehensive feature tests for:
    • RSS Feed System: 6 tests validating XML structure, post details, category/tag filtering, published-only posts, items limit, and XML escaping
    • TOC Position: Fixed and updated tests for TOC display logic and positioning
    • Author profile enhancements (layout, bio, dates, avatars)
    • Author avatar hover effects
    • Publication date display and fallback logic
    • Photo URL attribute and fallback chain
    • Blog series slug generation and translations
    • Settings configuration and persistence
  • Excerpt Removal: Updated 20+ test occurrences across 6 test files to use tldr instead of excerpt
  • Total: 476 passing tests (1397 assertions), 10 skipped, 0 failing

πŸ“š Documentation

  • RSS Feed: Added comprehensive RSS_FEED.md documentation
    • Complete guide for RSS feed routes and configuration
    • Examples of XML output format
    • Multilingual support documentation
    • Configuration options and customization guide
  • Updated config comments to clarify image publication paths
  • Added inline documentation for new helpers and methods

⚠️ Breaking Changes

  • Deprecated Config: ui.blog_post_card.show_publication_date replaced by ui.dates.* settings
  • Migration Required: New slug column in blog_series_translations table

Full Changelog: v0.11.2...v0.12.0

Don't miss a new blogr release

NewReleases is sending notifications on new releases.