lib/occams/seeds/page/exporter.rb in occams-1.0.0 vs lib/occams/seeds/page/exporter.rb in occams-1.0.1

- old
+ new

@@ -1,10 +1,9 @@ # frozen_string_literal: true module Occams::Seeds::Page class Exporter < Occams::Seeds::Exporter - def initialize(from, to = from) super self.path = ::File.join(Occams.config.seeds_path, to, "pages/") end @@ -18,16 +17,16 @@ path = ::File.join(page_path, "content.html") data = [] attrs = { - "label" => page.label, - "layout" => page.layout.try(:identifier), - "target_page" => page.target_page.try(:full_path), - "categories" => page.categories.map(&:label), + "label" => page.label, + "layout" => page.layout.try(:identifier), + "target_page" => page.target_page.try(:full_path), + "categories" => page.categories.map(&:label), "is_published" => page.is_published, - "position" => page.position + "position" => page.position }.to_yaml data << { header: "attributes", content: attrs } data += fragments_data(page, page_path) @@ -46,12 +45,12 @@ page.translations.each do |translation| path = ::File.join(page_path, "content.#{translation.locale}.html") data = [] attrs = { - "label" => translation.label, - "layout" => translation.layout.try(:identifier), + "label" => translation.label, + "layout" => translation.layout.try(:identifier), "is_published" => page.is_published }.to_yaml data << { header: "attributes", content: attrs } data += fragments_data(translation, page_path) @@ -85,8 +84,7 @@ end { header: header, content: content } end end - end end