Do you want to work on this issue?
You can request for a bounty in order to promote it!
Provide tags and categories by default? #577
sustained posted onGitHub
<!-- Please don't delete this template or we'll close your issue -->
<!-- Before creating an issue please make sure you are using the latest version of Saber. -->
Feature request
<!-- Please ask questions via following several ways. -->
<!-- https://chat.saber.land/ -->
<!-- https://stackoverflow.com/questions/ask?tags=saberjs -->
What problem does this feature solve?
Right now we have to do something like this in our blog template:
export default {
computed: {
tags() {
return Array.from(
new Set(
this.page.posts.reduce((tags, page) => {
tags.push(...(page.tags || []))
return tags
}, [])
)
)
},
categories() {
return Array.from(
new Set(
this.page.posts.reduce((cats, page) => {
cats.push(...(page.categories || []))
return cats
}, [])
)
)
}, },
}
It's not much work but don't you think it amounts to needless boilerplate, when instead the plugin could just provide a list of all tags and categories by default?
What does the proposed API look like?
See below.
How should this be implemented in your opinion?
Both this.tags
and this.categories
would be available when injectAllPosts
is true
.
Alternatively, new options could be added: injectAllTags
, injectAllCategories
.
Are you willing to work on this yourself?
Yes.