class Jekyll::Stork
Constants
- STEMMERS
Attributes
config[R]
site[R]
Public Class Methods
new(site)
click to toggle source
@param [Jekyll::Site]
# File lib/jekyll/stork.rb 32 def initialize(site) 33 @site = site 34 end
Public Instance Methods
dest()
click to toggle source
@return [String]
# File lib/jekyll/stork.rb 79 def dest 80 @dest ||= File.join(site.dest, file) 81 end
file()
click to toggle source
@return [String]
# File lib/jekyll/stork.rb 74 def file 75 @file ||= 'index.st' 76 end
files()
click to toggle source
@return [Hash]
# File lib/jekyll/stork.rb 63 def files 64 @files ||= site.documents.concat(site.pages).map do |page| 65 { 66 'path' => page.destination(site.dest), 67 'url' => page.url, 68 'title' => page.data['title'] || '' 69 } 70 end 71 end
index!()
click to toggle source
# File lib/jekyll/stork.rb 36 def index! 37 Open3.popen2e('stork', '--build', config) do |_, stdout, thread| 38 puts stdout.read 39 40 if thread.value.success? 41 site.static_files << Jekyll::StaticFile.new(site, site.source, '', file) 42 end 43 end 44 rescue Errno::ENOENT 45 Jekyll.logger.warn "I couldn't find the `stork` program on your PATH, maybe you need to install it?" 46 end
locale()
click to toggle source
Returns the locale from the Site. Stork
uses English as default language so we're following that…
@return [String]
# File lib/jekyll/stork.rb 52 def locale 53 @locale ||= site.config['locale'] || site.config['lang'] || 'en' 54 end
stemmer()
click to toggle source
@see locale @return [String]
# File lib/jekyll/stork.rb 58 def stemmer 59 @stemmer ||= STEMMERS[locale] || 'English' 60 end