Module: Bridgetown::ConsoleMethods

Defined in:
lib/bridgetown-core/commands/console.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.site_reset(site) ⇒ Object



19
20
21
22
23
24
25
26
27
# File 'lib/bridgetown-core/commands/console.rb', line 19

def self.site_reset(site)
  site.reset
  Bridgetown.logger.info "Reading files..."
  site.read
  Bridgetown.logger.info "", "done!"
  Bridgetown.logger.info "Running generators..."
  site.generate
  Bridgetown.logger.info "", "done!"
end

Instance Method Details

#reload!Object



5
6
7
8
9
10
11
12
13
14
15
16
17
# File 'lib/bridgetown-core/commands/console.rb', line 5

def reload!
  Bridgetown.logger.info "Reloading site..."

  site = Bridgetown::Current.site

  I18n.reload! # make sure any locale files get read again
  Bridgetown::Hooks.trigger :site, :pre_reload, site
  Bridgetown::Hooks.clear_reloadable_hooks
  site.loaders_manager.reload_loaders
  Bridgetown::Hooks.trigger :site, :post_reload, site

  ConsoleMethods.site_reset(site)
end