Flatten folder structure for radar releases
This commit is contained in:
@@ -22,7 +22,7 @@ const initFilter = (element) => {
|
|||||||
},
|
},
|
||||||
isGroupVisible(letter) {
|
isGroupVisible(letter) {
|
||||||
const itemsInLetter = this.index[letter] || [];
|
const itemsInLetter = this.index[letter] || [];
|
||||||
const visibleItems = itemsInLetter.filter((item) => this.isRingVisible(item.attributes.ring));
|
const visibleItems = itemsInLetter.filter((item) => this.isRingVisible(item.ring));
|
||||||
return visibleItems.length > 0;
|
return visibleItems.length > 0;
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
---
|
---
|
||||||
title: "Bar"
|
title: "Bar"
|
||||||
ring: assess
|
ring: assess
|
||||||
|
quadrant: platforms-and-aoe-services
|
||||||
---
|
---
|
||||||
|
|
||||||
Bar
|
Bar
|
||||||
5
radar/2016-02-01/foo.md
Normal file
5
radar/2016-02-01/foo.md
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
---
|
||||||
|
quadrant: methods-and-patterns
|
||||||
|
---
|
||||||
|
|
||||||
|
Foo
|
||||||
@@ -1,6 +1,7 @@
|
|||||||
---
|
---
|
||||||
title: "Grunt"
|
title: "Grunt"
|
||||||
ring: adopt
|
ring: adopt
|
||||||
|
quadrant: tools
|
||||||
---
|
---
|
||||||
|
|
||||||
Hier steht was altes über *Grunt*
|
Hier steht was altes über *Grunt*
|
||||||
@@ -1,4 +0,0 @@
|
|||||||
---
|
|
||||||
---
|
|
||||||
|
|
||||||
Foo
|
|
||||||
@@ -1,6 +1,7 @@
|
|||||||
---
|
---
|
||||||
title: "React 123"
|
title: "React 123"
|
||||||
ring: adopt
|
ring: adopt
|
||||||
|
quadrant: languages-and-frameworks
|
||||||
---
|
---
|
||||||
|
|
||||||
Hier steht eine Einleitung über *React* - super "cool"
|
Hier steht eine Einleitung über *React* - super "cool"
|
||||||
@@ -1,6 +1,7 @@
|
|||||||
---
|
---
|
||||||
title: "Foo"
|
title: "Foo"
|
||||||
ring: trial
|
ring: trial
|
||||||
|
quadrant: methods-and-patterns
|
||||||
---
|
---
|
||||||
|
|
||||||
Foo
|
Foo
|
||||||
@@ -1,6 +1,7 @@
|
|||||||
---
|
---
|
||||||
title: "Grunt 2"
|
title: "Grunt 2"
|
||||||
ring: hold
|
ring: hold
|
||||||
|
quadrant: tools
|
||||||
---
|
---
|
||||||
|
|
||||||
Hier steht was neueres über *Grunt*
|
Hier steht was neueres über *Grunt*
|
||||||
@@ -1,6 +1,8 @@
|
|||||||
---
|
---
|
||||||
title: "React"
|
title: "React"
|
||||||
ring: trial
|
ring: trial
|
||||||
|
quadrant: languages-and-frameworks
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
React blablab *React* - super "cool"
|
React blablab *React* - super "cool"
|
||||||
@@ -2,6 +2,8 @@
|
|||||||
title: "This is a long title"
|
title: "This is a long title"
|
||||||
ring: assess
|
ring: assess
|
||||||
info: React is a view library
|
info: React is a view library
|
||||||
|
quadrant: languages-and-frameworks
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
React blablab *React* - super **"cool"**
|
React blablab *React* - super **"cool"**
|
||||||
@@ -1,6 +1,8 @@
|
|||||||
---
|
---
|
||||||
title: "Vue"
|
title: "Vue"
|
||||||
ring: adopt
|
ring: adopt
|
||||||
|
quadrant: languages-and-frameworks
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
Hier steht eine Einleitung über *React* - super "cool"
|
Hier steht eine Einleitung über *React* - super "cool"
|
||||||
@@ -1,6 +1,8 @@
|
|||||||
---
|
---
|
||||||
title: "Vue 123"
|
title: "Vue 123"
|
||||||
ring: assess
|
ring: assess
|
||||||
|
quadrant: languages-and-frameworks
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
Hier steht eine Einleitung über *React* - super "cool"
|
Hier steht eine Einleitung über *React* - super "cool"
|
||||||
@@ -1,6 +1,8 @@
|
|||||||
---
|
---
|
||||||
title: "Something else"
|
title: "Something else"
|
||||||
ring: hold
|
ring: hold
|
||||||
|
quadrant: languages-and-frameworks
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
Hier steht eine Einleitung über *React* - super "cool"
|
Hier steht eine Einleitung über *React* - super "cool"
|
||||||
@@ -1,5 +0,0 @@
|
|||||||
---
|
|
||||||
isFeatured: false
|
|
||||||
---
|
|
||||||
|
|
||||||
Foo!
|
|
||||||
6
radar/2016-02-03/react.md
Normal file
6
radar/2016-02-03/react.md
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
---
|
||||||
|
isFeatured: false
|
||||||
|
quadrant: languages-and-frameworks
|
||||||
|
---
|
||||||
|
|
||||||
|
Foo!
|
||||||
@@ -32,4 +32,4 @@ block content
|
|||||||
each item in items
|
each item in items
|
||||||
span.ring-list__item
|
span.ring-list__item
|
||||||
a.link(href='/' + quadrantName + '/' + item.name + '.html')
|
a.link(href='/' + quadrantName + '/' + item.name + '.html')
|
||||||
= item.attributes.title
|
= item.title
|
||||||
|
|||||||
@@ -39,21 +39,21 @@ block content
|
|||||||
each item in items
|
each item in items
|
||||||
a.item.item--big.item--no-leading-border.item--no-trailing-border(
|
a.item.item--big.item--no-leading-border.item--no-trailing-border(
|
||||||
href=`/${item.quadrant}/${item.name}.html`
|
href=`/${item.quadrant}/${item.name}.html`
|
||||||
v-if=`isRingVisible('${item.attributes.ring}')`
|
v-if=`isRingVisible('${item.ring}')`
|
||||||
)
|
)
|
||||||
.split.split--overview
|
.split.split--overview
|
||||||
.split__left
|
.split__left
|
||||||
.item__title
|
.item__title
|
||||||
= item.attributes.title
|
= item.title
|
||||||
if item.isNew
|
if item.isNew
|
||||||
= ' '
|
= ' '
|
||||||
span.is-new new
|
span.is-new new
|
||||||
if item.attributes.info
|
if item.info
|
||||||
.item__info= item.attributes.info
|
.item__info= item.info
|
||||||
.split__right
|
.split__right
|
||||||
.nav
|
.nav
|
||||||
.nav__item
|
.nav__item
|
||||||
= translate(item.quadrant)
|
= translate(item.quadrant)
|
||||||
.nav__item
|
.nav__item
|
||||||
span(class=`badge badge--${item.attributes.ring}`)
|
span(class=`badge badge--${item.ring}`)
|
||||||
= item.attributes.ring
|
= item.ring
|
||||||
|
|||||||
@@ -32,7 +32,7 @@ export const groupByQuadrants = (items) => (
|
|||||||
|
|
||||||
const addItemToQuadrant = (quadrant = {}, item) => ({
|
const addItemToQuadrant = (quadrant = {}, item) => ({
|
||||||
...quadrant,
|
...quadrant,
|
||||||
[item.attributes.ring]: addItemToRing(quadrant[item.attributes.ring], item),
|
[item.ring]: addItemToRing(quadrant[item.ring], item),
|
||||||
});
|
});
|
||||||
|
|
||||||
export const groupByFirstLetter = (items) => (
|
export const groupByFirstLetter = (items) => (
|
||||||
@@ -45,7 +45,7 @@ export const groupByFirstLetter = (items) => (
|
|||||||
export const groupByRing = (items) => (
|
export const groupByRing = (items) => (
|
||||||
items.reduce((rings, item) => ({
|
items.reduce((rings, item) => ({
|
||||||
...rings,
|
...rings,
|
||||||
[item.attributes.ring]: addItemToList(rings[item.attributes.ring], item),
|
[item.ring]: addItemToList(rings[item.ring], item),
|
||||||
}), {})
|
}), {})
|
||||||
);
|
);
|
||||||
|
|
||||||
@@ -54,9 +54,21 @@ const addItemToList = (list = [], item) => ([
|
|||||||
item,
|
item,
|
||||||
]);
|
]);
|
||||||
|
|
||||||
export const getFirstLetter = (item) => item.attributes.title.substr(0,1).toUpperCase();
|
export const getFirstLetter = (item) => item.title.substr(0,1).toUpperCase();
|
||||||
|
|
||||||
|
|
||||||
|
const checkAttributes = (fileName, attributes) => {
|
||||||
|
const rings = ['trial', 'assess', 'adopt', 'hold'];
|
||||||
|
if (attributes.ring && !rings.includes(attributes.ring)) {
|
||||||
|
throw new Error(`Error: ${fileName} has an illegal value for 'ring' - must be one of ${rings}`);
|
||||||
|
}
|
||||||
|
|
||||||
|
const quadrants = ['languages-and-frameworks', 'methods-and-patterns', 'platforms-and-aoe-services', 'tools'];
|
||||||
|
if (attributes.quadrant && !quadrants.includes(attributes.quadrant)) {
|
||||||
|
throw new Error(`Error: ${fileName} has an illegal value for 'quadrant' - must be one of ${quadrants}`);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
const createRevisionsFromFiles = (fileNames) => (
|
const createRevisionsFromFiles = (fileNames) => (
|
||||||
Promise.all(fileNames.map((fileName) => {
|
Promise.all(fileNames.map((fileName) => {
|
||||||
return new Promise((resolve, reject) => {
|
return new Promise((resolve, reject) => {
|
||||||
@@ -65,10 +77,11 @@ const createRevisionsFromFiles = (fileNames) => (
|
|||||||
reject(err);
|
reject(err);
|
||||||
} else {
|
} else {
|
||||||
const fm = frontmatter(data);
|
const fm = frontmatter(data);
|
||||||
|
checkAttributes(fileName, fm.attributes);
|
||||||
resolve({
|
resolve({
|
||||||
...itemInfoFromFilename(fileName),
|
...itemInfoFromFilename(fileName),
|
||||||
|
...fm.attributes,
|
||||||
fileName,
|
fileName,
|
||||||
attributes: fm.attributes,
|
|
||||||
body: marked(fm.body),
|
body: marked(fm.body),
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@@ -80,13 +93,11 @@ const createRevisionsFromFiles = (fileNames) => (
|
|||||||
const itemInfoFromFilename = (fileName) => {
|
const itemInfoFromFilename = (fileName) => {
|
||||||
const [
|
const [
|
||||||
release,
|
release,
|
||||||
quadrant,
|
|
||||||
nameWithSuffix,
|
nameWithSuffix,
|
||||||
] = fileName.split('/').slice(-3);
|
] = fileName.split('/').slice(-2);
|
||||||
return {
|
return {
|
||||||
name: nameWithSuffix.substr(0, nameWithSuffix.length - 3),
|
name: nameWithSuffix.substr(0, nameWithSuffix.length - 3),
|
||||||
release,
|
release,
|
||||||
quadrant,
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -115,7 +126,7 @@ const getAllReleases = (revisions) => (
|
|||||||
|
|
||||||
const addRevisionToQuadrant = (quadrant = {}, revision) => ({
|
const addRevisionToQuadrant = (quadrant = {}, revision) => ({
|
||||||
...quadrant,
|
...quadrant,
|
||||||
[revision.attributes.ring]: addRevisionToRing(quadrant[revision.attributes.ring], revision),
|
[revision.ring]: addRevisionToRing(quadrant[revision.ring], revision),
|
||||||
});
|
});
|
||||||
|
|
||||||
const createItems = (revisions) => {
|
const createItems = (revisions) => {
|
||||||
@@ -165,7 +176,7 @@ const addRevisionToItem = (item = {
|
|||||||
|
|
||||||
const revisionCreatesNewHistoryEntry = (revision) => {
|
const revisionCreatesNewHistoryEntry = (revision) => {
|
||||||
return revision.body.trim() !== '' ||
|
return revision.body.trim() !== '' ||
|
||||||
typeof revision.attributes.ring !== 'undefined';
|
typeof revision.ring !== 'undefined';
|
||||||
};
|
};
|
||||||
|
|
||||||
export const outputRadar = (items) => {
|
export const outputRadar = (items) => {
|
||||||
@@ -181,7 +192,7 @@ export const outputRadar = (items) => {
|
|||||||
// Object.entries(quadrant).map(([itemName, item]) => (
|
// Object.entries(quadrant).map(([itemName, item]) => (
|
||||||
new Promise((resolve, reject) => {
|
new Promise((resolve, reject) => {
|
||||||
outputFile(distPath(item.quadrant, `${item.name}.html`), itemTemplate(vars({
|
outputFile(distPath(item.quadrant, `${item.name}.html`), itemTemplate(vars({
|
||||||
itemsInRing: quadrants[item.quadrant][item.attributes.ring],
|
itemsInRing: quadrants[item.quadrant][item.ring],
|
||||||
item,
|
item,
|
||||||
})), (err, data) => {
|
})), (err, data) => {
|
||||||
if (err) {
|
if (err) {
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ extends default-page.pug
|
|||||||
block vars
|
block vars
|
||||||
- var noLogo=true
|
- var noLogo=true
|
||||||
- var noFooter=true
|
- var noFooter=true
|
||||||
- var title=item.attributes.title
|
- var title=item.title
|
||||||
|
|
||||||
block content
|
block content
|
||||||
.item-page.js--details(data-items=JSON.stringify(itemsInRing))
|
.item-page.js--details(data-items=JSON.stringify(itemsInRing))
|
||||||
@@ -16,8 +16,8 @@ block content
|
|||||||
.item-list__header(v-bind:style="navHeader.style")
|
.item-list__header(v-bind:style="navHeader.style")
|
||||||
.split
|
.split
|
||||||
.split__left
|
.split__left
|
||||||
span(class=`badge badge--big badge--${item.attributes.ring}`)
|
span(class=`badge badge--big badge--${item.ring}`)
|
||||||
= item.attributes.ring
|
= item.ring
|
||||||
.split__right
|
.split__right
|
||||||
a.icon-link(href=`/${item.quadrant}.html`)
|
a.icon-link(href=`/${item.quadrant}.html`)
|
||||||
span.icon.icon--pie.icon-link__icon
|
span.icon.icon--pie.icon-link__icon
|
||||||
@@ -29,33 +29,33 @@ block content
|
|||||||
href=`/${ringItem.quadrant}/${ringItem.name}.html`
|
href=`/${ringItem.quadrant}/${ringItem.name}.html`
|
||||||
v-bind:style=`items[${i}].style`
|
v-bind:style=`items[${i}].style`
|
||||||
)
|
)
|
||||||
.item__title= ringItem.attributes.title
|
.item__title= ringItem.title
|
||||||
if ringItem.attributes.info
|
if ringItem.info
|
||||||
.item__info= ringItem.attributes.info
|
.item__info= ringItem.info
|
||||||
.item-page__content(v-bind:style="background.style")
|
.item-page__content(v-bind:style="background.style")
|
||||||
.item-page__content__inner(v-bind:style="text.style")
|
.item-page__content__inner(v-bind:style="text.style")
|
||||||
.item-page__header
|
.item-page__header
|
||||||
.split
|
.split
|
||||||
.split__left
|
.split__left
|
||||||
h1.hero-headline.hero-headline--inverse
|
h1.hero-headline.hero-headline--inverse
|
||||||
= item.attributes.title
|
= item.title
|
||||||
.split__right
|
.split__right
|
||||||
span(class=`badge badge--big badge--${item.attributes.ring}`)
|
span(class=`badge badge--big badge--${item.ring}`)
|
||||||
= item.attributes.ring
|
= item.ring
|
||||||
.markdown
|
.markdown
|
||||||
!= item.body
|
!= item.body
|
||||||
//-
|
//-
|
||||||
a(href='/' + item.quadrant + '.html')= translate(item.quadrant)
|
a(href='/' + item.quadrant + '.html')= translate(item.quadrant)
|
||||||
h1 #{item.attributes.title}
|
h1 #{item.title}
|
||||||
= ' '
|
= ' '
|
||||||
small #{item.attributes.ring}
|
small #{item.ring}
|
||||||
|
|
||||||
|
|
||||||
hr
|
hr
|
||||||
|
|
||||||
h4= item.revisions[0].version
|
h4= item.revisions[0].version
|
||||||
h5 New: #{item.isNew ? 'YES' : 'NO'}
|
h5 New: #{item.isNew ? 'YES' : 'NO'}
|
||||||
h5 Feature: #{item.attributes.isFeatured ? 'YES' : 'NO'}
|
h5 Feature: #{item.isFeatured ? 'YES' : 'NO'}
|
||||||
|
|
||||||
section
|
section
|
||||||
!= item.revisions[0].body
|
!= item.revisions[0].body
|
||||||
@@ -68,5 +68,5 @@ block content
|
|||||||
h3
|
h3
|
||||||
= revision.version
|
= revision.version
|
||||||
= ' '
|
= ' '
|
||||||
= revision.attributes.ring
|
= revision.ring
|
||||||
!= revision.body
|
!= revision.body
|
||||||
|
|||||||
@@ -19,6 +19,6 @@ block content
|
|||||||
.item-list__list
|
.item-list__list
|
||||||
each ringItem in items
|
each ringItem in items
|
||||||
a.item.item--no-leading-border(href=`/${ringItem.quadrant}/${ringItem.name}.html`)
|
a.item.item--no-leading-border(href=`/${ringItem.quadrant}/${ringItem.name}.html`)
|
||||||
.item__title= ringItem.attributes.title
|
.item__title= ringItem.title
|
||||||
if ringItem.attributes.info
|
if ringItem.info
|
||||||
.item__info= ringItem.attributes.info
|
.item__info= ringItem.info
|
||||||
|
|||||||
Reference in New Issue
Block a user