Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
D
diaspora
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
Requirements
Requirements
List
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Operations
Operations
Environments
Packages & Registries
Packages & Registries
Package Registry
Container Registry
Analytics
Analytics
CI / CD
Code Review
Insights
Issue
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
diasporg
diaspora
Commits
5118985a
Commit
5118985a
authored
May 03, 2012
by
danielgrippi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
include default image for FB for timeline
parent
35b0f763
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
1 deletion
+13
-1
app/helpers/open_graph_helper.rb
app/helpers/open_graph_helper.rb
+13
-1
No files found.
app/helpers/open_graph_helper.rb
View file @
5118985a
...
...
@@ -12,7 +12,8 @@ module OpenGraphHelper
end
def
og_image
(
post
)
tags
=
post
.
photos
.
map
{
|
x
|
meta_tag_with_property
(
'og:image'
,
x
.
url
(
:thumb_large
))}
||
[]
tags
=
post
.
photos
.
map
{
|
x
|
meta_tag_with_property
(
'og:image'
,
x
.
url
(
:thumb_large
))}
tags
<<
meta_tag_with_property
(
'og:image'
,
default_image_url
)
if
tags
.
empty?
tags
.
join
(
' '
)
end
...
...
@@ -38,4 +39,15 @@ module OpenGraphHelper
def
meta_tag_with_property
(
name
,
content
)
content_tag
(
:meta
,
''
,
:property
=>
name
,
:content
=>
content
)
end
private
# This method compensates for hosting assets off of s3
def
default_image_url
if
image_path
(
'asterisk.png'
).
include?
(
"http"
)
image_path
(
'asterisk.png'
)
else
"
#{
root_url
.
chop
}#{
image_path
(
'asterisk.png'
)
}
"
end
end
end
\ No newline at end of file
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