-
Notifications
You must be signed in to change notification settings - Fork 2
NoIndex omitting all descendants from SitemapController #38
Copy link
Copy link
Closed
Labels
Area: WebRelates to the `AspNetCore` or other web-related functionality.Relates to the `AspNetCore` or other web-related functionality.Severity 2: MajorStatus 5: CompleteTask is considered complete, and ready for deployment.Task is considered complete, and ready for deployment.Type: BugBehavior that is inconsistent with documented or expected behavior.Behavior that is inconsistent with documented or expected behavior.
Milestone
Metadata
Metadata
Assignees
Labels
Area: WebRelates to the `AspNetCore` or other web-related functionality.Relates to the `AspNetCore` or other web-related functionality.Severity 2: MajorStatus 5: CompleteTask is considered complete, and ready for deployment.Task is considered complete, and ready for deployment.Type: BugBehavior that is inconsistent with documented or expected behavior.Behavior that is inconsistent with documented or expected behavior.
When the
NoIndexattribute is set, typical implementations exclude the page from indexing by adding anoindexmeta tag to the page header, as one would expect. For sites using theOnTopic.ViewModelslibrary, this is driven by thePageTopicViewModel.NoIndexproperty.Currently, however, the
SitemapControllernot only excludes topics marked withNoIndex, as one would expect—but additionally excludes all of their descendents. This potentially results entire segments of the topic tree being excluded from the sitemap.Since this isn’t applied in site templates (e.g., via
PageTopicViewModel), these downstream pages still get indexed, they’re just not represented in the sitemap. That’s confusing, and undermines the value of the sitemap as a comprehensive index of the site structure.Solution
At minimum, the
SitemapControllershould function the same as thePageTopicViewModel.NoIndexproperty. If there is a need to support a recursiveNoIndexattribute, then that should be added separately (e.g.,NoIndexRecursiveorNoIndexTree).