Initial commit
This commit is contained in:
21
app/views/site/home.rb
Normal file
21
app/views/site/home.rb
Normal file
@@ -0,0 +1,21 @@
|
||||
module Adamantium
|
||||
module Views
|
||||
module Site
|
||||
class Home < Adamantium::View
|
||||
include Deps["repos.post_repo", renderer: "renderers.markdown"]
|
||||
|
||||
expose :home_content do
|
||||
markdown_content = File.read("app/content/home.md")
|
||||
|
||||
renderer.call(content: markdown_content)
|
||||
end
|
||||
|
||||
expose :posts do
|
||||
post_repo.post_listing(limit: 10).map do |post|
|
||||
Decorators::Posts::Decorator.new(post)
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
Reference in New Issue
Block a user