Skip to content
代码片段 群组 项目
提交 15af18a7 编辑于 作者: Jannik Lehmann's avatar Jannik Lehmann 提交者: Andrew Fontaine
浏览文件

Reorder head tags to optimize rendering performance

上级 9d284d11
No related branches found
No related tags found
无相关合并请求
......@@ -3,12 +3,11 @@
- omit_og = sign_in_with_redirect?
%head{ omit_og ? { } : { prefix: "og: http://ogp.me/ns#" } }
%meta{ charset: "utf-8" }
%title= page_title(site_name)
= render 'layouts/loading_hints'
%meta{ 'http-equiv' => 'X-UA-Compatible', content: 'IE=edge' }
%meta{ name: 'viewport', content: 'width=device-width, initial-scale=1, maximum-scale=1' }
%title= page_title(site_name)
= Gon::Base.render_data(nonce: content_security_policy_nonce)
= yield :project_javascripts
= render 'layouts/startup_js'
= yield :startup_js
......@@ -18,8 +17,6 @@
= yield :prefetch_asset_tags
= favicon_link_tag favicon, id: 'favicon', data: { original_href: favicon }, type: 'image/png'
- diffs_colors = user_diffs_colors
= stylesheet_link_tag "themes/#{user_application_theme_css_filename}" if user_application_theme_css_filename
= render 'layouts/diffs_colors_css', diffs_colors if diffs_colors.present? || request.path == profile_preferences_path
......@@ -42,8 +39,7 @@
= stylesheet_link_tag 'performance_bar' if performance_bar_enabled?
= render 'layouts/snowplow'
= Gon::Base.render_data(nonce: content_security_policy_nonce)
= render 'layouts/loading_hints'
= render_if_exists 'layouts/header/translations'
- if Feature.enabled?(:enable_new_sentry_clientside_integration, current_user) && Gitlab::CurrentSettings.sentry_enabled
......@@ -58,8 +54,6 @@
= webpack_controller_bundle_tags
= yield :project_javascripts
- unless omit_og
-# Open Graph - http://ogp.me/
%meta{ property: 'og:type', content: "object" }
......@@ -78,16 +72,13 @@
%meta{ property: 'twitter:image', content: page_image }
= page_card_meta_tags
%meta{ name: "description", content: page_description }
%link{ rel: 'manifest', href: manifest_path(format: :json) }
%meta{ name: 'viewport', content: 'width=device-width, initial-scale=1, maximum-scale=1' }
%meta{ name: 'theme-color', content: user_theme_primary_color }
= csrf_meta_tags
= csp_meta_tag
= action_cable_meta_tag
%link{ rel: 'manifest', href: manifest_path(format: :json) }
= favicon_link_tag favicon, id: 'favicon', data: { original_href: favicon }, type: 'image/png'
-# Apple Safari/iOS home screen icons
= favicon_link_tag 'apple-touch-icon.png', rel: 'apple-touch-icon'
......@@ -100,3 +91,5 @@
= render 'layouts/matomo' if extra_config.has_key?('matomo_url') && extra_config.has_key?('matomo_site_id')
-# This is needed by [GitLab JH](https://gitlab.com/gitlab-jh/gitlab/-/issues/184)
= render_if_exists "layouts/frontend_monitor"
%meta{ name: "description", content: page_description }
%meta{ name: 'theme-color', content: user_theme_primary_color }
0% 加载中 .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册