Skip to content

Commit

Permalink
Added host to the Open Graph images in order for Facebook to catch th…
Browse files Browse the repository at this point in the history
…em (#135)
  • Loading branch information
ivaylokenov committed Aug 14, 2015
1 parent b6ba89c commit 0dc76a8
Show file tree
Hide file tree
Showing 6 changed files with 25 additions and 11 deletions.
4 changes: 2 additions & 2 deletions Source/Client/Showcase.Client.App/Scripts/_references.js
Expand Up @@ -150,6 +150,6 @@
/// <reference path="../app/not-found-page/not-found-controller.js" />
/// <reference path="../app/project-details-page/project-tags-directive.js" />
/// <reference path="../app/user-profile-page/user-profile-collaborators-directive.js" />
/// <reference path="../app/build/vendorjs2015081446.min.js" />
/// <reference path="../app/build/alljs2015081430.min.js" />
/// <reference path="../app/build/vendorjs2015081417.min.js" />
/// <reference path="../app/build/alljs2015081417.min.js" />

6 changes: 3 additions & 3 deletions Source/Client/Showcase.Client.App/Showcase.Client.App.csproj
Expand Up @@ -127,9 +127,9 @@
<Content Include="app\add-project-page\add-project-controller.js" />
<Content Include="app\add-project-page\add-project-data.js" />
<Content Include="app\add-project-page\add-project-view.html" />
<Content Include="app\build\allcss2015081430.min.css" />
<Content Include="app\build\alljs2015081430.min.js" />
<Content Include="app\build\vendorjs2015081446.min.js" />
<Content Include="app\build\allcss2015081417.min.css" />
<Content Include="app\build\alljs2015081417.min.js" />
<Content Include="app\build\vendorjs2015081417.min.js" />
<Content Include="app\common\comments-data.js" />
<Content Include="app\add-project-page\file-upload-directive.js" />
<Content Include="app\add-project-page\token-input-directive.js" />
Expand Down
6 changes: 5 additions & 1 deletion Source/Client/Showcase.Client.App/crawlers.cshtml
Expand Up @@ -13,7 +13,11 @@

<meta name="title" content="@Model.Title" />
<meta name="description" content="@Model.Description" />
<meta property="og:image" content="/Images/@(Model.MainImageUrl)_high.jpg" />
<meta property="og:title" content="@Model.Title" />
<meta property="og:description" content="@Model.Description" />
<meta property="og:type" content="website" />
<meta property="og:site_name" content="Telerik Academy Showcase System" />
<meta property="og:image:url" content="http://@Model.HostUrl/Images/@(Model.MainImageUrl)_high.jpg" />
<meta property="og:image:type" content="image/jpeg" />
</head>
<body>
Expand Down
16 changes: 11 additions & 5 deletions Source/Client/Showcase.Client.App/index-template.html
Expand Up @@ -10,10 +10,16 @@
<meta name="keywords" content="Telerik Academy Showcase System" />
<meta name="Author" content="Telerik Academy" />

<meta name="title" content="Telerik Showcase System" />
<meta name="description" content="Showcase system for students\' projects in Telerik Academy" />
<meta property="og:image" content="/content/images/telerik-logo.png" />
<meta name="title" content="Telerik Academy Showcase System" />
<meta name="description" content="Showcase system for students' projects in Telerik Academy" />
<meta property="og:title" content="Telerik Academy Showcase System" />
<meta property="og:description" content="Showcase system for students' projects in Telerik Academy" />
<meta property="og:type" content="website" />
<meta property="og:site_name" content="Telerik Academy Showcase System" />
<meta property="og:image:url" content="http://best.telerikacademy.com/content/images/telerik-logo.png" />
<meta property="og:image:type" content="image/png" />
<meta property="og:image:width" content="371" />
<meta property="og:image:height" content="373" />

<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width, maximum-scale=1, initial-scale=1, user-scalable=0" />
Expand All @@ -34,8 +40,8 @@
<script src="/scripts/epona/plugins/respond.js"></script>
<![endif]-->
</head>
<body class="smoothscroll">
<div id="wrapper" ng-app="showcaseSystem" ng-cloak ng-controller="MainController as vm">
<body class="smoothscroll" ng-app="showcaseSystem" ng-cloak ng-controller="MainController as vm">
<div id="wrapper">
<div id="header" showcase-header animate="fadeIn"></div>

<div id="content" ng-view></div>
Expand Down
Expand Up @@ -28,6 +28,8 @@ public async Task<IHttpActionResult> Get(int id)
.To<ProjectCrawlerResponseModel>()
.FirstOrDefaultAsync();

model.HostUrl = this.Request.RequestUri.Authority;

return this.Ok(model);
}
}
Expand Down
Expand Up @@ -11,6 +11,8 @@ public class ProjectCrawlerResponseModel : IMapFrom<Project>, IHaveCustomMapping

public string Description { get; set; }

public string HostUrl { get; set; }

public string MainImageUrl { get; set; }

public void CreateMappings(IConfiguration configuration)
Expand Down

0 comments on commit 0dc76a8

Please sign in to comment.