Skip to content

Commit

Permalink
Provide invokables for common drop query keys (#8165)
Browse files Browse the repository at this point in the history
Merge pull request 8165
  • Loading branch information
ashmaroli committed May 10, 2020
1 parent 9f31fe1 commit 88e3078
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
12 changes: 12 additions & 0 deletions lib/jekyll/drops/document_drop.rb
Expand Up @@ -64,6 +64,18 @@ def collapse_document(doc)
result[key] = doc[key] unless NESTED_OBJECT_FIELD_BLACKLIST.include?(key)
end
end

def title
@obj.data["title"]
end

def categories
@obj.data["categories"]
end

def tags
@obj.data["tags"]
end
end
end
end
4 changes: 4 additions & 0 deletions lib/jekyll/drops/page_drop.rb
Expand Up @@ -9,6 +9,10 @@ class PageDrop < Drop

def_delegators :@obj, :content, :dir, :name, :path, :url
private def_delegator :@obj, :data, :fallback_data

def title
@obj.data["title"]
end
end
end
end

0 comments on commit 88e3078

Please sign in to comment.