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.

23 lines
969 B
Plaintext

<% foldersOfInterest = ["media", "technology", "news"] %>
<% foldersOfInterest.each do |folder| %>
<% if Dir.exists? folder %>
<% contents =Dir.children("./" + folder) %>
<% 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 %>
<% end %>
<% end %>