Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Include text in generated pages #1057

Merged
merged 1 commit into from
Mar 20, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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