Module: Jekyll::UniqueURL::URLs

Defined in:
lib/jekyll/unique_urls/urls.rb

Overview

Adds a method #urls to keep a unique set of URLs from which to check if the current URL is unique.

Class Method Summary collapse

Class Method Details

.included(base) ⇒ Object



8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
# File 'lib/jekyll/unique_urls/urls.rb', line 8

def self.included(base)
  base.class_eval do

    # All URLs from the site.
    #
    # @return [Set]
    def urls
      @urls ||= Set.new
    end

    # Also reset URLs between resets, to make it compatible with
    # jekyll-locales
    alias reset_all reset
    def reset
      @urls = nil
      reset_all
    end
  end
end