FEATURE: allows to to style published page with themes/plugins (#9570)

This commit is contained in:
Joffrey JAFFEUX
2020-04-28 18:24:24 +02:00
committed by GitHub
parent b19dcac272
commit a6f986b50f
8 changed files with 64 additions and 30 deletions

View File

@ -15,6 +15,18 @@ class PublishedPagesController < ApplicationController
guardian.ensure_can_see!(pp.topic)
@topic = pp.topic
@canonical_url = @topic.url
@body_classes = Set.new([
'published-page',
params[:slug],
"topic-#{@topic.id}",
@topic.tags.pluck(:name)
].flatten.compact)
if @topic.category
@body_classes << @topic.category.slug
end
render layout: 'publish'
end