diff options
author | 2024-04-24 15:41:21 +0200 | |
---|---|---|
committer | 2024-04-25 11:33:30 +0200 | |
commit | 78449da6c440af1fe0cb8f7a557122f73efbaae9 (patch) | |
tree | 101297ceb723b466349e9c1324907da276b5a326 /page.rb | |
parent | 3e16031d43578faa696aa6ab26811c2e4d88cbea (diff) | |
download | hyde-78449da6c440af1fe0cb8f7a557122f73efbaae9.tar.gz hyde-78449da6c440af1fe0cb8f7a557122f73efbaae9.zip |
Rewrite render method in Page class
Diffstat (limited to 'page.rb')
-rw-r--r-- | page.rb | 19 |
1 files changed, 19 insertions, 0 deletions
@@ -39,6 +39,25 @@ class Page parseConfig(fileName + '.config') end + def render + if (@master != nil) + t = ERB.new(File.read(File.expand_path(@fileName))) + + masterPage = Page.new(@master) + masterPage.title = @title + masterPage.pageNames = @pageNames + masterPage.description = @description + masterPage.date = @date + masterPage.classes = @classes + masterPage.baseHref = @baseHref + masterPage.content = t.result(binding) + masterPage.render + else + content = File.read(File.expand_path(@fileName)) + t = ERB.new(content) + print t.result(binding) + end + end def parseConfig(configFile) if (File.exist?(configFile)) |