Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
caesr-pub
jekyll-scholar
Commits
e56c9c20
Commit
e56c9c20
authored
Feb 01, 2016
by
Patrick de Kok
Browse files
Made a single reader
parent
85b160dc
Changes
1
Hide whitespace changes
Inline
Side-by-side
lib/jekyll/scholar/utilities.rb
View file @
e56c9c20
...
...
@@ -202,10 +202,18 @@ module Jekyll
.
flatten
end
def
group?
(
group_by
.
nil?
&&
config
[
'group_by'
]
!=
'none'
)
||
(
!
group_by
.
nil?
&&
group_by
!=
'none'
)
def
group_by
if
group_by
.
nil?
||
group_by
.
empty?
@group_by
=
config
[
'group_by'
]
else
@group_by
=
'none'
end
end
def
group?
group_by
!=
'none'
end
def
group
(
ungrouped
)
def
grouper
(
items
,
keys
,
order
)
groups
=
items
...
...
@@ -226,7 +234,7 @@ module Jekyll
def
group_keys
return
@group_keys
unless
@group_keys
.
nil?
@group_keys
=
Array
(
(
group_by
.
nil?
||
group_by
.
empty?
)
?
config
[
'group_by'
]
:
group_by
)
@group_keys
=
Array
(
group_by
)
.
map
{
|
key
|
key
.
to_s
.
split
(
/\s*,\s*/
)
}
.
flatten
.
map
{
|
key
|
key
==
'month'
?
'month_numeric'
:
key
}
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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