Skip to content

Remove deprecated defs #89

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

Merged
merged 4 commits into from
Feb 3, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 0 additions & 16 deletions lib/jekyll-archives.rb
Original file line number Diff line number Diff line change
Expand Up @@ -84,22 +84,6 @@ def enabled?(archive)
end
end

# Renders the archives into the layouts
def render
payload = @site.site_payload
@archives.each do |archive|
archive.render(@site.layouts, payload)
end
end

# Write archives to their destination
def write
@archives.each do |archive|
archive.write(@site.dest) if archive.regenerate?
archive.add_dependencies
end
end

def tags
@site.post_attr_hash("tags")
end
Expand Down
44 changes: 0 additions & 44 deletions lib/jekyll-archives/archive.rb
Original file line number Diff line number Diff line change
Expand Up @@ -89,42 +89,6 @@ def permalink
data && data.is_a?(Hash) && data["permalink"]
end

# Add any necessary layouts to this post
#
# layouts - The Hash of {"name" => "layout"}.
# site_payload - The site payload Hash.
#
# Returns nothing.
def render(layouts, site_payload)
payload = Utils.deep_merge_hashes({
"page" => to_liquid
}, site_payload)

do_layout(payload, layouts)
end

# Add dependencies for incremental mode
def add_dependencies
if defined? site.regenerator
archive_path = site.in_dest_dir(relative_path)
site.regenerator.add(archive_path)
@posts.each do |post|
site.regenerator.add_dependency(archive_path, post.path)
end
end
end

# Convert this Convertible's data to a Hash suitable for use by Liquid.
#
# Returns the Hash representation of this Convertible.
def to_liquid(attrs = nil)
further_data = Hash[(attrs || self.class::ATTRIBUTES_FOR_LIQUID).map do |attribute|
[attribute, send(attribute)]
end]

Utils.deep_merge_hashes(data, further_data)
end

# Produce a title object suitable for Liquid based on type of archive.
#
# Returns a String (for tag and category archives) and nil for
Expand Down Expand Up @@ -152,14 +116,6 @@ def relative_path
path
end

def regenerate?
if defined? site.regenerator
site.regenerator.regenerate?(self)
else
true
end
end

# Returns the object as a debug String.
def inspect
"#<Jekyll:Archive @type=#{@type} @title=#{@title} @data=#{@data.inspect}>"
Expand Down