Refactor: Update asset handling to use Page Bundles #92
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Notes for Reviewers
This PR fixes #91
The goal is to change how asset URLs for banners and badges are handled in the theme. The previous method used the
/static
directory. This update moves the implementation to the Page Bundle model to create consistent behavior for all assets.Summary of Changes
The implementation includes the following changes:
Replaced Asset Logic
banner-url.html
partial has been deleted.resolve-local-resource.html
, has been added. It finds local asset paths within a Page Bundle and returns an absolute permalink.Updated Partials
banner-url.html
(learning-path.json.html
,common-curricula-properties.html
,badge.html
) have been refactored to use the new partials.badge.html
partial retains its original function to support both remote URLs and local file paths. The local path logic is now handled by the newresolve-local-resource.html
partial.Bug Fix
badge.html
where the PNG image path was incorrectly referencing the SVG variable. It now correctly references the PNG variable.Relevant docs PR for banner update: layer5io/docs#758 (merged)
Relevant schema PR for banner update: meshery/schemas#399
The changes are incompatible with the existing format. The original content needs to be modified before the relevant PRs can be merged.