Merge branch 'main' of git.broken-moon.net:astoriaFloyd/websitev5

main
Astoria Floyd 2 years ago
commit 07aa1e77f5

10
v5.rb

@ -47,7 +47,15 @@ get '/news/*' do
end
get '/archive' do
erb :archivepage
erb :archivepage, locals: {folder: "all", searchquery: ""}
end
get '/archive/' do
erb :archivepage, locals: {folder: "all", searchquery: ""}
end
get '/archive/:folder' do
erb :archivepage, locals: {folder: params["folder"].downcase, searchquery: params["search"]}
end
get '/about' do

@ -0,0 +1,18 @@
<% 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 %>

@ -0,0 +1,11 @@
<div class="section upperdirs">
<span class="homesubmessage">
<b>
<a href="/">Home</a>
>
<a href="/archive">Archive</a>
>
<a href="/archive/<%= folder %>"><%=folder.capitalize %></a>
</b>
</span>
</div>

@ -0,0 +1,44 @@
<!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>

@ -6,6 +6,6 @@
<span class="seedate"><%= File.read(meta) %></span>
</b>
<% end %>
<a class="seemorelink" href="<%= file %>">Article Page</a>
<a class="seemorelink" href="/<%= file %>">Article Page</a>
</span>
</div>

@ -6,6 +6,6 @@
<span class="seedate"><%= File.read(meta) %></span>
</b>
<% end %>
<a class="seemorelink" href="<%= file %>">Article Page</a>
<a class="seemorelink" href="/<%= file %>">Article Page</a>
</span>
</div>

@ -0,0 +1,7 @@
<div class="section numlist center>
<span class="homesubmessage">
<b>
<a href="/archive<%= folder %>">Search <%= title %> Posts<a>
</b>
</span>
</div>

@ -23,10 +23,12 @@
<% end %>
</div>
<%= erb :folderIndex %>
<%= erb :folderArchive, locals: {folder: request.path_info, title: title} %>
<% else %>
<%= erb :noFile %>
<% end %>
<% else %>
<%= erb :topbar %>
<%= erb :noFolder %>
<% end %>
</div>

@ -0,0 +1,7 @@
<div class="section numlist center>
<span class="homesubmessage">
<b>
<a href="/archive/all">Search All Posts<a>
</b>
</span>
</div>

@ -13,6 +13,7 @@
<div class="content">
<%= erb :homeImage %>
<%= erb :homeIndex %>
<%= erb :homeArchive %>
</div>
<%= erb :bottom %>
</body>

@ -1,4 +1,3 @@
<%= erb :topbar %>
<div class="article">
<div class="lostimg center">
<a class="lostimglink" href="/">
@ -8,5 +7,6 @@
<br>
Guru Meditation: No Content
</span>
</a>
</div>
</div>

@ -1,4 +1,3 @@
<%= erb :topbar %>
<div class="article">
<div class="lostimg center">
<a class="lostimglink" href="/">

@ -0,0 +1,7 @@
<div class="section search center">
<form method="GET" action="/archive/<%= folder %>">
Search:
<input name="search">
<input type="submit" value=">">
</form>
</div>
Loading…
Cancel
Save