Sha256: 134c76dfb986ca748420ab39220ddcf6e92417862369424c869b65697632860f

Contents?: true

Size: 899 Bytes

Versions: 18

Compression:

Stored size: 899 Bytes

Contents

# -*- encoding: utf-8 -*-

require 'webgen/content_processor'

module Webgen
  class ContentProcessor

    # Processes special webgen tags to provide dynamic content.
    #
    # webgen tags are an easy way to add dynamically generated content to websites, for example menus
    # or breadcrumb trails.
    #
    # See Webgen::Tag and all the classes in its namespace for further information.
    module Tags

      # Replace all webgen tags in the content of +context+ with the rendered content.
      def self.call(context)
        context.website.ext.tag.replace_tags(context.content) do |tag, params, body|
          context.website.logger.debug do
            "Replacing tag #{tag} with data #{params.inspect} and body '#{body}' in <#{context.ref_node}>"
          end
          context.website.ext.tag.call(tag, params, body, context)
        end
        context
      end

    end

  end
end

Version data entries

18 entries across 18 versions & 1 rubygems

Version Path
webgen-1.7.3 lib/webgen/content_processor/tags.rb
webgen-1.7.2 lib/webgen/content_processor/tags.rb
webgen-1.7.1 lib/webgen/content_processor/tags.rb
webgen-1.7.0 lib/webgen/content_processor/tags.rb
webgen-1.6.0 lib/webgen/content_processor/tags.rb
webgen-1.5.2 lib/webgen/content_processor/tags.rb
webgen-1.5.1 lib/webgen/content_processor/tags.rb
webgen-1.5.0 lib/webgen/content_processor/tags.rb
webgen-1.4.1 lib/webgen/content_processor/tags.rb
webgen-1.4.0 lib/webgen/content_processor/tags.rb
webgen-1.3.0 lib/webgen/content_processor/tags.rb
webgen-1.2.1 lib/webgen/content_processor/tags.rb
webgen-1.2.0 lib/webgen/content_processor/tags.rb
webgen-1.1.0 lib/webgen/content_processor/tags.rb
webgen-1.0.0 lib/webgen/content_processor/tags.rb
webgen-1.0.0.beta3 lib/webgen/content_processor/tags.rb
webgen-1.0.0.beta2 lib/webgen/content_processor/tags.rb
webgen-1.0.0.beta1 lib/webgen/content_processor/tags.rb