-
Notifications
You must be signed in to change notification settings - Fork 171
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
PROMO-251(OG Plugin): Minor refinements (fs, logs) #387
Conversation
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.
Вроде как все пути поправил, все пожелания привнёс, 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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Пенерёс инициализацию в postBuild изза асинхронности.
console.error(pc.bgRed(pc.black(`\u274C ${text}`))); | ||
}, | ||
}; | ||
|
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.
Немного красивости, надеюсь никто не будет против =)
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.
praise:
Выглядит балдежно))
Лишь бы бандл нам не расфигачило, но там разберемся уже)
|
||
const { config } = initData; | ||
|
||
module.exports = function (_, { templatesDir }) { |
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.
вернул на место удалённый по ошибке первый аргумент.
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.
👍
@Krakazybik Здорово что оформил отдельным PR, независимо от #375 Так рили проще будет влить 🚀 |
@@ -11,7 +12,7 @@ function createImagePipeline(file) { | |||
} | |||
|
|||
function createImageFromTemplate({ path, name, params }) { | |||
return createImagePipeline(`${path}\\${name}\\${params.image}`); | |||
return createImagePipeline(resolve(path, name, params.image)); |
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.
praise:
Стало лучше!
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); |
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.
praise:
Красивое...
console.error(pc.bgRed(pc.black(`\u274C ${text}`))); | ||
}, | ||
}; | ||
|
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.
praise:
Выглядит балдежно))
Лишь бы бандл нам не расфигачило, но там разберемся уже)
CHANGELOG
Добавлено/изменено:
Reference
#368 (review)
#251 #375
Чеклист