fix(indexing): Allow raw html files.
This commit is contained in:
parent
2a787df436
commit
bc3f44f2d5
12
lib/push.rb
12
lib/push.rb
@ -33,9 +33,13 @@ class AlgoliaSearchJekyllPush < Jekyll::Command
|
|||||||
site.process
|
site.process
|
||||||
end
|
end
|
||||||
|
|
||||||
def markdown?(filename)
|
def parseable?(file)
|
||||||
ext = File.extname(filename).delete('.')
|
ext = file.ext.delete('.')
|
||||||
@config['markdown_ext'].split(',').include?(ext)
|
# Allow markdown and html pages
|
||||||
|
return true if @config['markdown_ext'].split(',').include?(ext)
|
||||||
|
return false unless ext == 'html'
|
||||||
|
return false unless file['title']
|
||||||
|
true
|
||||||
end
|
end
|
||||||
|
|
||||||
def check_credentials(api_key, application_id, index_name)
|
def check_credentials(api_key, application_id, index_name)
|
||||||
@ -125,7 +129,7 @@ class AlgoliaSearchJekyllPush < Jekyll::Command
|
|||||||
|
|
||||||
# We only index posts, and markdown pages
|
# We only index posts, and markdown pages
|
||||||
return nil unless is_page || is_post
|
return nil unless is_page || is_post
|
||||||
return nil if is_page && !markdown?(file.path)
|
return nil if is_page && !parseable?(file)
|
||||||
|
|
||||||
html = file.content.gsub("\n", ' ')
|
html = file.content.gsub("\n", ' ')
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user