feat(core): add config_base64 option (#622) [skip ci]
This commit is contained in:
@@ -6,9 +6,15 @@
|
|||||||
//Setup
|
//Setup
|
||||||
export default async function({login, q}, {conf, data, rest, graphql, plugins, queries, account, convert, template}, {pending, imports}) {
|
export default async function({login, q}, {conf, data, rest, graphql, plugins, queries, account, convert, template}, {pending, imports}) {
|
||||||
//Load inputs
|
//Load inputs
|
||||||
const {"config.animations":animations, "config.display":display, "config.timezone":_timezone, "debug.flags":dflags} = imports.metadata.plugins.core.inputs({data, account, q})
|
const {"config.animations":animations, "config.display":display, "config.timezone":_timezone, "config.base64":_base64, "debug.flags":dflags} = imports.metadata.plugins.core.inputs({data, account, q})
|
||||||
imports.metadata.templates[template].check({q, account, format:convert})
|
imports.metadata.templates[template].check({q, account, format:convert})
|
||||||
|
|
||||||
|
//Base64 images
|
||||||
|
if (!_base64) {
|
||||||
|
console.debug(`metrics/compute/${login} > base64 for images has been disabled`)
|
||||||
|
imports.imgb64 = url => url
|
||||||
|
}
|
||||||
|
|
||||||
//Init
|
//Init
|
||||||
const computed = {commits:0, sponsorships:0, licenses:{favorite:"", used:{}, about:{}}, token:{}, repositories:{watchers:0, stargazers:0, issues_open:0, issues_closed:0, pr_open:0, pr_closed:0, pr_merged:0, forks:0, forked:0, releases:0, deployments:0, environments:0}}
|
const computed = {commits:0, sponsorships:0, licenses:{favorite:"", used:{}, about:{}}, token:{}, repositories:{watchers:0, stargazers:0, issues_open:0, issues_closed:0, pr_open:0, pr_closed:0, pr_merged:0, forks:0, forked:0, releases:0, deployments:0, environments:0}}
|
||||||
const avatar = imports.imgb64(data.user.avatarUrl)
|
const avatar = imports.imgb64(data.user.avatarUrl)
|
||||||
|
|||||||
@@ -192,6 +192,13 @@ inputs:
|
|||||||
type: boolean
|
type: boolean
|
||||||
default: yes
|
default: yes
|
||||||
|
|
||||||
|
# Encode images links into base64 data
|
||||||
|
# Advised to be true when generating images and false when generating texts or JSON
|
||||||
|
config_base64:
|
||||||
|
description: Encode images links into base64 data
|
||||||
|
type: boolean
|
||||||
|
default: yes
|
||||||
|
|
||||||
# Configure padding for output image (percentage value)
|
# Configure padding for output image (percentage value)
|
||||||
# It can be used to add padding to generated metrics if rendering is cropped or has too much empty space
|
# It can be used to add padding to generated metrics if rendering is cropped or has too much empty space
|
||||||
# Specify one value (for both width and height) or two values (one for width and one for height)
|
# Specify one value (for both width and height) or two values (one for width and one for height)
|
||||||
|
|||||||
Reference in New Issue
Block a user