>" %>
+<%@ Import Namespace="Orchard.Blogs.Extensions"%>
+<%@ Import Namespace="Orchard.UI.Resources"%>
<%@ Import Namespace="Orchard.Mvc.ViewModels"%>
<%@ Import Namespace="Orchard.Blogs.Models"%>
+
+<% Html.RegisterLink(new LinkEntry { Rel = "wlwmanifest", Type = "application/wlwmanifest+xml", Href = Url.BlogLiveWriterManifest(Model.Item.Slug) });%>
<%=Html.TitleForPage(Model.Item.Name) %>
diff --git a/src/Orchard/Mvc/Html/LayoutExtensions.cs b/src/Orchard/Mvc/Html/LayoutExtensions.cs
index fb0fc8d01..b7b4bcc96 100644
--- a/src/Orchard/Mvc/Html/LayoutExtensions.cs
+++ b/src/Orchard/Mvc/Html/LayoutExtensions.cs
@@ -94,6 +94,10 @@ namespace Orchard.Mvc.Html {
html.Resolve().RegisterMeta(name, content);
}
+ public static void RegisterLink(this HtmlHelper html, LinkEntry entry) {
+ html.Resolve().RegisterLink(entry, html);
+ }
+
public static void RegisterStyle(this HtmlHelper html, string fileName) {
html.Resolve().RegisterStyle(fileName, html);
}
diff --git a/src/Orchard/Orchard.csproj b/src/Orchard/Orchard.csproj
index 595e0689e..068a14c45 100644
--- a/src/Orchard/Orchard.csproj
+++ b/src/Orchard/Orchard.csproj
@@ -300,6 +300,7 @@
+
diff --git a/src/Orchard/UI/Resources/IResourceManager.cs b/src/Orchard/UI/Resources/IResourceManager.cs
index 24d3b283b..e33434e10 100644
--- a/src/Orchard/UI/Resources/IResourceManager.cs
+++ b/src/Orchard/UI/Resources/IResourceManager.cs
@@ -1,14 +1,15 @@
using System.Web.Mvc;
-using System.Web.Routing;
namespace Orchard.UI.Resources {
public interface IResourceManager : IDependency {
void RegisterMeta(string name, string content);
void RegisterStyle(string fileName, HtmlHelper html);
+ void RegisterLink(LinkEntry entry, HtmlHelper html);
void RegisterHeadScript(string fileName, HtmlHelper html);
void RegisterFootScript(string fileName, HtmlHelper html);
MvcHtmlString GetMetas();
MvcHtmlString GetStyles();
+ MvcHtmlString GetLinks(HtmlHelper html);
MvcHtmlString GetHeadScripts();
MvcHtmlString GetFootScripts();
}
diff --git a/src/Orchard/UI/Resources/LinkEntry.cs b/src/Orchard/UI/Resources/LinkEntry.cs
new file mode 100644
index 000000000..a538cdbe7
--- /dev/null
+++ b/src/Orchard/UI/Resources/LinkEntry.cs
@@ -0,0 +1,7 @@
+namespace Orchard.UI.Resources {
+ public class LinkEntry {
+ public string Rel { get; set; }
+ public string Type { get; set; }
+ public string Href { get; set; }
+ }
+}
diff --git a/src/Orchard/UI/Resources/ResourceFilter.cs b/src/Orchard/UI/Resources/ResourceFilter.cs
index 1e1429568..b9cffb532 100644
--- a/src/Orchard/UI/Resources/ResourceFilter.cs
+++ b/src/Orchard/UI/Resources/ResourceFilter.cs
@@ -20,6 +20,7 @@ namespace Orchard.UI.Resources {
model.Zones.AddAction("head:metas", html => html.ViewContext.Writer.Write(_resourceManager.GetMetas()));
model.Zones.AddAction("head:styles", html => html.ViewContext.Writer.Write(_resourceManager.GetStyles()));
+ model.Zones.AddAction("head:links", html => html.ViewContext.Writer.Write(_resourceManager.GetLinks(html)));
model.Zones.AddAction("head:scripts", html => html.ViewContext.Writer.Write(_resourceManager.GetHeadScripts()));
model.Zones.AddAction("body:after", html => {
html.ViewContext.Writer.Write(_resourceManager.GetFootScripts());
diff --git a/src/Orchard/UI/Resources/ResourceManager.cs b/src/Orchard/UI/Resources/ResourceManager.cs
index e4530aac9..2a2461212 100644
--- a/src/Orchard/UI/Resources/ResourceManager.cs
+++ b/src/Orchard/UI/Resources/ResourceManager.cs
@@ -1,5 +1,6 @@
using System.Collections.Generic;
using System.Linq;
+using System.Text;
using System.Web.Mvc;
using JetBrains.Annotations;
using Orchard.Mvc.Html;
@@ -12,12 +13,14 @@ namespace Orchard.UI.Resources {
private const string ScriptFormat = "\r\n";
private readonly Dictionary _metas;
private readonly List _styles;
+ private readonly List _links;
private readonly List _headScripts;
private readonly List _footScripts;
public ResourceManager() {
_metas = new Dictionary(20) {{"generator", "Orchard"}};
_styles = new List(10);
+ _links = new List();
_headScripts = new List(10);
_footScripts = new List(5);
}
@@ -37,6 +40,10 @@ namespace Orchard.UI.Resources {
_styles.Add(context);
}
+ public void RegisterLink(LinkEntry entry, HtmlHelper html) {
+ _links.Add(entry);
+ }
+
public void RegisterHeadScript(string fileName, HtmlHelper html) {
if (string.IsNullOrEmpty(fileName))
return;
@@ -67,6 +74,40 @@ namespace Orchard.UI.Resources {
return GetFiles(_styles, StyleFormat, "/styles/");
}
+ public MvcHtmlString GetLinks(HtmlHelper html) {
+ var sb = new StringBuilder();
+ foreach (var link in _links) {
+ sb.Append("\r\n");
+ sb.Append(@"");
+ }
+
+ return MvcHtmlString.Create(sb.ToString());
+ }
+
public MvcHtmlString GetHeadScripts() {
return GetFiles(_headScripts, ScriptFormat, "/scripts/");
}