jekyll-scholar 5.4.1 → 5.5.0

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: e0cec8fe71f3f994b44818f868b753afc2ca32e6
4
- data.tar.gz: c181bfd8b43b2db0f9e9b231b1714f3267e4d5fb
3
+ metadata.gz: 8e87d0e6fcb91e60fdbd782fda327d0c6be06eae
4
+ data.tar.gz: 812005cac2d21455d371b1bb1674abc825aa6a60
5
5
  SHA512:
6
- metadata.gz: 619c42158d5dafca93a70f451064857058d0452e118e2fb3b76f286d5e1046d47e4ff2c82e606db77270f2a71138b4afee1b6562c5fc239e7cc381f5a79bc258
7
- data.tar.gz: dff7bbecefa7c8a9d6c98680c7a0b4519fa294c08aaf14f28bd5db97082f067582de4ff8a0c76c97ac2e47bd764cdb56ac60a69f86050516353962838c4032be
6
+ metadata.gz: 2050f5a46c83b8ef0321f5113ce343b56167bdd4bc2a1b765f401bcc23da5095e1e83ef57bf189d77d3dcb54148c69762907d01bfdd174475850b79189b6d503
7
+ data.tar.gz: a40c832f357c6489c83f74da9dfbf0bc9b1b4986a04c1cce612695021aa4435d3d11ef047a19eb09c4f7a8d74f9159f1ddf0e8fefac7187dc512402554a2e220
data/README.md CHANGED
@@ -384,6 +384,11 @@ a specific page. As an example, the tag
384
384
  will attempt to read the key `ruby` from file `/home/foo/bar.bib`. It will not
385
385
  fallback to the default BibTeX file.
386
386
 
387
+ #### Citation pointing to another page in your site
388
+ In some cases, you might want your citation to link to another page on your cite (ex. a separate works cited page). As a solution, Jekyll-Scholar provides the `--relative` tag. For example, if you wanted the link to point to an ID in a bibliography.html page, you would use:
389
+
390
+ {% cite ruby --relative bibliography.html %}
391
+
387
392
  #### Multiple bibliographies within one document (like [multibib.sty](http://www.ctan.org/pkg/multibib))
388
393
 
389
394
  When you have multiple `{% bibliography %}` sections in one file,
@@ -3,7 +3,7 @@ Feature: Details
3
3
  I want to publish my BibTeX bibliography on my blog
4
4
  And I want Jekyll to generate detail pages for all the entries in my bibliography
5
5
 
6
- @generators @wip
6
+ @generators
7
7
  Scenario: A bibliography with a single entry
8
8
  Given I have a scholar configuration with:
9
9
  | key | value |
@@ -15,7 +15,7 @@ module Jekyll
15
15
  process(@name)
16
16
  read_yaml(File.join(base, '_layouts'), config['details_layout'])
17
17
 
18
- data['title'] = entry.title.to_s
18
+ data['title'] = entry.title.to_s if entry.field?(:title)
19
19
  data.merge!(reference_data(entry))
20
20
  end
21
21
 
@@ -17,7 +17,10 @@ module Jekyll
17
17
  # #site readers
18
18
  module Utilities
19
19
 
20
- attr_reader :config, :site, :context, :prefix, :text, :offset, :max
20
+
21
+ attr_reader :config, :site, :context, :prefix, :text, :offset, :max, :relative
22
+
23
+
21
24
 
22
25
  def split_arguments(arguments)
23
26
 
@@ -52,12 +55,16 @@ module Jekyll
52
55
 
53
56
  opts.on('-q', '--query QUERY') do |query|
54
57
  @query = query
55
- end
58
+ end
56
59
 
57
60
  opts.on('-p', '--prefix PREFIX') do |prefix|
58
61
  @prefix = prefix
59
62
  end
60
63
 
64
+ opts.on('-r', '--relative RELATIVE') do |relative|
65
+ @relative = relative
66
+ end
67
+
61
68
  opts.on('-t', '--text TEXT') do |text|
62
69
  @text = text
63
70
  end
@@ -83,7 +90,7 @@ module Jekyll
83
90
  end
84
91
  end
85
92
 
86
- argv = arguments.split(/(\B-[cCfqptTslomA]|\B--(?:cited(_in_order)?|file|query|prefix|text|style|template|locator|offset|max|suppress_author|))/)
93
+ argv = arguments.split(/(\B-[cCfqrptTslomA]|\B--(?:cited(_in_order)?|file|query|relative|prefix|text|style|template|locator|offset|max|suppress_author|))/)
87
94
 
88
95
  parser.parse argv.map(&:strip).reject(&:empty?)
89
96
  end
@@ -567,6 +574,10 @@ module Jekyll
567
574
  (context['citation_numbers'] ||= {})[key] ||= cited_keys.length
568
575
  end
569
576
 
577
+ def link_target_for key
578
+ "#{relative}##{[prefix, key].compact.join('-')}"
579
+ end
580
+
570
581
  def cite(keys)
571
582
  items = keys.map do |key|
572
583
  if bibliography.key?(key)
@@ -577,7 +588,7 @@ module Jekyll
577
588
  end
578
589
  end
579
590
 
580
- link_to "##{[prefix, keys[0]].compact.join('-')}", render_citation(items)
591
+ link_to link_target_for(keys[0]), render_citation(items)
581
592
  end
582
593
 
583
594
  def cite_details(key, text)
@@ -1,5 +1,5 @@
1
1
  module Jekyll
2
2
  class Scholar
3
- VERSION = '5.4.1'.freeze
3
+ VERSION = '5.5.0'.freeze
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: jekyll-scholar
3
3
  version: !ruby/object:Gem::Version
4
- version: 5.4.1
4
+ version: 5.5.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sylvester Keil
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-01-13 00:00:00.000000000 Z
11
+ date: 2016-01-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: jekyll