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
site-specific components in component lists #510
Conversation
function availableOnCurrentSite(slug, logic) { | ||
var tokens = logic.split(',').map((str) => str.trim()), // trim any extra whitespace | ||
// list of site slugs to include | ||
include = _.reject(tokens, (token) => _.includes(token, 'not:')), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
could you call these "sitesToInclude" "sitesToExclude"? Self-documenting variable names!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fiiiiiiiine
👍 with some minor comments about comments |
- article (site1, site2) # allow on site1 and site2 ONLY | ||
- paragraph # allow on all sites | ||
- image (not:site1) # allow on all sites EXCEPT site1 | ||
- link (site1, site2, site3, not:site2, not:site3) # only allow on site1 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm, do site-specific options belong in the schema? Seems like schema should be only tied to the component and generic to any site.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
as a less-used +1, I think this is fine, especially since it's only for implementation-specific components (adding specific sites to a list in a component on npm would be dumb)
👍 from byron |
Thanks for the improvements @yoshokatana 👍 |
WHOAH |
WHOAH WHOAH WOOOOOOOAH |
@byronhulcher @cruzanmo should we revert this? |
fixes #492
allows you to specify that certain components in lists should be included/excluded only on certain sites