scrub pdf/txt files and non-subdomain search results

This commit is contained in:
Kyle Drake 2024-12-12 16:35:16 -06:00
parent 40bef7d125
commit afef407744
2 changed files with 2 additions and 2 deletions

View file

@ -138,7 +138,7 @@ get '/browse/search' do
cx: $config['google_custom_search_cx'], cx: $config['google_custom_search_cx'],
safe: 'active', safe: 'active',
start: @start, start: @start,
q: Rack::Utils.escape(params[:q]) q: Rack::Utils.escape(params[:q]) + ' -filetype:pdf -filetype:txt site:*.neocities.org'
}) })
@items = [] @items = []

View file

@ -109,7 +109,7 @@
<% if @start > 0 %> <% if @start > 0 %>
<a href="?q=<%= Rack::Utils.escape params[:q] %>&start=<%= [@start-10, 0].max %>"><i class="fa fa-arrow-left arrow">&nbsp;&nbsp;</i></a> <a href="?q=<%= Rack::Utils.escape params[:q] %>&start=<%= [@start-10, 0].max %>"><i class="fa fa-arrow-left arrow">&nbsp;&nbsp;</i></a>
<% end %> <% end %>
<% if @total_results > @start+10 %> <% if @total_results > @start+10 && @start+10 < 100 %>
<a href="?q=<%= Rack::Utils.escape params[:q] %>&start=<%= @start+10 %>"><i class="fa fa-arrow-right arrow"></i></a> <a href="?q=<%= Rack::Utils.escape params[:q] %>&start=<%= @start+10 %>"><i class="fa fa-arrow-right arrow"></i></a>
<% end %> <% end %>
</h2> </h2>