Sha256: 6787f074ad3744dc5065efbf839ab7fb3941f10436453be8662a95481aa4fa22
Contents?: true
Size: 1.43 KB
Versions: 1
Compression:
Stored size: 1.43 KB
Contents
# include Bloggit # # # Registering plugin to retrieve settings from settings.yml # Plugin.register :js_search do |settings| # $username = settings.fetch('username', '') # end # # # # Registering custom tags in the template engine # Template.register_tag :js_search do |*args| # type, opts = args # opts ||= {} # # case type # when :form # %Q|<a href="javascript:HaloScanTB('#{slug}');" target="_self"><script type="text/javascript">postCountTB('#{slug}'); </script></a>| # # when :template # puts opts[:block].call() # # when :script # %Q|<script type="text/javascript" src="http://www.haloscan.com/load/#{settings.fetch('username', '')}"> </script>| # # else # 'WHAT ELSE?' # end # # end # # # Responding to application events... # Bloggit::on_event(:after_generate) do |site, cache_dir| # puts "Generating search index..." # # TODO: Copy/create JS Search lib in cache/ ... # # TODO: Generate index JS file ... # end # # # # Adding a command line tool... # Cmdline.register do |cmd, site| # search_cmd = CmdParse::Command.new( 'search', true, true ) # search_cmd.short_desc = "JS Search Tools (plugin)" # cmd.add_command( search_cmd ) # # idx = CmdParse::Command.new( 'index', false ) # idx.short_desc = "Create search index" # idx.set_execution_block do |args| # puts "Generating index file(s)..." # end # # search_cmd.add_command( idx ) # end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
bloggit-1.0.3 | test/fixtures/test.blog/plugins/js_search/init.rb |