Skip to content

Commit

Permalink
Include text in generated pages
Browse files Browse the repository at this point in the history
Closes #1056
  • Loading branch information
paulcsmith committed Mar 20, 2020
1 parent 9e61eff commit 932d352
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
5 changes: 3 additions & 2 deletions tasks/gen/page.cr
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,11 @@ require "file_utils"
class Lucky::PageTemplate < Teeplate::FileTree
@page_filename : String
@page_class : String
@output_path : String

directory "#{__DIR__}/templates/page"

def initialize(@page_filename, @page_class)
def initialize(@page_filename, @page_class, @output_path)
end
end

Expand All @@ -20,7 +21,7 @@ class Gen::Page < LuckyCli::Task
if error
io.puts error.colorize(:red)
else
Lucky::PageTemplate.new(page_filename, page_class).render(output_path)
Lucky::PageTemplate.new(page_filename, page_class, output_path).render(output_path)
io.puts success_message
end
end
Expand Down
1 change: 1 addition & 0 deletions tasks/gen/templates/page/{{page_filename}}.cr.ecr
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
class <%= @page_class %> < MainLayout
def content
h1 "Modify this page at #{@output_path}"
end
end

0 comments on commit 932d352

Please sign in to comment.