Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

(MAINT) Initial publishing of FrontMatter configs #44

Conversation

michaeltlombardi
Copy link
Contributor

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 or merge key in an item but not both. Items with the definition key publish a single config and have the option to specify the site-relative publish path with the publish key. Items with the merge key merge the values from multiple configs to publish as a merged blob to the site-relative path defined by the mandatory publish 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.

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.

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` or `merge` key in an item
  but not both. Items with the `definition` key publish a single config
  and have the option to specify the site-relative publish path with the
  `publish` key. Items with the `merge` key merge the values from
  multiple configs to publish as a merged blob to the site-relative path
  defined by the mandatory `publish` 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.
@netlify
Copy link

netlify bot commented Jan 13, 2023

Deploy Preview for platen ready!

Name Link
🔨 Latest commit 31fcbd7
🔍 Latest deploy log https://app.netlify.com/sites/platen/deploys/63c53d7b3614b60009fae017
😎 Deploy Preview https://deploy-preview-44--platen.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site settings.

This change takes advantage of the improvements to the memo module to
publish an initial group of configs for FrontMatter users.

This initial pass doesn't do any further work with the documentation, it
just makes the composed configurations available for testing.

This is in support of estruyf/vscode-front-matter#407, which adds
the `frontMatter.extends` key.
@michaeltlombardi michaeltlombardi force-pushed the maint/main/publish-front-matter-configs branch from 31fcbd7 to d827e71 Compare January 16, 2023 12:05
@michaeltlombardi michaeltlombardi merged commit 3867fcc into platenio:main Jan 16, 2023
@michaeltlombardi michaeltlombardi deleted the maint/main/publish-front-matter-configs branch January 16, 2023 12:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant