Skip to content

Commit

Permalink
Merge pull request #363 from fbranicky/fix-362
Browse files Browse the repository at this point in the history
fix-362 using content attribute for twitter:card meta tag
  • Loading branch information
Shazwazza authored Apr 15, 2021
2 parents 493364e + a64d6b9 commit 70fe5c4
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/Articulate/HtmlHelperExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,12 @@ public static class HtmlHelperExtensions
/// <summary>
/// Renders the Post date with Author details if author details are supplied
/// </summary>
/// <param name="html"></param>
/// <param name="html"></param>
/// <param name="model"></param>
/// <returns></returns>
public static IHtmlString AuthorCitation(this HtmlHelper html, PostModel model)
{
var sb = new StringBuilder();
var sb = new StringBuilder();
if (model.Author != null)
{
sb.Append("<span>");
Expand All @@ -53,7 +53,7 @@ public static IHtmlString AuthorCitation(this HtmlHelper html, PostModel model)
/// </summary>
/// <param name="html"></param>
/// <param name="model"></param>
/// <returns></returns>
/// <returns></returns>
public static IHtmlString SocialMetaTags(this HtmlHelper html, IMasterModel model)
{
var builder = new StringBuilder();
Expand Down Expand Up @@ -110,7 +110,7 @@ private static void SocialMetaTags(IPublishedContent model, StringBuilder builde
{
var twitterTag = new TagBuilder("meta");
twitterTag.Attributes["name"] = "twitter:card";
twitterTag.Attributes["value"] = "summary";
twitterTag.Attributes["content"] = "summary";
builder.AppendLine(twitterTag.ToString(TagRenderMode.StartTag)); //non-closing since that's just the way it is

var openGraphTitle = new TagBuilder("meta");
Expand All @@ -126,7 +126,7 @@ private static void SocialMetaTags(IPublishedContent model, StringBuilder builde
var openGraphUrl = new TagBuilder("meta");
openGraphUrl.Attributes["property"] = "og:url";
openGraphUrl.Attributes["content"] = model.Url(mode: UrlMode.Absolute);
builder.AppendLine(openGraphUrl.ToString(TagRenderMode.SelfClosing));
builder.AppendLine(openGraphUrl.ToString(TagRenderMode.SelfClosing));
}

public static IHtmlString RenderOpenSearch(this HtmlHelper html, IMasterModel model)
Expand Down Expand Up @@ -301,7 +301,7 @@ public static HelperResult TagCloud(this HtmlHelper html, PostTagCollection mode
ul.InnerHtml += li.ToString();
}
writer.Write(ul.ToString());
writer.Write(ul.ToString());
});
}

Expand Down

0 comments on commit 70fe5c4

Please sign in to comment.