Commit f9e5c5ee authored by rmrf's avatar rmrf

Public entries supported by default

parent 0a7e6caa
require 'jekyll/scholar' require 'jekyll/scholar'
require 'jekyll/scholar/extras/extra_utils'
require 'jekyll/scholar/extras/bibliography_hdp' require 'jekyll/scholar/extras/bibliography_hdp'
require 'jekyll/scholar/extras/details_hdp' require 'jekyll/scholar/extras/details_hdp'
...@@ -3,6 +3,7 @@ module Jekyll ...@@ -3,6 +3,7 @@ module Jekyll
class BibliographyHDPTag < Liquid::Tag class BibliographyHDPTag < Liquid::Tag
include Scholar::Utilities include Scholar::Utilities
include ScholarExtras::Utilities
def initialize(tag_name, arguments, tokens) def initialize(tag_name, arguments, tokens)
super super
...@@ -15,7 +16,7 @@ module Jekyll ...@@ -15,7 +16,7 @@ module Jekyll
set_context_to context set_context_to context
year_section = '' year_section = ''
references = entries.map do |entry| references = public_entries.map do |entry|
reference = '' reference = ''
ref = '' ref = ''
......
module Jekyll module Jekyll
class Scholar class ScholarExtras
module ExtraUtilities module Utilities
attr_reader :bibtex_file, :config, :site attr_reader :bibtex_file, :config, :site
...@@ -17,9 +17,9 @@ module Jekyll ...@@ -17,9 +17,9 @@ module Jekyll
@bibliography ||= BibTeX.open(bibtex_path, bibtex_options) @bibliography ||= BibTeX.open(bibtex_path, bibtex_options)
end end
def entries_public def public_entries
puts 'entries public only' b = bibliography['@*[public!=no]']
b = bibliography[config['query']] # b = bibliography[config['query']]
unless config['sort_by'] == 'none' unless config['sort_by'] == 'none'
b.sort_by! { |e| e[config['sort_by']].to_s } b.sort_by! { |e| e[config['sort_by']].to_s }
......
...@@ -29,4 +29,4 @@ scholar: ...@@ -29,4 +29,4 @@ scholar:
bibliography: test.bib bibliography: test.bib
details_dir: ./publications/details details_dir: ./publications/details
details_layout: details.html details_layout: details.html
query: "@*[public!=no]" #query: "@*[public!=no]"
...@@ -29,6 +29,7 @@ ...@@ -29,6 +29,7 @@
pages = {674-681}, pages = {674-681},
title = {commentary on action in perception}, title = {commentary on action in perception},
volume = {76}, volume = {76},
public = {yes},
year = {2008}} year = {2008}}
@article{martin:2008kl, @article{martin:2008kl,
...@@ -42,5 +43,6 @@ ...@@ -42,5 +43,6 @@
pages = {674-681}, pages = {674-681},
title = {commentary on action in perception}, title = {commentary on action in perception},
volume = {76}, volume = {76},
public = {no},
year = {2008}} year = {2008}}
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