Skip to content

Commit

Permalink
Fix edit link on /latest/ pages
Browse files Browse the repository at this point in the history
  • Loading branch information
mheap committed Jun 13, 2022
1 parent a3fba71 commit 473ed90
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions app/_plugins/generators/latest_version_generator.rb
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,8 @@ def generate(site) # rubocop:disable Metrics/AbcSize, Metrics/CyclomaticComplexi
page.url.gsub(release_path, 'latest'),
page.content,
page.data,
@page_index["#{product_name}/#{release_path}/"]
@page_index["#{product_name}/#{release_path}/"],
page.path
)
site.pages << page
end
Expand All @@ -67,18 +68,19 @@ def remove_generated_prefix(path)
end

class DuplicatePage < ::Jekyll::Page
def initialize(site, base_dir, path, content, data, page_index) # rubocop:disable Lint/MissingSuper, Metrics/ParameterLists
def initialize(site, base_dir, url, content, data, page_index, path) # rubocop:disable Lint/MissingSuper, Metrics/ParameterLists, Metrics/MethodLength
@site = site
@base = base_dir
@content = content

@dir = path
@dir = url
@name = 'index.md'

process(@name)
@data = data.clone
@data['is_latest'] = true
@data['version-index'] = page_index
@data['edit_link'] = "app/#{path}"

@data['alias'] = [@dir.sub('latest/', '')] if @dir.end_with?('/latest/')
end
Expand Down

0 comments on commit 473ed90

Please sign in to comment.