Sha256: 14ed8cd8fca48d49fbd9a384e3665e0375bf8cb50e5a1fb5cc113de18bad55b5
Contents?: true
Size: 932 Bytes
Versions: 36
Compression:
Stored size: 932 Bytes
Contents
# @author Mike Bland (michael.bland@gsa.gov) require 'jekyll/static_file' require 'liquid' module GuidesStyle18F class Assets SOURCE = File.realpath File.join(__FILE__, '..', '..', '..') BEGIN_PATH = SOURCE.size + File::SEPARATOR.size def self.copy_to_site(site) Dir.glob File.join(SOURCE, 'assets', '**', '*') do |asset| next unless File.file? asset asset = asset[BEGIN_PATH..-1] site.static_files << ::Jekyll::StaticFile.new( site, SOURCE, File.dirname(asset), File.basename(asset)) end end end class AssetRootTag < ::Liquid::Tag ::Liquid::Template.register_tag 'guides_style_18f_asset_root', self def render(context) self.class.do_render context end def self.do_render(context) @asset_root ||= begin config = context.registers[:site].config config['asset_root'] || config['baseurl'] end end end end
Version data entries
36 entries across 36 versions & 1 rubygems