Fix 'featured' flag to ignore items on the homepage
This commit is contained in:
@@ -45,6 +45,9 @@ Following front-matter attributes are possible:
|
||||
* **ring**: Ring section in radar. One of `trial`, `assess`, `adopt`, `hold`
|
||||
* **info**: (optional) A short textual description of the item (visible in
|
||||
overview pages)
|
||||
* **featured**: (optional, default "true") If you set this to `false`, the item
|
||||
will not be visibile on the homepage anymore but still available in the radar
|
||||
overview.
|
||||
|
||||
The name of the .md file acts as item identifier and may overwrite items with
|
||||
the same name from older releases.
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
export const featuredOnly = items => items.filter(item => item.isFeatured);
|
||||
export const featuredOnly = items => items.filter(item => item.featured);
|
||||
|
||||
export const groupByQuadrants = items =>
|
||||
items.reduce(
|
||||
|
||||
@@ -113,10 +113,17 @@ const createItems = revisions => {
|
||||
return Object.values(itemMap).sort((x, y) => (x.name > y.name ? 1 : -1));
|
||||
};
|
||||
|
||||
const ignoreEmptyRevisionBody = (revision, item) => {
|
||||
if (!revision.body || revision.body.trim() === '') {
|
||||
return item.body;
|
||||
}
|
||||
return revision.body;
|
||||
};
|
||||
|
||||
const addRevisionToItem = (
|
||||
item = {
|
||||
flag: 'default',
|
||||
isFeatured: true,
|
||||
featured: true,
|
||||
revisions: [],
|
||||
},
|
||||
revision,
|
||||
@@ -125,6 +132,7 @@ const addRevisionToItem = (
|
||||
let newItem = {
|
||||
...item,
|
||||
...rest,
|
||||
body: ignoreEmptyRevisionBody(rest, item),
|
||||
attributes: {
|
||||
...item.attributes,
|
||||
...revision.attributes,
|
||||
|
||||
3
radar/2017-10-01/typo3-as-a-framework.md
Normal file
3
radar/2017-10-01/typo3-as-a-framework.md
Normal file
@@ -0,0 +1,3 @@
|
||||
---
|
||||
featured: false
|
||||
---
|
||||
Reference in New Issue
Block a user