# frozen_string_literal: true require_relative '../base' module Alchemy module Generators class MenusGenerator < Base desc "This generator generates Alchemy menu partials." source_root File.expand_path('templates', __dir__) def create_partials menus = Alchemy::Node.roots return unless menus menus.each do |menu| conditional_template "wrapper.html.#{template_engine}", "app/views/#{menu.view_folder_name}/_wrapper.html.#{template_engine}" conditional_template "node.html.#{template_engine}", "app/views/#{menu.view_folder_name}/_node.html.#{template_engine}" end end end end end