-
Notifications
You must be signed in to change notification settings - Fork 256
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
feat(scully): add contentType to contentFolderPlugin route data #320
feat(scully): add contentType to contentFolderPlugin route data #320
Conversation
@cmgriffing Can you elaborate your use case a bit? class MyComponent {
private music$ = this.srs.available$.pipe(
map(routes => routes.filter(route => route.route.startsWith('/music'))
);
private news$ = this.srs.available$.pipe(
map(routes => routes.filter(route => route.route.startsWith('/news'))
);
...
} Or is this missing your point? |
In that case, the root A separate thought is that it might be useful to override at some point via the frontmatter, but still have an "idiomatic" prop for that filtering. (this is not that well thought out yet :) ) I'm happy to withdraw this, it just seemed seemed like such a small change so I skipped the Issue process to have code to help explain the idea better. |
@cmgriffing Yes, that would be the preferred way of filtering. Also, you can already put whatever you want in the frontmatter stuff, and filter by that. That would even enable 'tag' sharing between different routes. |
I think some kind of value would be useful.
That |
this adds a way to differentiate between different contentfolders ISSUES CLOSED: #320
@cmgriffing I added the name option in #326, you can take a look there. |
this adds a way to differentiate between different contentfolders ISSUES CLOSED: #320
PR Checklist
Please check if your PR fulfills the following requirements:
PR Type
What kind of change does this PR introduce?
What is the current behavior?
contentType must be inferred from route in the route data when iterating routes in a page. Example:
news
andmedia
(screenshots, videos, etc) types may both exist. On the news index page we would want to filter for onlynews
posts.Issue Number: N/A
What is the new behavior?
The new behavior adds a
contentType
field to the route data. This is extracted from theroute.slug.folder
.Is there a better place to extract this value?
Is there a more preferred name for the property instead of
contentType
?Does this PR introduce a breaking change?
Other information