-
Notifications
You must be signed in to change notification settings - Fork 180
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #387 from feature-sliced/refactor/PROMO-251-fs-imp…
…rovements PROMO-251(OG Plugin): Minor refinements (fs, logs)
- Loading branch information
Showing
8 changed files
with
106 additions
and
54 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
23 changes: 15 additions & 8 deletions
23
website/plugins/docusaurus-plugin-open-graph-image/config.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
52 changes: 31 additions & 21 deletions
52
website/plugins/docusaurus-plugin-open-graph-image/template.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
18 changes: 17 additions & 1 deletion
18
website/plugins/docusaurus-plugin-open-graph-image/utils.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,21 @@ | ||
const pc = require("picocolors"); | ||
|
||
function objectFromBuffer(buffer) { | ||
return JSON.parse(buffer.toString()); | ||
} | ||
|
||
module.exports = { objectFromBuffer }; | ||
const Logger = { | ||
info(text) { | ||
// eslint-disable-next-line no-console | ||
console.log(pc.bgYellow(pc.black(`! ${text}`))); | ||
}, | ||
ok(text) { | ||
// eslint-disable-next-line no-console | ||
console.log(pc.bgGreen(pc.black(`\u2714 ${text}`))); | ||
}, | ||
err(text) { | ||
console.error(pc.bgRed(pc.black(`\u274C ${text}`))); | ||
}, | ||
}; | ||
|
||
module.exports = { objectFromBuffer, Logger }; |