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.
Adds support for the channels extension in Micropub requests. Fixes #773.
This can be used to dictate where a post gets published within a publication, and potentially allows for posts of the same type to be published to different locations.
Adds:
publication.channels
configuration option/micropub?q=config
includes achannels
property with configured channels/micropub?q=channel
returns configured channelsIf channels are configured:
publication.channels
mp-channel
value, it gets saved toproperties.channel
mp-channel
, the default channel UID is usedmp-channel
that don’t exist inpublication.channels
, they’ll get ignored. If no values match, the default channel UID is used{channel}
token is available to use in paths; if multiple channels are assigned to a post, these will get separated using the slug separator characterExample
In publication config:
Published to
/en/2024/11/channels
:Published to
/de/2024/11/kanale
:How should this value be used by presets?
Right now, if a publication has channels configured, the default (or chosen) channel(s) will get saved to
properties.channel
, so for example a post might look like this:I think channels are analogous to Eleventy collections, so potentially for that preset, the
channel
property should be used fortags
? But you might want to useproperties.category
for thetags
field instead. Not sure what is the right approach, but can figure that out in a separate PR.Might this value have equivalent representations in other platforms, too?
Should a default channel be enforced?
Right now, a default channel is enforced. That means, while you might only want to use the channel property for the output path, the
channel
property would still get added to frontmatter properties as well. Maybe that’s fine (though this’d make be twinge…)