diff --git a/main.rb b/main.rb index 8d582f3..e5579ed 100644 --- a/main.rb +++ b/main.rb @@ -100,59 +100,82 @@ for file in workspace content = renderer.render(raw_content) + if product.include? "{SITE_NAME}" while product.include? "{SITE_NAME}" product["{SITE_NAME}"]= site_name + end end + if product.include? "{SITE_DOMAIN}" while product.include? "{SITE_DOMAIN}" product["{SITE_DOMAIN}"]= site_domain end - - while product.include? "{PAGE_TITLE}" - product["{PAGE_TITLE}"]= title - end - - while product.include? "{DIRECTORY_A}" - product["{DIRECTORY_A}"]= da.join() - end - - while product.include? "{DIRECTORY_P}" - product["{DIRECTORY_P}"]= dp.join() - end - - while product.include? "{DIRECTORY_SLASH_A}" - product["{DIRECTORY_SLASH_A}"]= dsa.join() - end - - while product.include? "{DIRECTORY_SLASH_P}" - product["{DIRECTORY_SLASH_P}"]= dsp.join() - end - - while product.include? "{PAGE_CONTENT}" - product["{PAGE_CONTENT}"]= content - end - - while raw_content.include? "$EWFM$" - product["$EWFM$"]= "
This page has been generated by ewfm using the " + theme + " theme!
" - end - - while raw_content.include? "$THEME$" - product["$THEME$"]= theme end - while raw_content.include? "$TIME$" + if product.include? "{PAGE_TITLE}" + while product.include? "{PAGE_TITLE}" + product["{PAGE_TITLE}"]= title + end + end + + if product.include? "{DIRECTORY_A}" + while product.include? "{DIRECTORY_A}" + product["{DIRECTORY_A}"]= da.join() + end + end + + if product.include? "{DIRECTORY_P}" + while product.include? "{DIRECTORY_P}" + product["{DIRECTORY_P}"]= dp.join() + end + end + + if product.include? "{DIRECTORY_SLASH_A}" + while product.include? "{DIRECTORY_SLASH_A}" + product["{DIRECTORY_SLASH_A}"]= dsa.join() + end + end + + if product.include? "{DIRECTORY_SLASH_P}" + while product.include? "{DIRECTORY_SLASH_P}" + product["{DIRECTORY_SLASH_P}"]= dsp.join() + end + end + + if product.include? "{PAGE_CONTENT}" + while product.include? "{PAGE_CONTENT}" + product["{PAGE_CONTENT}"]= content + end + end + + if product.include? "$EWFM$" + while product.include? "$EWFM$" + product["$EWFM$"]= "This page has been generated by ewfm using the " + theme + " theme!
" + end + end + + if product.include? "$THEME$" + while product.include? "$THEME$" + product["$THEME$"]= theme + end + end + + if product.include? "$TIME$" + while product.include? "$TIME$" time = DateTime.now cdt = time.strftime "%d/%m/%Y %H:%M:%S" product["$TIME$"]= cdt end + end - while raw_content.include? "$RUBY$" + if product.include? "$RUBY$" + while product.include? "$RUBY$" product["$RUBY$"]= RUBY_VERSION end + end handle = file handle["input"]= "output" handle[".md"]= ".html" IO.write(handle, product) end -