PROMO-251(OG Plugin): Minor refinements (fs, logs)#387
Conversation
Krakazybik
left a comment
There was a problem hiding this comment.
Вроде как все пути поправил, все пожелания привнёс, templatesDir у нас резолвится в конфиге, который во втором PR.
| return { | ||
| name: "docusaurus-plugin-open-graph-image", | ||
| async postBuild({ plugins, outDir, i18n }) { | ||
| Logger.info(`OG: work in progress.`); |
There was a problem hiding this comment.
Пенерёс инициализацию в postBuild изза асинхронности.
| console.error(pc.bgRed(pc.black(`\u274C ${text}`))); | ||
| }, | ||
| }; | ||
|
|
There was a problem hiding this comment.
Немного красивости, надеюсь никто не будет против =)
There was a problem hiding this comment.
praise: Выглядит балдежно))
Лишь бы бандл нам не расфигачило, но там разберемся уже)
|
|
||
| const { config } = initData; | ||
|
|
||
| module.exports = function (_, { templatesDir }) { |
There was a problem hiding this comment.
вернул на место удалённый по ошибке первый аргумент.
|
@Krakazybik Здорово что оформил отдельным PR, независимо от #375 Так рили проще будет влить 🚀 |
|
|
||
| function createImageFromTemplate({ path, name, params }) { | ||
| return createImagePipeline(`${path}\\${name}\\${params.image}`); | ||
| return createImagePipeline(resolve(path, name, params.image)); |
| async function getConfig(configPath, encode = "utf-8") { | ||
| try { | ||
| const config = objectFromBuffer(await readFile(resolve(configPath, "config.json"), encode)); | ||
|
|
||
| if (!validateConfig(config)) { | ||
| Logger.err("Config validation error"); | ||
| return; | ||
| } | ||
|
|
||
| return config; | ||
| } catch (error) { | ||
| Logger.err(error); |
| console.error(pc.bgRed(pc.black(`\u274C ${text}`))); | ||
| }, | ||
| }; | ||
|
|
There was a problem hiding this comment.
praise: Выглядит балдежно))
Лишь бы бандл нам не расфигачило, но там разберемся уже)
CHANGELOG
Добавлено/изменено:
Reference
#368 (review)
#251 #375
Чеклист