Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kazuhiko Shiozaki
gitlab-ce
Commits
bd21e3d7
Commit
bd21e3d7
authored
Dec 25, 2015
by
Douwe Maan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add Open Graph data for group, project and commit.
parent
7d5b51f3
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
14 additions
and
6 deletions
+14
-6
app/helpers/page_layout_helper.rb
app/helpers/page_layout_helper.rb
+2
-0
app/views/groups/show.html.haml
app/views/groups/show.html.haml
+2
-0
app/views/layouts/_head.html.haml
app/views/layouts/_head.html.haml
+5
-5
app/views/projects/commit/show.html.haml
app/views/projects/commit/show.html.haml
+3
-1
app/views/projects/show.html.haml
app/views/projects/show.html.haml
+2
-0
No files found.
app/helpers/page_layout_helper.rb
View file @
bd21e3d7
...
@@ -53,6 +53,8 @@ module PageLayoutHelper
...
@@ -53,6 +53,8 @@ module PageLayoutHelper
@project
.
avatar_url
||
default
@project
.
avatar_url
||
default
elsif
@user
elsif
@user
avatar_icon
(
@user
)
avatar_icon
(
@user
)
elsif
@group
@group
.
avatar_url
||
default
else
else
default
default
end
end
...
...
app/views/groups/show.html.haml
View file @
bd21e3d7
-
page_description
@group
.
description
-
unless
can?
(
current_user
,
:read_group
,
@group
)
-
unless
can?
(
current_user
,
:read_group
,
@group
)
-
@disable_search_panel
=
true
-
@disable_search_panel
=
true
...
...
app/views/layouts/_head.html.haml
View file @
bd21e3d7
-
site_name
=
"GitLab"
%head
{
prefix:
"og: http://ogp.me/ns#"
}
%head
{
prefix:
"og: http://ogp.me/ns#"
}
%meta
{
charset:
"utf-8"
}
%meta
{
charset:
"utf-8"
}
%meta
{
'http-equiv'
=>
'X-UA-Compatible'
,
content:
'IE=edge'
}
%meta
{
'http-equiv'
=>
'X-UA-Compatible'
,
content:
'IE=edge'
}
%meta
{
name:
'referrer'
,
content:
'origin-when-cross-origin'
}
%meta
{
name:
"description"
,
content:
page_description
}
-# Open Graph - http://ogp.me/
-# Open Graph - http://ogp.me/
%meta
{
property:
'og:type'
,
content:
"object"
}
%meta
{
property:
'og:type'
,
content:
"object"
}
%meta
{
property:
'og:site_name'
,
content:
"GitLab"
}
%meta
{
property:
'og:site_name'
,
content:
site_name
}
%meta
{
property:
'og:title'
,
content:
page_title
}
%meta
{
property:
'og:title'
,
content:
page_title
}
%meta
{
property:
'og:description'
,
content:
page_description
}
%meta
{
property:
'og:description'
,
content:
page_description
}
%meta
{
property:
'og:image'
,
content:
page_image
}
%meta
{
property:
'og:image'
,
content:
page_image
}
...
@@ -20,8 +18,9 @@
...
@@ -20,8 +18,9 @@
%meta
{
property:
'twitter:image'
,
content:
page_image
}
%meta
{
property:
'twitter:image'
,
content:
page_image
}
=
page_card_meta_tags
=
page_card_meta_tags
-
page_title
"GitLab"
-
page_title
site_name
%title
=
page_title
%title
=
page_title
%meta
{
name:
"description"
,
content:
page_description
}
=
favicon_link_tag
'favicon.ico'
=
favicon_link_tag
'favicon.ico'
...
@@ -34,6 +33,7 @@
...
@@ -34,6 +33,7 @@
=
include_gon
=
include_gon
%meta
{
name:
'referrer'
,
content:
'origin-when-cross-origin'
}
%meta
{
name:
'viewport'
,
content:
'width=device-width, initial-scale=1, maximum-scale=1'
}
%meta
{
name:
'viewport'
,
content:
'width=device-width, initial-scale=1, maximum-scale=1'
}
%meta
{
name:
'theme-color'
,
content:
'#474D57'
}
%meta
{
name:
'theme-color'
,
content:
'#474D57'
}
...
...
app/views/projects/commit/show.html.haml
View file @
bd21e3d7
-
page_title
"
#{
@commit
.
title
}
(
#{
@commit
.
short_id
}
)"
,
"Commits"
-
page_title
"
#{
@commit
.
title
}
(
#{
@commit
.
short_id
}
)"
,
"Commits"
-
page_description
@commit
.
description
=
render
"projects/commits/header_title"
=
render
"projects/commits/header_title"
=
render
"commit_box"
=
render
"commit_box"
-
if
@ci_commit
-
if
@ci_commit
...
...
app/views/projects/show.html.haml
View file @
bd21e3d7
-
page_description
@project
.
description
=
content_for
:meta_tags
do
=
content_for
:meta_tags
do
-
if
current_user
-
if
current_user
=
auto_discovery_link_tag
(
:atom
,
namespace_project_path
(
@project
.
namespace
,
@project
,
format: :atom
,
private_token:
current_user
.
private_token
),
title:
"
#{
@project
.
name
}
activity"
)
=
auto_discovery_link_tag
(
:atom
,
namespace_project_path
(
@project
.
namespace
,
@project
,
format: :atom
,
private_token:
current_user
.
private_token
),
title:
"
#{
@project
.
name
}
activity"
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment