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

Option to not provide a category (and a question about the condition property) #20

Open
paulrobertlloyd opened this issue Jul 8, 2017 · 2 comments

Comments

@paulrobertlloyd
Copy link
Contributor

I’m looking at the configuration variable MICROPUB_OPTION_DERIVE_CATEGORY, and have two questions:

  1. 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).

  2. 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!

@voxpelli
Copy link
Owner

voxpelli commented Jul 9, 2017

  1. Yes, you simply set the "value" to something falsy, like null or false
  2. 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

@paulrobertlloyd
Copy link
Contributor Author

  1. Was a bit confused by what you meant, but ended up using [{"value":null,"condition":"category"}], and that seems to work!
  2. 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.

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

No branches or pull requests

2 participants