Closed zivkan closed 2 years ago
Thanks for the report! This is probably Statiq Web since that's where the xref functionality is, and possibly related to some work that happened in there to support xrefs to API documents as part of Statiq Docs.
I'll move this and tag as a bug and take a look. Stay tuned.
Identified and fixed, rolling out a new release now.
This was caused by a change to expand the pipelines that we look at for locating xrefs. In and of itself, that change was good because it means you can reference documents from custom pipelines (this ability was introduced in Statiq Web 1.0.0-beta.45 which is where you noticed it breaking). The not-good part was that the routine to find referenced documents "flattened" the document hierarchy so that nested documents were also considered. Since the archive pipeline nests the documents-per-page, the blog posts were turning up in the xref matches for every archive page they appeared on. This behavior doesn't make sense anyway since a xref is presumably to a document that got output, and we only output top-level documents to disk. Changing the behavior not to flatten document trees resolved the issue.
I'm not sure if it's Statiq.Web, or Statiq.Framework that introduced the regression, but a project using Statiq.Web 1.0.0-beta.45 or 46, using the CleanBlog theme, will fail if you try to link any blog post to another blog post:
Putting a breakpoint here: https://github.com/statiqdev/Statiq.Web/blob/0a4e0ba8b318615674e2dea1fa5cf4dcc12a3887/src/Statiq.Web/IExecutionContextXrefExtensions.cs#L30-L35
The variable![image](https://user-images.githubusercontent.com/5030577/159176182-9b64e52f-50ed-4e00-8e17-1c968945ace0.png)
matches
has 3 documents, but all pointing to the same source:That's as far as I got with debugging.
If I change my project's PackageReference for Statiq.Web to 1.0.0-beta.44, then I no longer get the error.