Skip to content

NoIndex omitting all descendants from SitemapController #38

@JeremyCaney

Description

@JeremyCaney

When the NoIndex attribute is set, typical implementations exclude the page from indexing by adding a noindex meta tag to the page header, as one would expect. For sites using the OnTopic.ViewModels library, this is driven by the PageTopicViewModel.NoIndex property.

Currently, however, the SitemapController not only excludes topics marked with NoIndex, 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 SitemapController should function the same as the PageTopicViewModel.NoIndex property. If there is a need to support a recursive NoIndex attribute, then that should be added separately (e.g., NoIndexRecursive or NoIndexTree).

Metadata

Metadata

Assignees

Labels

Area: WebRelates to the `AspNetCore` or other web-related functionality.Severity 2: MajorStatus 5: CompleteTask is considered complete, and ready for deployment.Type: BugBehavior that is inconsistent with documented or expected behavior.

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions