Class: Jekyll::ImportmapTag

Inherits:
Liquid::Tag show all
Defined in:
lib/jekyll-importmap.rb,
lib/jekyll-importmap/version.rb

Constant Summary collapse

VERSION =
"0.1.4"

Instance Method Summary collapse

Constructor Details

#initialize(tag_name, text, tokens) ⇒ ImportmapTag

Returns a new instance of ImportmapTag.



17
18
19
20
21
22
23
# File 'lib/jekyll-importmap.rb', line 17

def initialize(tag_name, text, tokens)
    super
    #root_path = Pathname.new(Jekyll.configuration['source']) + '/'
    root_path = Dir.pwd + '/'
    @importmap = Jekyll::Importmap::Map.new.draw(root_path.concat(IMPORTMAP_PATH))
    @entry_point = "application"
end

Instance Method Details

#render(context) ⇒ Object



25
26
27
# File 'lib/jekyll-importmap.rb', line 25

def render(context)
    import_map_tags(@entry_point, @importmap)
end