You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

56 lines
2.4 KiB
Plaintext

2 years ago
<!DOCTYPE html>
<html lang="en">
<% title = request.path_info[1..-1].capitalize %>
<% title = title.slice(0..(title.index('/') - 1)) %>
<head>
<title><%= title %></title>
<meta name="description" content="broken-moon.net - <%= title %>" />
<meta name="keywords" content="<%= title.downcase %>" />
<meta property="og:url" content="http://broken-moon.net/<%= title.downcase %>" />
<meta property="og:title" content="<%= title %>" />
<%= erb :headerBoilerplate %>
</head>
<body>
<%= erb :asidemenu %>
<div class="content">
<%= erb :blogbar, locals: {title: title} %>
<% addtags = { :rbe => { html_open: "\<%=", html_close: "%\>" }, :rb => { html_open: "\<%", html_close: "%\>" } } %>
2 years ago
<div class="article">
<% if File.exist?("." + request.path_info) && request.path_info.end_with?(".erb") %>
<%= ERB.new(File.read("." + request.path_info)).result(binding) %>
<% elsif File.exist?("." + request.path_info + ".erb") %>
<%= ERB.new(File.read("." + request.path_info + ".erb")).result(binding) %>
<% elsif File.exist?("." + request.path_info) && request.path_info.end_with?(".md") %>
<%= 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) + "<br>").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)+ "<br>").result(binding) %>
2 years ago
<% end %>
<% if File.exist?("." + request.path_info + ".meta") %>
<div class="articledate">
<%= File.read("." + request.path_info + ".meta") %>
</div>
<% elsif File.exist?("." + request.path_info + ".erb.meta") %>
<div class="articledate">
<%= File.read("." + request.path_info + ".erb.meta") %>
</div>
<% elsif File.exist?("." + request.path_info + ".md.meta") %>
<div class="articledate">
<%= File.read("." + request.path_info + ".md.meta") %>
</div>
<% elsif File.exist?("." + request.path_info + ".bb.meta") %>
<div class="articledate">
<%= File.read("." + request.path_info + ".bb.meta") %>
</div>
<% else %>
<div class="articledate">
1970.01.01
</div>
<% end %>
2 years ago
</div>
</div>
<%= erb :bottom %>
</body>