Skip to content

Commit

Permalink
fix: include page variants in tailwind input (#683)
Browse files Browse the repository at this point in the history
  • Loading branch information
leandrocp authored Dec 3, 2024
1 parent 45c7b19 commit 180d578
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion lib/beacon/tailwind_compiler.ex
Original file line number Diff line number Diff line change
Expand Up @@ -217,9 +217,15 @@ defmodule Beacon.RuntimeCSS.TailwindCompiler do
end),
Task.async(fn ->
Enum.map(Content.list_published_pages(site, per_page: :infinity), fn page ->
# TODO: post process variant templates
variants =
Enum.reduce(page.variants, "", fn variant, acc ->
acc <> variant.template
end)

page_path = Path.join(tmp_dir, "#{site}_page_#{remove_special_chars(page.path)}.template")
post_processed_template = Beacon.Lifecycle.Template.load_template(page)
File.write!(page_path, post_processed_template)
File.write!(page_path, post_processed_template <> variants)
page_path
end)
end),
Expand Down

0 comments on commit 180d578

Please sign in to comment.