Sha256: e84de6bf596b7c139d0f0f3db0225c766e9d74150862171d99b3a32537d26a2e

Contents?: true

Size: 542 Bytes

Versions: 7

Compression:

Stored size: 542 Bytes

Contents

module StaticMatic
  module Helpers
    module CurrentPathHelper
      self.extend self
      
      def current_page
        @staticmatic.current_page
      end

      private

      def current_page_relative_path(current_path = nil)
        if current_path.nil? || current_path.match(/^((\.\.?)?\/|\#|.+?\:)/) == nil
          current_page_depth = current_page.split('/').length - 2;
          (current_page_depth > 0) ? ([ '..' ] * current_page_depth).join('/') + '/' : ''
        else
          ''
        end
      end
    end
  end
end

Version data entries

7 entries across 7 versions & 2 rubygems

Version Path
staticmatic2-2.0.2 lib/staticmatic/helpers/current_path_helper.rb
staticmatic2-2.0.1 lib/staticmatic/helpers/current_path_helper.rb
staticmatic2-2.0.0 lib/staticmatic/helpers/current_path_helper.rb
staticmatic-0.11.1 lib/staticmatic/helpers/current_path_helper.rb
staticmatic-0.11.0 lib/staticmatic/helpers/current_path_helper.rb
staticmatic-0.11.0.alpha.10 lib/staticmatic/helpers/current_path_helper.rb
staticmatic-0.11.0.alpha.9 lib/staticmatic/helpers/current_path_helper.rb