Commit 3152df77 authored by Sylvester Keil's avatar Sylvester Keil
Browse files

improving on details page generator

parent a1cace40
......@@ -2,3 +2,7 @@ source :rubygems
gem 'unicode_utils'
group 'development' do
gem 'debugger'
Feature: BibTeX
As a scholar who likes to 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
Scenario: A bibliography with a single entry
Given I have a scholar configuration with:
| key | value |
| source | ./_bibliography |
| details_layout | details.html |
And I have a "_bibliography" directory
And I have a file "_bibliography/references.bib":
title = {The Ruby Programming Language},
author = {Flanagan, David and Matsumoto, Yukihiro},
year = {2008},
publisher = {O'Reilly Media}
And I have a "_layouts" directory
And I have a file "_layouts/details.html":
{{ page.entry.title }}
When I run jekyll
Then the _site directory should exist
And the "_site/bibliography/ruby.html" file should exist
And I should see "<i>The Ruby Programming Language</i>" in "_site/bibliography/ruby.html"
......@@ -3,8 +3,9 @@ require 'test/unit'
require 'jekyll/scholar'
# require 'ruby-debug'
# Debugger.start
require 'debugger'
World do
include Test::Unit::Assertions
......@@ -25,7 +25,7 @@ module Jekyll
bibliography references.bib
details_dir ./bibliography
detauls_layout bibtex.html
details_layout bibtex.html
......@@ -25,12 +25,11 @@ module Jekyll
attr_reader :config
def generate(site)
if site.config['scholar'] && site.layouts.key?(site.config['scholar']['details_layout'])
@config = Scholar.defaults.merge(site.config['scholar'] || {})
bibliography['@*'].each do |entry|
details =, site.source, config['details_dir'], entry)
if site.layouts.key?(File.basename(config['details_layout'], '.html'))
bibliography.each do |entry|
details =, site.source, config['details_dir'], entry)
details.render(site.layouts, site.site_payload)
......@@ -43,15 +42,11 @@ module Jekyll
def bibliography
@bibliography ||=, :filter => :latex)
def extend_path(name)
if name.nil? || name.empty?
name = config['bibliography']
@bibliography ||=, :filter => :latex)
p = File.join(config['source'], name)
def bibliography_path
p = File.join(config['source'], config['bibliography'])
p << '.bib' unless File.exists?(p)
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