Skip to content
Open
Changes from 2 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
9 changes: 8 additions & 1 deletion lib/jekyll-github-metadata/edit-link-tag.rb
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ def self.def_hash_delegator(hash_method, key, method, default = nil)
private def_hash_delegator :site_github, :source, :source, {}
private def_hash_delegator :source, :branch, :branch
private def_hash_delegator :source, :path, :source_path
private def_hash_delegator :page, :path, :page_path

def render(context)
@context = context
Expand Down Expand Up @@ -72,6 +71,14 @@ def parts
memoize_conditionally { [repository_url, "edit/", branch, source_path, page_path] }
end

def page_path
return page["path"] unless page["paginated"]

site.pages.dup.select do |page|
return page["path"] if page.pager && page.pager.page == 1
end
end

def parts_normalized
memoize_conditionally do
parts.map.with_index do |part, index|
Expand Down