-
-
Notifications
You must be signed in to change notification settings - Fork 10k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow the user to set collections_dir to put all collections under one subdirectory #6331
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -100,15 +100,15 @@ def filtered_entries | |
# Returns a String containing the directory name where the collection | ||
# is stored on the filesystem. | ||
def relative_directory | ||
@relative_directory ||= "_#{label}" | ||
@relative_directory ||= Pathname.new(directory).relative_path_from(Pathname.new(site.source)).to_s | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. is this a breaking change? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This isn't a breaking change because the functionality is now in the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It'd be a breaking change if plugins did |
||
end | ||
|
||
# The full path to the directory containing the collection. | ||
# | ||
# Returns a String containing th directory name where the collection | ||
# is stored on the filesystem. | ||
def directory | ||
@directory ||= site.in_source_dir(relative_directory) | ||
@directory ||= site.in_source_dir(File.join(site.config["collections_dir"], "_#{label}")) | ||
end | ||
|
||
# The full path to the directory containing the collection, with | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,6 +9,7 @@ class Configuration < Hash | |
# Where things are | ||
"source" => Dir.pwd, | ||
"destination" => File.join(Dir.pwd, "_site"), | ||
"collections_dir" => "", | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. in There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. an empty string here is fine. If |
||
"plugins_dir" => "_plugins", | ||
"layouts_dir" => "_layouts", | ||
"data_dir" => "_data", | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this should be
""
instead of a.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ashmaroli Isn't it the current directory? (ie: same as source?)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was pointing at a discrepancy in
lib/jekyll/configuration.rb
above and the documentation here..In
lib/jekyll/configuration.rb
above, its{"source" => Dir.pwd, "collections_dir" => ""}
but here itssource: .
andcollections_dir: .