jekyll-titles-from-headings 0.1.4 → 0.1.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +6 -4
- data/lib/jekyll-titles-from-headings/generator.rb +2 -0
- data/lib/jekyll-titles-from-headings/version.rb +1 -1
- metadata +6 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 84b1cda340e7783f0500f07bf11623b19b416ffb
|
4
|
+
data.tar.gz: f6dfc3e35d9f73b9e6c2f54305277382f082205b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8fcd40fa5b965ea1ff04572f493f47de8a67ba61b4096feb8ebecef6b0be01b7b968bbcf628b1c5806eeeec69aac508dfc19eca14651d7687cb7c13ba0ec2578
|
7
|
+
data.tar.gz: 689a0d575e1cfe1ffa95fea8d15a35112c7b79c205b394ef0e5bdaefbf5ea5b75893af44ee83e5703a1d7b76fb879aba541134ec58967eeff5bafb2b6ccc3175
|
data/README.md
CHANGED
@@ -1,18 +1,20 @@
|
|
1
1
|
# Jekyll Title from Headings
|
2
2
|
|
3
|
-
*A Jekyll plugin to pull page
|
3
|
+
*A Jekyll plugin to pull the page title from the first Markdown heading when none is specified.*
|
4
4
|
|
5
5
|
[](https://travis-ci.org/benbalter/jekyll-title-from-headings)
|
6
6
|
|
7
7
|
## What it does
|
8
8
|
|
9
|
-
If you have a Jekyll page that doesn't have a title specified in the YAML
|
9
|
+
If you have a Jekyll page that doesn't have a title specified in the YAML Front Matter, but the first non-whitespace line in the page is a Markdown H1 / H2 / H3, this plugin instructs Jekyll to use that first heading as the page's title.
|
10
10
|
|
11
11
|
## Why
|
12
12
|
|
13
|
-
Because lots of plugins and templates rely on `page.title
|
13
|
+
Because lots of plugins and templates rely on `page.title`.
|
14
14
|
|
15
|
-
|
15
|
+
If you're using a plugin like [Jekyll Optional Front Matter](https://github.com/benbalter/jekyll-optional-front-matter), you'd have to add Front Matter, just to get the title, which you're already specifying in the document.
|
16
|
+
|
17
|
+
Additionally, this allows you to store the title semantically, in the document itself so that it's readable, both as Markdown and when rendered, as machine-readable for plugins like [Jekyll SEO Tag](https://github.com/benbalter/jekyll-seo-tag).
|
16
18
|
|
17
19
|
## Usage
|
18
20
|
|
@@ -41,6 +41,8 @@ module JekyllTitlesFromHeadings
|
|
41
41
|
return document.data["title"] if title?(document)
|
42
42
|
matches = document.content.match(TITLE_REGEX)
|
43
43
|
matches[1] if matches
|
44
|
+
rescue ArgumentError => e
|
45
|
+
raise e unless e.to_s.start_with?("invalid byte sequence in UTF-8")
|
44
46
|
end
|
45
47
|
end
|
46
48
|
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.1.
|
4
|
+
version: 0.1.5
|
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-
|
11
|
+
date: 2017-03-28 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: jekyll
|
@@ -64,7 +64,7 @@ files:
|
|
64
64
|
- lib/jekyll-titles-from-headings.rb
|
65
65
|
- lib/jekyll-titles-from-headings/generator.rb
|
66
66
|
- lib/jekyll-titles-from-headings/version.rb
|
67
|
-
homepage: https://github.com/benbalter/titles-from-headings
|
67
|
+
homepage: https://github.com/benbalter/jekyll-titles-from-headings
|
68
68
|
licenses:
|
69
69
|
- MIT
|
70
70
|
metadata: {}
|
@@ -84,9 +84,9 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
84
84
|
version: '0'
|
85
85
|
requirements: []
|
86
86
|
rubyforge_project:
|
87
|
-
rubygems_version: 2.
|
87
|
+
rubygems_version: 2.6.11
|
88
88
|
signing_key:
|
89
89
|
specification_version: 4
|
90
|
-
summary: A Jekyll plugin to pull page
|
91
|
-
is specified
|
90
|
+
summary: A Jekyll plugin to pull the page title from the first Markdown heading when
|
91
|
+
none is specified.
|
92
92
|
test_files: []
|