mirror of
https://github.com/neocities/neocities.git
synced 2025-04-25 01:32:36 +02:00
fix for .htm indexes
This commit is contained in:
parent
aae94f2078
commit
40bef7d125
1 changed files with 7 additions and 8 deletions
|
@ -121,6 +121,7 @@ end
|
|||
|
||||
get '/browse/search' do
|
||||
if params[:q]
|
||||
@title = 'Search Results'
|
||||
query_count = $redis_cache.get("search_query_count").to_i
|
||||
if query_count >= $config['google_custom_search_query_limit']
|
||||
halt 429, "Query limit reached. Please try again tomorrow."
|
||||
|
@ -152,16 +153,14 @@ get '/browse/search' do
|
|||
site = Site[username: username]
|
||||
next if site.nil? || site.is_deleted || site.is_nsfw
|
||||
|
||||
if link.path[-1] == '/'
|
||||
link.path << 'index.html'
|
||||
else
|
||||
link.path << 'index' if link.path[-1] == '/'
|
||||
|
||||
['.html', '.htm'].each do |ext|
|
||||
if site.screenshot_exists?(link.path + ext, '540x405')
|
||||
link.path += ext
|
||||
break
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
item['screenshot_url'] = site.screenshot_url(link.path, '540x405')
|
||||
@items << item
|
||||
|
|
Loading…
Add table
Reference in a new issue