Exemplo n.º 1
0
        public override void Process(
            TagHelperContext context,
            TagHelperOutput output)
        {
            var value = TagValueUtility.GetContent(
                Value,
                SeoHelper.LinkCanonical);

            var linkCanonical =
                AbsoluteUrlUtility.Resolve(
                    _urlHelper,
                    value,
                    SeoHelper.SiteUrl);

            if (string.IsNullOrWhiteSpace(linkCanonical))
            {
                output.SuppressOutput();
                return;
            }

            output.TagName = "link";
            output.TagMode = TagMode.SelfClosing;

            output.Attributes.Clear();

            output.Attributes.SetAttribute("rel", "canonical");
            output.Attributes.SetAttribute("href", linkCanonical);
        }
Exemplo n.º 2
0
        public override void Process(
            TagHelperContext context,
            TagHelperOutput output)
        {
            var content = TagValueUtility.GetContent(
                Value,
                SeoHelper.OgImage);

            output.ProcessOpenGraph(OgMetaName.Image, content);
        }
Exemplo n.º 3
0
        public override void Process(
            TagHelperContext context,
            TagHelperOutput output)
        {
            var content = TagValueUtility.GetContent(
                Value,
                SeoHelper.MetaKeywords);

            output.ProcessMeta(MetaName.Keywords, content);
        }
Exemplo n.º 4
0
        public override void Process(
            TagHelperContext context,
            TagHelperOutput output)
        {
            var content = TagValueUtility.GetContent(
                Value,
                SeoHelper.MetaDescription);

            output.ProcessMeta(MetaName.Description, content);
        }
Exemplo n.º 5
0
        public override void Process(
            TagHelperContext context,
            TagHelperOutput output)
        {
            if (Follow != null || Index != null)
            {
                SeoHelper.SetMetaRobots(Index ?? true, Follow ?? true);
            }

            var content = TagValueUtility.GetContent(
                Value,
                SeoHelper.MetaRobots);

            output.ProcessMeta(MetaName.Robots, content);
        }
Exemplo n.º 6
0
        public override void Process(
            TagHelperContext context,
            TagHelperOutput output)
        {
            var value = TagValueUtility.GetContent(
                Value,
                SeoHelper.OgUrl,
                SeoHelper.LinkCanonical);

            var linkCanonical =
                AbsoluteUrlUtility.Resolve(
                    _urlHelper,
                    value,
                    SeoHelper.SiteUrl);

            output.ProcessOpenGraph(OgMetaName.Url, linkCanonical);
        }