Created
February 21, 2017 17:23
-
-
Save allizad/b8c751237887ae0315e23d9fbad7b84f to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Jekyll::Hooks.register :posts, :post_render do |post| | |
# strip html | |
nokogiri_doc = Nokogiri::HTML(post.output) | |
puts %(indexing #{post.url}) | |
indexer = indexers[post.site] | |
indexer << post.data.merge({ | |
id: post.id, | |
url: post.url, | |
text: nokogiri_doc.xpath("//article//text()").to_s.gsub(/\s+/, " ") | |
}) | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment