Sha256: bb69e38b9905c9aa8865be02955d9126e4d72a349f5082fe5432966d3eaa1e55

Contents?: true

Size: 639 Bytes

Versions: 1

Compression:

Stored size: 639 Bytes

Contents

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

module Genit

  # Modify head link tags.
  class HeadLinkBuilder < BuilderBase
    
    # Public: Build the document head link tags of a particular page.
    #
    # page_name - The string filename of the page.
    #
    # Returns the modified Nokogiri::XML::Document
    def build_for_page page_name
      build page_name, head_links
    end
    
    private
    
    def head_links
      @document.css("head link")
    end
    
    def update link
      @path = link['href']
      nb = BuilderBase::get_number_of_base_dirs @page_name
      make_relative nb
      link['href'] = @path
    end
    
  end
  
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
genit-0.5 lib/genit/head_link_builder.rb