You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
refactor: Decouple asset resolver from markdown source and implement ReferencedAsset tracking
Changes to asset resolution architecture:
- Modified IAssetResolver to accept markdown source per-call instead of storing it as state
- Updated RelativePathAssetResolver to be stateless, receiving context file in ResolveAsync()
- Enables shared resolver instance across multiple pages without coupling
Introduced ReferencedAsset record:
- Captures complete asset reference info: original path, rewritten path, and resolved file
- Facilitates materialization in consumer code (PagesCommand)
- Replaces IFile collection with structured ReferencedAsset collection
AssetAwareHtmlTemplatedMarkdownFile improvements:
- Tracks all referenced assets (both included and referenced) via ReferencedAsset
- Unified asset processing for markdown source and template file detection
- Extracted ProcessAssetLinkAsync() method for shared pipeline logic
Virtual structure simplification:
- Removed automatic asset yielding from AssetAwareHtmlTemplatedMarkdownPageFolder
- Removed template asset yielding from HtmlTemplatedMarkdownPageFolder base class
- Assets now tracked in ReferencedAsset collection for explicit consumer materialization
Implemented PagesCommand:
- CLI command for multi-page blog generation using AssetAwareHtmlTemplatedMarkdownPagesFolder
- Materializes virtual structure by iterating page folders and copying files
- Uses ReferencedAsset.RewrittenPath for correct asset output placement
Added comprehensive test coverage:
- AssetAwareHtmlTemplatedMarkdownPagesFolderTests with 7 test cases
- Covers markdown discovery, hierarchy preservation, asset resolution, and link rewriting
Minor cleanup:
- Removed debug logging from PostPageAssetFolder
- Fixed formatting/whitespace in PostPageFolder and HtmlTemplatedMarkdownPageFolder
- Changed return types to IChildFolder for Pages-related classes
0 commit comments