jekyll-titles-from-headings 0.2.0 → 0.3.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 367e754467d30e9b6ef62d13fb7c1f0030d7c165
4
- data.tar.gz: 0e0f69aad2c526cc74cf5a32318879b05013e35e
3
+ metadata.gz: 9cb2cb40f212c203df58d90ab8c19f5858956389
4
+ data.tar.gz: 33670fe41d7bfeea58845ad64ff3663b36a018fe
5
5
  SHA512:
6
- metadata.gz: d44d0aa1fdb4dc000ba159948723e4314014d67917be7a131066ce99d079452f8e40963d0cd33d95295fee28345333f6b8f099b92c39375ccb139e6285935c9f
7
- data.tar.gz: 8f03486d52cb21770c8cb0314f090ab4096f1da54c8904fffe51933d5e406a3eda80cc91180d451c3f73adfcc27203348ec0f229a891157cd2a9ce9495bbf304
6
+ metadata.gz: 8c21e5298696a11f0a933421fc52fb912b6da27a484a273c866baba80271ded9b03050c8dafa35010179025ade41d0369c2f8f294c748fe56befa69d2faba8a5
7
+ data.tar.gz: eedceedad33c8cfe440ff4268474932b6010170232aa44602dd895ff78f46a15a9ec187e1c5fadd69c3fcea70b1c6454f03e24f89d789fcfdc24ec6efcfb6f9e
@@ -20,6 +20,9 @@ module JekyllTitlesFromHeadings
20
20
  # (footnotes at the moment).
21
21
  EXTRA_MARKUP_REGEX = %r!\[\^[^\]]*\]!
22
22
 
23
+ # Regex to determine if the given document is the site's homepage
24
+ HOMEPAGE_REGEX = %r!^/(index.html?)?$!
25
+
23
26
  safe true
24
27
  priority :lowest
25
28
 
@@ -37,7 +40,7 @@ module JekyllTitlesFromHeadings
37
40
  end
38
41
 
39
42
  def should_add_title?(document)
40
- markdown?(document) && !title?(document)
43
+ markdown?(document) && !title?(document) && !homepage?(document)
41
44
  end
42
45
 
43
46
  def title?(document)
@@ -71,5 +74,9 @@ module JekyllTitlesFromHeadings
71
74
  def filters
72
75
  @filters ||= JekyllTitlesFromHeadings::Filters.new(site)
73
76
  end
77
+
78
+ def homepage?(document)
79
+ document.url =~ HOMEPAGE_REGEX
80
+ end
74
81
  end
75
82
  end
@@ -1,3 +1,3 @@
1
1
  module JekyllTitlesFromHeadings
2
- VERSION = "0.2.0".freeze
2
+ VERSION = "0.3.0".freeze
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: jekyll-titles-from-headings
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ben Balter
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-06-01 00:00:00.000000000 Z
11
+ date: 2017-07-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: jekyll