コード例 #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);
        }
コード例 #2
0
        public override void Process(
            TagHelperContext context,
            TagHelperOutput output)
        {
            var content = TagValueUtility.GetContent(
                Value,
                SeoHelper.OgImage);

            output.ProcessOpenGraph(OgMetaName.Image, content);
        }
コード例 #3
0
        public override void Process(
            TagHelperContext context,
            TagHelperOutput output)
        {
            var content = TagValueUtility.GetContent(
                Value,
                SeoHelper.MetaKeywords);

            output.ProcessMeta(MetaName.Keywords, content);
        }
コード例 #4
0
        public override void Process(
            TagHelperContext context,
            TagHelperOutput output)
        {
            var content = TagValueUtility.GetContent(
                Value,
                SeoHelper.MetaDescription);

            output.ProcessMeta(MetaName.Description, content);
        }
コード例 #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);
        }
コード例 #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);
        }