Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
J
jekyll-scholar-extras
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
caesr-pub
jekyll-scholar-extras
Commits
81e99c51
Commit
81e99c51
authored
Feb 23, 2016
by
rmrf
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix the rendering of repository links
parent
bda2d480
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
4 additions
and
166 deletions
+4
-166
lib/jekyll/scholar/extras/bibliography_bytype.rb
lib/jekyll/scholar/extras/bibliography_bytype.rb
+2
-1
lib/jekyll/scholar/extras/bibliography_hdp.rb
lib/jekyll/scholar/extras/bibliography_hdp.rb
+0
-82
lib/jekyll/scholar/extras/bibliography_year.rb
lib/jekyll/scholar/extras/bibliography_year.rb
+2
-1
lib/jekyll/scholar/extras/details_hdp.rb
lib/jekyll/scholar/extras/details_hdp.rb
+0
-82
No files found.
lib/jekyll/scholar/extras/bibliography_bytype.rb
View file @
81e99c51
...
...
@@ -94,7 +94,8 @@ module Jekyll
if
not
repository_link_for
(
entry
).
nil?
puts
"link is not null"
puts
repository_link_for
(
entry
)
reference
<<
"<a class=
\"
pure-button-green
\"
href=
\"
"
+
repository_link_for
(
entry
)
+
"
\"
>PDF</a>"
pdflink
=
"<div class=
\"
pure-button csl-pdf
\"
><a href=
\"
"
+
repository_link_for
(
entry
)
+
"
\"
>PDF</a></div>"
reference
.
insert
(
reference
.
rindex
(
'</div>'
),
pdflink
.
to_s
)
end
end
...
...
lib/jekyll/scholar/extras/bibliography_hdp.rb
deleted
100644 → 0
View file @
bda2d480
module
Jekyll
class
Scholar
class
BibliographyHDPTag
<
Liquid
::
Tag
include
Scholar
::
Utilities
include
ScholarExtras
::
Utilities
def
initialize
(
tag_name
,
arguments
,
tokens
)
super
@config
=
Scholar
.
defaults
.
dup
@bibtex_file
=
arguments
.
strip
end
def
render
(
context
)
set_context_to
context
year_section
=
''
opts
=
[
'@*[public!=no]'
]
#references = public_entries.map do |entry|
references
=
get_entries
(
opts
).
map
do
|
entry
|
reference
=
''
ref
=
''
ref
=
CiteProc
.
process
entry
.
to_citeproc
,
:style
=>
config
[
'style'
],
:locale
=>
config
[
'locale'
],
:format
=>
'html'
content_tag
:span
,
ref
,
:id
=>
entry
.
key
if
entry
.
field?
(
:year
)
if
(
year_section
!=
entry
[
:year
])
reference
<<
"<h1>"
reference
<<
entry
[
:year
].
to_s
reference
<<
"</h1>"
year_section
=
entry
[
:year
]
end
end
reference
<<
ref
if
generate_details?
reference
<<
"<br />"
reference
<<
link_to
(
details_link_for
(
entry
),
config
[
'details_link'
])
reference
<<
"."
end
if
entry
.
field?
(
:pdflink1
)
or
entry
.
field?
(
:slides
)
reference
<<
"<b> Downloads: </b>"
end
if
entry
.
field?
(
:pdflink1
)
#if config['pdf_logo']
# puts "pdf_logo"
# reference << "<img class=\"alignleft\" title=\"pdf\" src=" + config['pdf_logo'] + "alt=\"\" width=\"50\" height=\"30\" />"
# else
reference
<<
"<a href=
\"
"
+
entry
[
:pdflink1
].
to_s
+
"
\"
>PDF</a>"
# end
end
if
entry
.
field?
(
:slides
)
# if config['ppt_logo']
# puts "ppt_logo"
# reference << "<img class=\"alignleft\" title=\"ppt\" src=" + config['ppt_logo'] + "alt=\"\" width=\"50\" height=\"30\" />"
# else
reference
<<
"<a href=
\"
"
+
entry
[
:slides
].
to_s
+
"
\"
>, Slides</a>"
# end
end
content_tag
:br
,
reference
end
references
.
join
(
"
\n
"
)
#content_tag :ul, references.join("\n")
#content_tag :li, reference
end
end
end
end
Liquid
::
Template
.
register_tag
(
'bibliography_hdp'
,
Jekyll
::
Scholar
::
BibliographyHDPTag
)
lib/jekyll/scholar/extras/bibliography_year.rb
View file @
81e99c51
...
...
@@ -112,7 +112,8 @@ module Jekyll
if
not
repository_link_for
(
entry
).
nil?
puts
"link is not null"
puts
repository_link_for
(
entry
)
reference
<<
"<a href=
\"
"
+
repository_link_for
(
entry
)
+
"
\"
>PDF</a>"
pdflink
=
"<div class=
\"
pure-button csl-pdf
\"
><a href=
\"
"
+
repository_link_for
(
entry
)
+
"
\"
>PDF</a></div>"
reference
.
insert
(
reference
.
rindex
(
'</div>'
),
pdflink
.
to_s
)
end
end
# Content tag is dependent on type of article.
...
...
lib/jekyll/scholar/extras/details_hdp.rb
deleted
100644 → 0
View file @
bda2d480
module
Jekyll
class
Scholar
class
Details
<
Page
include
Scholar
::
Utilities
def
initialize
(
site
,
base
,
dir
,
entry
)
@site
,
@base
,
@dir
=
site
,
base
,
dir
@config
=
Scholar
.
defaults
.
merge
(
site
.
config
[
'scholar'
]
||
{})
@name
=
details_file_for
(
entry
)
process
(
@name
)
read_yaml
(
File
.
join
(
base
,
'_layouts'
),
config
[
'details_layout'
])
liquidify
(
entry
)
end
private
def
liquidify
(
entry
)
data
[
'entry'
]
=
{}
data
[
'entry'
][
'key'
]
=
entry
.
key
data
[
'entry'
][
'type'
]
=
entry
.
type
entry
.
fields
.
each
do
|
key
,
value
|
data
[
'entry'
][
key
.
to_s
]
=
value
.
to_s
end
data
[
'entry'
][
'bibtex'
]
=
entry
.
to_s
# This is to get the CSL style output.
data
[
'entry'
][
'citeproc'
]
=
CiteProc
.
process
entry
.
to_citeproc
,
:style
=>
config
[
'style'
],
:locale
=>
config
[
'locale'
],
:format
=>
'html'
#puts data['entry']['citeproc'].class
if
entry
.
field?
(
:pdflink1
)
data
[
'entry'
][
'pdflink1'
]
=
entry
[
:pdflink1
].
to_s
end
if
entry
.
field?
(
:slides
)
data
[
'entry'
][
'slides'
]
=
entry
[
:slides
].
to_s
end
#name = entry.key.to_s.dup
# name.gsub!(/[:\s]+/, '_')
# data['entry']['pdflink'] = '../pdfs/' + name.to_s + '.pdf'
end
end
class
DetailsGenerator
<
Generator
include
Scholar
::
Utilities
safe
true
attr_reader
:config
def
generate
(
site
)
@site
,
@config
=
site
,
Scholar
.
defaults
.
merge
(
site
.
config
[
'scholar'
]
||
{})
if
generate_details?
entries
.
each
do
|
entry
|
details
=
Details
.
new
(
site
,
site
.
source
,
details_path
,
entry
)
details
.
render
(
site
.
layouts
,
site
.
site_payload
)
details
.
write
(
site
.
dest
)
site
.
pages
<<
details
end
end
end
end
end
end
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment