column number option for 2_col, also bg

This commit is contained in:
2022-12-05 12:52:22 +02:00
parent 7728767b3d
commit 6911540d30
3 changed files with 30 additions and 4 deletions

View File

@ -23,8 +23,9 @@ module Merged
def order_option(section)
return {} unless section.has_option?("order")
puts "Order #{section.option('order')}"
return {} if section.option("order") == "right"
option = section.option('order')
puts "Order #{option}"
return {} if option == "right"
{class: "order-last"}
end
@ -42,6 +43,21 @@ module Merged
{class: background}
end
def column_option(section)
option = section.option('columns')
option = 2 if option.blank?
puts "Columns #{option}"
case option
when "3"
columns = "grid-cols-1 md:grid-cols-3"
when "4"
columns = "grid-cols-1 md:grid-cols-2 lg:grid-cols-4"
else # two
columns = "grid-cols-1 md:grid-cols-2"
end
{class: columns}
end
def button(text , url , color)
link_to(url) do
content_tag(:button , class: color + " " + button_classes ) do