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
I’m looking at the configuration variable MICROPUB_OPTION_DERIVE_CATEGORY, and have two questions:
Is it possible with this config variable to state that I don’t want to add a category? In my particular instance, I have front matter defaults set up, which makes setting a category on individual posts unnecessary (and harder to change in the future).
What are the conditions I should be testing for? The example provided ([{"value":"category-name","condition":"bookmark OR name"}]) doesn't make this very clear. What is bookmark and name?
Thanks!
The text was updated successfully, but these errors were encountered:
Yes, you simply set the "value" to something falsy, like null or false
The condition is matched against the properties of the document, the one that is then formatted into YAML Front Matter and the document content. I've updated the README with some better description generally, but it would be good to have an example of the condition you would want to set up – that way I can help as well as document it as an example for others to be inspired by + also extend the fulfills library if it turns out that it for some reason isn't capable of matching against that kind of condition currently
Was a bit confused by what you meant, but ended up using [{"value":null,"condition":"category"}], and that seems to work!
I’m still totally confused, sorry! I’m not sure what you mean by conditions? So, in the example provided, do name and bookmark relate to properties in the YAML frontmatter, as sent by the micropub client? So, if they are set, then the value of "value" will be returned as a category?
What I will say is, that I tried the following config: [{"value":null,"condition":"category"},{"value":null,"condition":"layout"},{"value":null,"condition":"title"}] and half expected that to work, but it didn't. But perhaps that’s not the intended use of this value — setting front matter values — as these have nothing to do with categories.
I’m looking at the configuration variable
MICROPUB_OPTION_DERIVE_CATEGORY
, and have two questions:Is it possible with this config variable to state that I don’t want to add a category? In my particular instance, I have front matter defaults set up, which makes setting a category on individual posts unnecessary (and harder to change in the future).
What are the conditions I should be testing for? The example provided (
[{"value":"category-name","condition":"bookmark OR name"}]
) doesn't make this very clear. What isbookmark
andname
?Thanks!
The text was updated successfully, but these errors were encountered: