-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
805af0f
commit 0b14f60
Showing
10 changed files
with
54 additions
and
320 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,3 +5,4 @@ | |
require "constants" | ||
require "blog/blog" | ||
require "blog/article" | ||
require "blog/index" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
class Index | ||
attr_accessor :articles | ||
attr_accessor :title | ||
attr_reader :blog_url | ||
|
||
def initialize | ||
@articles = Array.new | ||
@blog_url = BLOG_ROOT_URL | ||
end | ||
|
||
def generate_index(template_url, output_url, haml_options) | ||
index_template = Haml::Engine.new(File.read(template_url), haml_options) | ||
index_output = index_template.render self | ||
FileUtils.mkdir_p(File.dirname(output_url)) | ||
File.open(output_url, "w") do |file| | ||
file.write index_output | ||
end | ||
end | ||
end |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.