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.

18 lines
803 B
Plaintext

2 years ago
<% contents = Dir.children("./" + folder).grep(/#{searchquery}/) %>
<% contents.each do |content| %>
<% if content.end_with?(".erb") %>
<% file = content %>
<% if File.exists?("./" + folder + "/" + file + ".meta") %>
<%= erb :blogpageERB, locals: {file: "./" + folder + "/" + content, meta: "./" + folder + "/" + file + ".meta"} %>
<% else %>
<%= erb :blogpageERB, locals: {file: "./" + folder+ "/" + content} %>
<% end %>
<% elsif content.end_with?(".md") %>
<% file = content %>
<% if File.exists?("./" + folder + "/" + file + ".meta") %>
<%= erb :blogpageMD, locals: {file: "./" + folder + "/" + content, meta: "./" + folder + "/" + file + ".meta"} %>
<% else %>
<%= erb :blogpageMD, locals: {file: "./" + folder + "/" + content} %>
<% end %>
<% end %>
<% end %>