<% if File.exist?("." + request.path_info) && request.path_info.end_with?(".erb") %>
<%= ERB.new(File.read("." + request.path_info)).result(binding) %>
@@ -23,6 +24,10 @@
<%= markdown(File.read("." + request.path_info)) %>
<% elsif File.exist?("." + request.path_info + ".md") %>
<%= markdown(File.read("." + request.path_info + ".md")) %>
+ <% elsif File.exist?("." + request.path_info) && request.path_info.end_with?(".bb") %>
+ <%= ERB.new(File.read("." + request.path_info).gsub("\n[rb]", '[rb]').bbcode_to_html(false, addtags) + "
").result(binding) %> + <% elsif File.exist?("." + request.path_info + ".bb") %> + <%= ERB.new(File.read("." + request.path_info + ".bb").gsub("\n[rb]", '[rb]').bbcode_to_html(false, addtags)+ "
").result(binding) %> <% end %> <% if File.exist?("." + request.path_info + ".meta") %>
diff --git a/views/blogwindow.erb b/views/blogwindow.erb
index 2d1c65a..29d66e3 100644
--- a/views/blogwindow.erb
+++ b/views/blogwindow.erb
@@ -3,8 +3,10 @@
<%= markdown(File.read(file)) %>
<% elsif file.end_with?(".erb") %>
<%= ERB.new(File.read(file)).result(binding) %>
+ <% elsif file.end_with?(".bb") %>
+ <% addtags = { :rbe => { html_open: "\<%=", html_close: "%\>" }, :rb => { html_open: "\<%", html_close: "%\>" } } %>
+ <%= ERB.new(File.read(file).gsub("\n[rb]", '[rb]').bbcode_to_html(false, addtags) + "").result(binding) %> + <% elsif File.exist?("." + request.path_info + ".bb") %> + <%= ERB.new(File.read("." + request.path_info + ".bb").gsub("\n[rb]", '[rb]').bbcode_to_html(false, addtags)+ "
").result(binding) %> <% end %> <% if File.exist?("." + request.path_info + ".meta") %>
@@ -36,6 +41,14 @@
<%= File.read("." + request.path_info + ".md.meta") %>
+ <% elsif File.exist?("." + request.path_info + ".bb.meta") %>
+
+ <%= File.read("." + request.path_info + ".bb.meta") %>
+
+ <% else %>
+
+ 1970.01.01
+
<% end %>
").result(binding) %> <% end %> - <%= date %> diff --git a/views/index.erb b/views/index.erb index 87b4b45..7241fca 100644 --- a/views/index.erb +++ b/views/index.erb @@ -4,7 +4,7 @@ <% contents = Dir.children("./" + folder).grep(/#{searchquery}/) %> <% if !contents.empty? %> <% contents.each do |content| %> - <% if content.end_with?(".erb") || content.end_with?(".md") %> + <% if content.end_with?(".erb") || content.end_with?(".md") || content.end_with?(".bb") %> <% if File.exists?("./" + folder + "/" + content + ".meta") %> <% newPage = Page.new(folder + "/" + content, DateTime.parse(File.read("./" + folder + "/" + content + ".meta"), "%Y.%m.%d")) %> <% else %> @@ -24,9 +24,7 @@ <% contentsArray.sort_by! { |page| page.getdate } %> <% contentsArray.reverse.each do |content| %> - <% if content.getpath.end_with?(".erb") %> + <% if content.getpath.end_with?(".erb") || content.getpath.end_with?(".md") || content.getpath.end_with?(".bb") %> <%= erb :blogwindow, locals: {file: "./" + content.getpath, date: content.getdate.strftime("%Y.%m.%d")} %> - <% elsif content.getpath.end_with?(".md") %> - <%= erb :blogwindow, locals: {file: "./" + content.getpath, date: content.getdate.strftime("%Y.%m.%d")} %> <% end %> <% end %> \ No newline at end of file