(MAINT) Initial publishing of FrontMatter configs #44
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.
This change extends the functionality of memo for documenting a hugo theme to enable a theme author to publish [FrontMatter][01] config files, which users can then reference in their own projects instead of having to find and copy all the values.
This change is in support of estruyf/vscode-front-matter#407, which adds the
frontMatter.extends
key.In this basic implementation:
An author can define
memo.front_matter.configs
in their site params or on a particular page to publish one or more configurations.The implementation requires that the configurations be defined as assets. The implementation allows you to specify the config path as a remote asset, a site asset, or a page asset and resolves the config path to the appropriate asset.
Authors can define either the
definition
ormerge
key in an item but not both. Items with thedefinition
key publish a single config and have the option to specify the site-relative publish path with thepublish
key. Items with themerge
key merge the values from multiple configs to publish as a merged blob to the site-relative path defined by the mandatorypublish
key.Memo has been updated to take advantage of the merge-from-data feature in Platen to allow setting the site parameters in a data file.
The new configuration options are validated before use, warning and discarding invalid values.