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.

44 lines
1.6 KiB
Plaintext

2 years ago
<!DOCTYPE html>
<html lang="en">
<% if folder == "all" %>
<% doAllFolder = true %>
<% title = "Archive" %>
<% else %>
<% doAllFolder = false %>
<% title = "Archive - " + folder.capitalize %>
<% end %>
<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 :archiveTopBar, locals: {folder: folder} %>
<%= erb :searchbar, locals: {folder: folder} %>
<% if folder == "all" %>
<% foldersOfInterest = ["media", "technology", "news"] %>
<% foldersOfInterest.each do |multiFolder| %>
<% if Dir.exist?("./" + multiFolder) %>
<% if !Dir.children("./" + multiFolder).grep(/erb/).grep(/#{searchquery}/).empty? || !Dir.children("./" + multiFolder).grep(/md/).grep(/#{searchquery}/).empty? %>
<%= erb :archiveFolderIndex, locals: {folder: multiFolder, searchquery: searchquery} %>
<% end %>
<% end %>
<% end %>
<% elsif Dir.exist?("./" + folder) %>
<% if !Dir.children("./" + folder).grep(/erb/).grep(/#{searchquery}/).empty? || !Dir.children("./" + folder).grep(/md/).grep(/#{searchquery}/).empty? %>
<%= erb :archiveFolderIndex, locals: {folder: folder, searchquery: searchquery} %>
<% else %>
<%= erb :noFile %>
<% end %>
<% else %>
<%= erb :noFolder %>
<% end %>
<%# searchquery %>
</div>
<%= erb :bottom %>
</body>