mirror of
https://github.com/neocities/neocities.git
synced 2025-04-25 09:42: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
|
get '/browse/search' do
|
||||||
if params[:q]
|
if params[:q]
|
||||||
|
@title = 'Search Results'
|
||||||
query_count = $redis_cache.get("search_query_count").to_i
|
query_count = $redis_cache.get("search_query_count").to_i
|
||||||
if query_count >= $config['google_custom_search_query_limit']
|
if query_count >= $config['google_custom_search_query_limit']
|
||||||
halt 429, "Query limit reached. Please try again tomorrow."
|
halt 429, "Query limit reached. Please try again tomorrow."
|
||||||
|
@ -152,14 +153,12 @@ get '/browse/search' do
|
||||||
site = Site[username: username]
|
site = Site[username: username]
|
||||||
next if site.nil? || site.is_deleted || site.is_nsfw
|
next if site.nil? || site.is_deleted || site.is_nsfw
|
||||||
|
|
||||||
if link.path[-1] == '/'
|
link.path << 'index' if link.path[-1] == '/'
|
||||||
link.path << 'index.html'
|
|
||||||
else
|
['.html', '.htm'].each do |ext|
|
||||||
['.html', '.htm'].each do |ext|
|
if site.screenshot_exists?(link.path + ext, '540x405')
|
||||||
if site.screenshot_exists?(link.path + ext, '540x405')
|
link.path += ext
|
||||||
link.path += ext
|
break
|
||||||
break
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue