require 'jekyll-assets' class ThemePreviewTag < Liquid::Tag def initialize(tag_name, text, tokens) # convert 'prop:val prop:val' string to {prop=>val} hash @options = text.split.reduce({}) { |hash, tuple| key,value = tuple.split(':') hash[key] = value hash } end def render(context) baseurl = context['site']['baseurl'] theme = @options['theme'] "
" + "" + "" + "" + "" + "
" end end Liquid::Template.register_tag('theme_preview', ThemePreviewTag)