Skip to content

Commit

Permalink
build/serve app w/o search index build process -- --no-lunr-index
Browse files Browse the repository at this point in the history
  • Loading branch information
Stephenitis committed Dec 18, 2014
1 parent c2bf1a9 commit 5447618
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion _plugins/index_all_pages.rb
Expand Up @@ -7,6 +7,7 @@ class Indexer < Generator

def initialize(config = {})
super(config)
return if ARGV.include?("--no-lunr-index")

lunr_config = {
'excludes' => [],
Expand All @@ -28,7 +29,10 @@ def initialize(config = {})
# Index all pages except pages matching any value in config['lunr_excludes'] or with date['exclude_from_search']
# The main content from each page is extracted and saved to disk as json
def generate(site)
puts 'Running the search indexer...'
if @index.nil?
Jekyll.logger.info "Lunr:", 'Skipping search indexing at user request'
return
end

# gather pages and posts
items = pages_to_index(site)
Expand Down

0 comments on commit 5447618

Please sign in to comment.