Skip to content

Commit

Permalink
Add ViewBase field to hide opensearch.xml link (#6304)
Browse files Browse the repository at this point in the history
  • Loading branch information
Scott Bommarito authored Aug 13, 2018
1 parent 9b00ef8 commit a9379ee
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
2 changes: 2 additions & 0 deletions src/NuGetGallery/Views/NuGetViewBase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,8 @@ public CookieConsentMessage CookieConsentMessage

public bool ShowAuthInHeader => true;

public bool LinkOpenSearchXml => true;

protected NuGetViewBase()
{
_nugetContext = new Lazy<NuGetContext>(NuGetViewBase.GetNuGetContextThunk(this));
Expand Down
7 changes: 5 additions & 2 deletions src/NuGetGallery/Views/Shared/Gallery/Layout.cshtml
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,16 @@
@RenderSection("SocialMeta", required: false)
@RenderSection("Meta", required: false)

<title>
<title>
@(Config.Current.Brand)
@(String.IsNullOrWhiteSpace(ViewBag.Title) ? "" : "| " + ViewBag.Title)
</title>

<link href="@Url.Content("~/favicon.ico")" rel="shortcut icon" type="image/x-icon" />
<link title="NuGet.org" type="application/opensearchdescription+xml" href="@Url.Content("~/opensearch.xml")" rel="search">
@if (LinkOpenSearchXml)
{
<link title="NuGet.org" type="application/opensearchdescription+xml" href="@Url.Content("~/opensearch.xml")" rel="search">
}

@Styles.Render("~/Content/gallery/css/site.min.css")

Expand Down

0 comments on commit a9379ee

Please sign in to comment.