Skip to content

Commit 2a7c2ce

Browse files
committed
Add Open Graph metadata for the front page (#6708)
Address #6678
1 parent e9759a9 commit 2a7c2ce

3 files changed

Lines changed: 56 additions & 1 deletion

File tree

10.9 KB
Loading

src/NuGetGallery/NuGetGallery.csproj

Lines changed: 46 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1290,6 +1290,7 @@
12901290
<Content Include="Areas\Admin\DynamicData\PageTemplates\ListDetails.aspx" />
12911291
<Content Include="Content\admin\SupportRequestStyles.css" />
12921292
<Content Include="Content\fabric.css" />
1293+
<Content Include="Content\gallery\img\logo-og-600x600.png" />
12931294
<Content Include="Content\Images\icons\apiKey.png" />
12941295
<Content Include="Content\Images\icons\apiKeyExpired.png" />
12951296
<Content Include="Content\Images\icons\apiKeyLegacy.png" />
@@ -1299,7 +1300,51 @@
12991300
<Content Include="Content\Images\icons\edit.png" />
13001301
<Content Include="Content\Images\icons\expire.png" />
13011302
<Content Include="Content\Images\icons\regenerate.png" />
1302-
<Content Include="Content\gallery\**\*" />
1303+
<Content Include="Content\gallery\css\bootstrap-theme.css" />
1304+
<Content Include="Content\gallery\css\bootstrap.css" />
1305+
<Content Include="Content\gallery\css\fabric.css" />
1306+
<Content Include="Content\gallery\img\api-key-256x256.png" />
1307+
<Content Include="Content\gallery\img\api-key-expired-256x256.png" />
1308+
<Content Include="Content\gallery\img\api-key-expired.svg" />
1309+
<Content Include="Content\gallery\img\api-key-legacy-256x256.png" />
1310+
<Content Include="Content\gallery\img\api-key-legacy.svg" />
1311+
<Content Include="Content\gallery\img\api-key-new-256x256.png" />
1312+
<Content Include="Content\gallery\img\api-key-new.svg" />
1313+
<Content Include="Content\gallery\img\api-key.svg" />
1314+
<Content Include="Content\gallery\img\blue-circle-225x225.png" />
1315+
<Content Include="Content\gallery\img\blue-circle.svg" />
1316+
<Content Include="Content\gallery\img\circuit-board.svg" />
1317+
<Content Include="Content\gallery\img\default-package-icon-256x256.png" />
1318+
<Content Include="Content\gallery\img\default-package-icon.svg" />
1319+
<Content Include="Content\gallery\img\dotnet-foundation-42x42.png" />
1320+
<Content Include="Content\gallery\img\dotnet-foundation.svg" />
1321+
<Content Include="Content\gallery\img\facebook-24x24.png" />
1322+
<Content Include="Content\gallery\img\facebook.svg" />
1323+
<Content Include="Content\gallery\img\git-32x32.png" />
1324+
<Content Include="Content\gallery\img\git.svg" />
1325+
<Content Include="Content\gallery\img\github-32x32.png" />
1326+
<Content Include="Content\gallery\img\github.svg" />
1327+
<Content Include="Content\gallery\img\logo-footer-184x57.png" />
1328+
<Content Include="Content\gallery\img\logo-footer.svg" />
1329+
<Content Include="Content\gallery\img\logo-header-94x29.png" />
1330+
<Content Include="Content\gallery\img\logo-header.svg" />
1331+
<Content Include="Content\gallery\img\manage-organizations-260x150.png" />
1332+
<Content Include="Content\gallery\img\manage-organizations.svg" />
1333+
<Content Include="Content\gallery\img\microsoft-account-24x24.png" />
1334+
<Content Include="Content\gallery\img\microsoft-account.svg" />
1335+
<Content Include="Content\gallery\img\orange-circle-225x225.png" />
1336+
<Content Include="Content\gallery\img\orange-circle.svg" />
1337+
<Content Include="Content\gallery\img\purple-circle-225x225.png" />
1338+
<Content Include="Content\gallery\img\purple-circle.svg" />
1339+
<Content Include="Content\gallery\img\reserved-indicator-20x20.png" />
1340+
<Content Include="Content\gallery\img\reserved-indicator-256x256.png" />
1341+
<Content Include="Content\gallery\img\reserved-indicator-25x25.png" />
1342+
<Content Include="Content\gallery\img\reserved-indicator.svg" />
1343+
<Content Include="Content\gallery\img\rss-36x36.png" />
1344+
<Content Include="Content\gallery\img\rss.svg" />
1345+
<Content Include="Content\gallery\img\twitter-24x24.png" />
1346+
<Content Include="Content\gallery\img\twitter-36x36.png" />
1347+
<Content Include="Content\gallery\img\twitter.svg" />
13031348
<Content Include="Content\themes\base\images\animated-overlay.gif" />
13041349
<Content Include="Content\themes\base\images\ui-bg_flat_0_aaaaaa_40x100.png" />
13051350
<Content Include="Content\themes\base\images\ui-bg_flat_75_ffffff_40x100.png" />

src/NuGetGallery/Views/Pages/Home.cshtml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,16 @@
66
ViewBag.HasJumbotron = true;
77
}
88

9+
@section SocialMeta {
10+
<meta name="twitter:card" content="summary">
11+
<meta name="twitter:site" content="@("@nuget")">
12+
13+
<meta property="og:title" content="@(Config.Current.Brand) @(String.IsNullOrWhiteSpace(ViewBag.Title) ? "" : "| " + ViewBag.Title)" />
14+
<meta property="og:url" content="@(Url.Home(relativeUrl: false))" />
15+
<meta property="og:description" content="The NuGet Gallery is the central package repository for NuGet, the package manager for .NET." />
16+
<meta property="og:image" content="@(Url.Absolute("~/Content/gallery/img/logo-og-600x600.png"))" />
17+
}
18+
919
@if (Model.ShowTransformModal)
1020
{
1121
<script type="text/javascript">

0 commit comments

Comments
 (0)