Sha256: 83ea15c9e99740e0b0f2558efc49add1b560a97d46c45391612bc78463e396b3
Contents?: true
Size: 563 Bytes
Versions: 8
Compression:
Stored size: 563 Bytes
Contents
module Locomotive module Import class Snippets < Base def process Dir[File.join(theme_path, 'snippets', '*')].each do |snippet_path| self.log "path = #{snippet_path}" name = File.basename(snippet_path, File.extname(snippet_path)).parameterize('_') snippet = site.snippets.where(:slug => name).first || site.snippets.build(:name => name) snippet.template = File.read(snippet_path) # = site.snippets.create! :name => name, :template => snippet.save! end end end end end
Version data entries
8 entries across 8 versions & 1 rubygems