public string UrlFor(object model, string categoryOrHttpMethod = null) { var url = _inner.UrlFor(model, categoryOrHttpMethod); _cache.Enqueue(url); return(_currentRequest.ToRelativeUrl(_directories, url)); }
public string UrlForAsset(AssetFolder folder, string name) { var url = _inner.UrlForAsset(folder, name); _cache.Enqueue(url); return(_request.ToRelativeUrl(_directories, url)); }
private void fixUrl(HtmlTag tag, string attrName) { var rawUrl = tag.Attr(attrName); _cache.Enqueue(rawUrl); var relativeUrl = _request.ToRelativeUrl(_directories, rawUrl); tag.Attr(attrName, relativeUrl); }
public TopicLinkTag(ICurrentHttpRequest currentRequest, FubuDocsDirectories directories, Topic topic, string title) : base("a") { Attr("href", currentRequest.ToRelativeUrl(directories, topic.AbsoluteUrl)); if (title.IsEmpty()) { title = topic.Title; } Text(title); Attr("data-key", topic.Name); }
public static string ToRelativeUrl(this ICurrentHttpRequest request, FubuDocsDirectories directories, string url) { var relativeUrl = directories.RootUrls ? url : request.ToRelativeUrl(url); if (directories.UseIndexHtml && !Path.HasExtension(relativeUrl)) { relativeUrl = relativeUrl.AppendUrl("index.html"); } return(relativeUrl); }
private void writeChildNodes(Topic node, HtmlTag tag, FubuDocsDirectories directories) { node.ChildNodes.Each(childTopic => { var li = tag.Add("li"); li.Add("a").Attr("href", _currentRequest.ToRelativeUrl(directories, childTopic.AbsoluteUrl)).Text(childTopic.Title); if (childTopic.ChildNodes.Any()) { var ul = li.Add("ul"); writeChildNodes(childTopic, ul, directories); } }); }
public TopRightTopicNavigationTag(Topic node, ICurrentHttpRequest request, FubuDocsDirectories directories) : base("ul") { _request = request; AddClass("nav"); Style("float", "right"); Topic previous = node.FindPrevious(); if (previous != null) { Add("li/a") .Attr("href", _request.ToRelativeUrl(directories, previous.AbsoluteUrl)) .Text("Previous") .Attr("title", previous.Title); } Topic next = node.FindNext(); if (next != null) { Add("li/a") .Attr("href", _request.ToRelativeUrl(directories, next.AbsoluteUrl)) .Text("Next") .Attr("title", next.Title); } //Topic index = node.FindIndex(); //if (index != null && !ReferenceEquals(node, index)) //{ // Add("li/a") // .Attr("href", index.AbsoluteUrl) // .Text("Index") // .Attr("title", index.Title); //} }
public NamedTopicLinkTag(Topic node, ICurrentHttpRequest currentRequest, FubuDocsDirectories directories) : base("li") { Add("a").Attr("href", currentRequest.ToRelativeUrl(directories, node.AbsoluteUrl)).Attr("data-key", node.Name).Text(node.Title + " »"); }