Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
caesr-pub
jekyll-scholar
Commits
3c07e497
Commit
3c07e497
authored
Sep 21, 2015
by
Sylvester Keil
Browse files
Merge pull request #103 from hendrikvanantwerpen/master
Details
parents
6fa26332
75fd097f
Changes
3
Hide whitespace changes
Inline
Side-by-side
features/details.feature
View file @
3c07e497
...
...
@@ -182,7 +182,7 @@ Feature: Details
Then
the _site directory should exist
And
I should see
"pretty"
in
"_config.yml"
And
the
"_site/scholar/index.html"
file should exist
And
I should see
"<a[^>]+href=\"
/bibliography/ruby/
index.html
\">" in
"_site/scholar/index.html"
And
I should see
"<a[^>]+href=\"
/bibliography/ruby/\">" in
"_site/scholar/index.html"
And
the
"_site/bibliography/ruby/index.html"
file should exist
@generators
@parse_months
...
...
lib/jekyll/scholar/generators/details.rb
View file @
3c07e497
...
...
@@ -15,7 +15,7 @@ module Jekyll
process
(
@name
)
read_yaml
(
File
.
join
(
base
,
'_layouts'
),
config
[
'details_layout'
])
data
[
'entry'
]
=
liquidify
(
entry
)
data
.
merge!
(
reference_data
(
entry
)
)
end
end
...
...
lib/jekyll/scholar/utilities.rb
View file @
3c07e497
...
...
@@ -272,16 +272,22 @@ module Jekyll
def
bibliography_tag
(
entry
,
index
)
return
missing_reference
unless
entry
liquid_template
.
render
({
liquid_template
.
render
(
reference_data
(
entry
,
index
).
merge
({
'index'
=>
index
,
'details'
=>
details_link_for
(
entry
)
}))
end
def
reference_data
(
entry
,
index
=
nil
)
{
'entry'
=>
liquidify
(
entry
),
'reference'
=>
reference_tag
(
entry
,
index
),
'key'
=>
entry
.
key
,
'type'
=>
entry
.
type
.
to_s
,
'link'
=>
repository_link_for
(
entry
),
'links'
=>
repository_links_for
(
entry
),
'index'
=>
index
,
'details'
=>
details_link_for
(
entry
)
})
'links'
=>
repository_links_for
(
entry
)
}
end
def
liquidify
(
entry
)
...
...
@@ -323,7 +329,7 @@ module Jekyll
name
.
gsub!
(
/[:\s]+/
,
'_'
)
if
site
.
config
[
'permalink'
]
==
'pretty'
name
<<
'/
index.html
'
name
<<
'/'
else
name
<<
'.html'
end
...
...
Write
Preview
Supports
Markdown
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