public override string RenderOGPMeta(IOGPSiteMeta siteMeta, IOGPPageData ogpPageData) { ogpPageData = GetPageMetaMerger().MergeMetaData( ogpPageData,siteMeta); var metas = new MetaDictionary("og:"); metas.Add("type","article"); metas.Add("site_name",siteMeta.SiteName); AppendTitleImageUrl(metas,ogpPageData); AppendOptionalMeta(metas,ogpPageData); return metas.ToMetaTagString(); }
public override string RenderOGPMeta(IOGPSiteMeta siteMeta, IOGPPageData ogpPageData) { ogpPageData = GetPageMetaMerger().MergeMetaData(ogpPageData, siteMeta); var metas = new MetaDictionary("twitter:"); metas.Add("card","summary"); if (siteMeta is ITwitterCardSiteMeta) { var twitterSiteMeta = (ITwitterCardSiteMeta)siteMeta; metas.Add("site",twitterSiteMeta.Site); } AppendTitleImageUrl(metas,ogpPageData); metas.Add("description", ogpPageData.Description); return metas.ToMetaTagString(); }
protected void AppendTitleImageUrl(MetaDictionary dic, IOGPPageData page) { dic.Add("title",page.Title); dic.Add("image",page.Image); dic.Add("url",page.Url); }
protected void AppendOptionalMeta(MetaDictionary dic, IOGPPageData page) { dic.Add("description",page.Description); dic.Add("locale",page.Locale); }