From 8f3f58e3010fa7c923b77b7d2050175890b58f9b Mon Sep 17 00:00:00 2001 From: erdgeist Date: Tue, 21 Jul 2026 23:17:56 +0200 Subject: Render PDF headlines as document cards, not lightbox images A starred PDF previously ran through the same crop-and-lightbox path a photo does -- exactly the awkward treatment explicit headline designation was meant to avoid. _headline_image.html.erb now branches on @headline_asset.pdf?: a PDF renders as a linked card (a :medium thumbnail, a file icon, its name), no gallery participation at all. The existing image-headline and gallery-fallback logic is otherwise unchanged, now scoped to an image-specific headline only. Other attached PDFs -- headlined or not -- list below as plain links, same reasoning as why non-headline photos still get a gallery trigger: an attached document shouldn't go invisible just because nothing's been starred yet. headline_image's own render guard needed widening to cover a page with PDFs attached but no images and no headline at all -- the one case none of the existing conditions accounted for. --- app/helpers/content_helper.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'app/helpers/content_helper.rb') diff --git a/app/helpers/content_helper.rb b/app/helpers/content_helper.rb index 459d9e01..7a52d9cd 100644 --- a/app/helpers/content_helper.rb +++ b/app/helpers/content_helper.rb @@ -54,7 +54,7 @@ module ContentHelper def headline_image @headline_asset = @page.headline_asset - render :partial => 'content/headline_image' if @headline_asset || @page.assets.images.any? + render :partial => 'content/headline_image' if @headline_asset || @page.assets.images.any? || @page.assets.pdfs.any? end # Returns the published_at attribute of a page if it is not nil, otherwise -- cgit v1.3