Commit 8c893e69 authored by Sylvester Keil's avatar Sylvester Keil

Expose entry title as page title on detail pages

Fixes #120
parent e091ab59
...@@ -3,7 +3,7 @@ Feature: Details ...@@ -3,7 +3,7 @@ Feature: Details
I want to publish my BibTeX bibliography on my blog I want to publish my BibTeX bibliography on my blog
And I want Jekyll to generate detail pages for all the entries in my bibliography And I want Jekyll to generate detail pages for all the entries in my bibliography
@generators @generators @wip
Scenario: A bibliography with a single entry Scenario: A bibliography with a single entry
Given I have a scholar configuration with: Given I have a scholar configuration with:
| key | value | | key | value |
...@@ -16,6 +16,7 @@ Feature: Details ...@@ -16,6 +16,7 @@ Feature: Details
title = {The Ruby Programming Language}, title = {The Ruby Programming Language},
author = {Flanagan, David and Matsumoto, Yukihiro}, author = {Flanagan, David and Matsumoto, Yukihiro},
year = {2008}, year = {2008},
comment = {A Comment},
publisher = {O'Reilly Media} publisher = {O'Reilly Media}
} }
""" """
...@@ -27,7 +28,8 @@ Feature: Details ...@@ -27,7 +28,8 @@ Feature: Details
<html> <html>
<head></head> <head></head>
<body> <body>
{{ page.entry.title }} {{ page.title }}
{{ page.entry.comment }}
</body> </body>
</html> </html>
""" """
...@@ -35,6 +37,7 @@ Feature: Details ...@@ -35,6 +37,7 @@ Feature: Details
Then the _site directory should exist Then the _site directory should exist
And the "_site/bibliography/ruby.html" file should exist And the "_site/bibliography/ruby.html" file should exist
And I should see "The Ruby Programming Language" in "_site/bibliography/ruby.html" And I should see "The Ruby Programming Language" in "_site/bibliography/ruby.html"
And I should see "A Comment" in "_site/bibliography/ruby.html"
@generators @generators
Scenario: LaTeX conversion is applied to everything except the bibtex field Scenario: LaTeX conversion is applied to everything except the bibtex field
......
...@@ -15,6 +15,7 @@ module Jekyll ...@@ -15,6 +15,7 @@ module Jekyll
process(@name) process(@name)
read_yaml(File.join(base, '_layouts'), config['details_layout']) read_yaml(File.join(base, '_layouts'), config['details_layout'])
data['title'] = entry.title.to_s
data.merge!(reference_data(entry)) data.merge!(reference_data(entry))
end end
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment