-
Notifications
You must be signed in to change notification settings - Fork 0
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
🚀 #1
Conversation
.eleventy.js
Outdated
var payload = { | ||
"title": radar.category, | ||
"date": radar.date, | ||
...baseSettings, | ||
...radar.data | ||
}; |
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.
- используй пожалуйста const а не var
- деструктуризация baseSettings и radar.data может затереть то что ты выше подметил для title и date, поэтому лучше так попробуй:
const payload = { ...baseSettings, ...radar.data, title: radar.category, date: radar.date, };
src/_collections/radars.js
Outdated
const { parse } = require("csv-parse/sync"); | ||
|
||
function readCSV(dir) { | ||
var file = fs.readFileSync(dir); |
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.
const
src/_collections/radars.js
Outdated
const rings = Object.keys(settings.rings).map((e) => settings.rings[e]); | ||
const quadrants = Object.keys(settings.quadrants.names).map((e) => ({ name: settings.quadrants.names[e] })); | ||
|
||
var entries = []; |
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.
src/_collections/radars.js
Outdated
const radarsDir = path.join(process.cwd(), "radars") | ||
const categories = fs.readdirSync(radarsDir) | ||
|
||
var radars = []; |
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.
src/_collections/radars.js
Outdated
var categoryPath = path.join(radarsDir, category); | ||
|
||
var settingsPath = path.join(categoryPath, "settings.json"); | ||
var settings = {}; |
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.
src/_collections/radars.js
Outdated
if (fs.existsSync(settingsPath)) { | ||
settings = JSON.parse(fs.readFileSync(settingsPath), 'utf8'); | ||
} |
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.
const settings = fs.existsSync(settingsPath) ? JSON.parse(fs.readFileSync(settingsPath), 'utf8') : {}
LGTM! |
The initial implementation of technology radar