Module: Roda::RodaPlugins::AssetsPreloading::InstanceMethods
- Defined in:
- lib/roda/plugins/assets_preloading.rb
Instance Method Summary collapse
-
#preload_assets_link_header(*args) ⇒ Object
Return a string suitable for a Link header for the given asset types/groups.
-
#preload_assets_link_tags(*args) ⇒ Object
Return a string of <link> tags for the given asset types/groups.
Instance Method Details
#preload_assets_link_header(*args) ⇒ Object
Return a string suitable for a Link header for the given asset types/groups.
67 68 69 |
# File 'lib/roda/plugins/assets_preloading.rb', line 67 def preload_assets_link_header(*args) _preload_assets_array(args).map{|path, as| "<#{path}>;rel=preload;as=#{as}"}.join(",") end |
#preload_assets_link_tags(*args) ⇒ Object
Return a string of <link> tags for the given asset types/groups.
61 62 63 |
# File 'lib/roda/plugins/assets_preloading.rb', line 61 def (*args) _preload_assets_array(args).map{|path, as| "<link href=\"#{h(path)}\" rel=\"preload\" as=\"#{as}\">"}.join("\n") end |