Compare commits

..

No commits in common. "targetable-sites" and "master" have entirely different histories.

6 changed files with 9 additions and 14 deletions

View File

@ -185,8 +185,7 @@ module Jekyll
#
# Returns true if the 'write' metadata is true, false otherwise.
def write?
!!metadata.fetch("output", false) &&
(site.target == metadata.fetch("target", site.target))
!!metadata.fetch("output", false)
end
# The URL template to render collection's documents at.

View File

@ -30,7 +30,6 @@ module Jekyll
"limit_posts" => 0,
"future" => false,
"unpublished" => false,
"target" => "default",
# Plugins
"whitelist" => [],

View File

@ -348,20 +348,17 @@ module Jekyll
end
# Determine whether this document should be written.
# Based on the Collection to which it belongs
# and site and document target.
# Based on the Collection to which it belongs.
#
# True if the document has a collection and if that collection's #write?
# method returns true, and if the site's Publisher will publish the document,
# and if the document's target matches the site target or is undefined.
# method returns true, and if the site's Publisher will publish the document.
# False otherwise.
#
# rubocop:disable Naming/MemoizedInstanceVariableName
def write?
return @write_p if defined?(@write_p)
@write_p = collection&.write? && site.publisher.publish?(self) &&
(site.target == data.fetch("target", site.target))
@write_p = collection&.write? && site.publisher.publish?(self)
end
# rubocop:enable Naming/MemoizedInstanceVariableName

View File

@ -15,7 +15,7 @@ module Jekyll
private delegate_method_as :data, :fallback_data
delegate_methods :id, :output, :content, :to_s, :relative_path, :url, :date
data_delegators "title", "categories", "tags", :target
data_delegators "title", "categories", "tags"
def collection
@obj.collection.label

View File

@ -180,7 +180,7 @@ module Jekyll
end
def write?
site.config["target"] == data.fetch("target", site.config["target"])
true
end
def excerpt_separator

View File

@ -6,7 +6,7 @@ module Jekyll
:file_read_opts, :future, :gems, :generators, :highlighter,
:include, :inclusions, :keep_files, :layouts, :limit_posts,
:lsi, :pages, :permalink_style, :plugin_manager, :plugins,
:reader, :safe, :target, :show_drafts, :static_files, :theme, :time,
:reader, :safe, :show_drafts, :static_files, :theme, :time,
:unpublished
attr_reader :cache_dir, :config, :dest, :filter_cache, :includes_load_paths,
@ -47,7 +47,7 @@ module Jekyll
def config=(config)
@config = config.clone
%w(safe lsi highlighter baseurl exclude include future unpublished target
%w(safe lsi highlighter baseurl exclude include future unpublished
show_drafts limit_posts keep_files).each do |opt|
send(:"#{opt}=", config[opt])
end
@ -360,7 +360,7 @@ module Jekyll
end
def each_site_file
pages.each { |page| yield (page) if page.write? }
pages.each { |page| yield page }
static_files.each { |file| yield(file) if file.write? }
collections.each_value { |coll| coll.docs.each { |doc| yield(doc) if doc.write? } }
end