Commit beb8f1c9 authored by Takuya Noguchi's avatar Takuya Noguchi

Remove "Details" from breadcrumb item and JSON+LD from Project top

Reduces the size of JSON+JD
Signed-off-by: default avatarTakuya Noguchi <takninnovationresearch@gmail.com>
parent 064cc44e
- container = @no_breadcrumb_container ? 'container-fluid' : container_class
- hide_top_links = @hide_top_links || false
- push_to_schema_breadcrumb(@breadcrumb_title, breadcrumb_title_link)
- unless @skip_current_level_breadcrumb
- push_to_schema_breadcrumb(@breadcrumb_title, breadcrumb_title_link)
%nav.breadcrumbs{ role: "navigation", class: [container, @content_class] }
.breadcrumbs-container{ class: ("border-bottom-0" if @no_breadcrumb_border) }
......@@ -16,8 +17,10 @@
- @breadcrumbs_extra_links.each do |extra|
= breadcrumb_list_item link_to(extra[:text], extra[:link])
= render "layouts/nav/breadcrumbs/collapsed_dropdown", location: :after
%li
%h2.breadcrumbs-sub-title= link_to @breadcrumb_title, breadcrumb_title_link
- unless @skip_current_level_breadcrumb
%li
%h2.breadcrumbs-sub-title
= link_to @breadcrumb_title, breadcrumb_title_link
%script{ type:'application/ld+json' }
:plain
#{schema_breadcrumb_json}
......
- @content_class = "limit-container-width" unless fluid_layout
- default_branch_name = @project.default_branch || "master"
- breadcrumb_title _("Details")
- page_title _("Details")
- @skip_current_level_breadcrumb = true
= render partial: 'flash_messages', locals: { project: @project }
......
- breadcrumb_title _("Details")
- page_title _("Details")
- page_title _('No repository')
- @skip_current_level_breadcrumb = true
%h2.gl-display-flex
.gl-display-flex.gl-align-items-center.gl-justify-content-center
......
- breadcrumb_title _("Details")
- @content_class = "limit-container-width" unless fluid_layout
- @skip_current_level_breadcrumb = true
= content_for :meta_tags do
= auto_discovery_link_tag(:atom, project_path(@project, rss_url_options), title: "#{@project.name} activity")
......
---
title: Remove "Details" from breadcrumb item and LD+JSON from Project top
merge_request: 47817
author: Takuya Noguchi
type: changed
......@@ -15,15 +15,12 @@ RSpec.describe 'Breadcrumbs schema markup', :aggregate_failures do
item_list = get_schema_content
expect(item_list.size).to eq 3
expect(item_list.size).to eq 2
expect(item_list[0]['name']).to eq project.namespace.name
expect(item_list[0]['item']).to eq user_url(project.owner)
expect(item_list[1]['name']).to eq project.name
expect(item_list[1]['item']).to eq project_url(project)
expect(item_list[2]['name']).to eq 'Details'
expect(item_list[2]['item']).to eq project_url(project)
end
it 'generates the breadcrumb schema for group projects' do
......@@ -31,7 +28,7 @@ RSpec.describe 'Breadcrumbs schema markup', :aggregate_failures do
item_list = get_schema_content
expect(item_list.size).to eq 4
expect(item_list.size).to eq 3
expect(item_list[0]['name']).to eq group.name
expect(item_list[0]['item']).to eq group_url(group)
......@@ -40,9 +37,6 @@ RSpec.describe 'Breadcrumbs schema markup', :aggregate_failures do
expect(item_list[2]['name']).to eq group_project.name
expect(item_list[2]['item']).to eq project_url(group_project)
expect(item_list[3]['name']).to eq 'Details'
expect(item_list[3]['item']).to eq project_url(group_project)
end
it 'generates the breadcrumb schema for group' do
......
......@@ -78,14 +78,14 @@ RSpec.describe 'Profile > Account', :js do
update_username(new_username)
visit new_project_path
expect(current_path).to eq(new_project_path)
expect(find('.breadcrumbs-sub-title')).to have_content('Details')
expect(find('.breadcrumbs')).to have_content(user.name)
end
it 'the old project path redirects to the new path' do
update_username(new_username)
visit old_project_path
expect(current_path).to eq(new_project_path)
expect(find('.breadcrumbs-sub-title')).to have_content('Details')
expect(find('.breadcrumbs')).to have_content(user.name)
end
end
end
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment