fix(plugins/core): disable css optimization for extras_css (#756) [skip ci]
This commit is contained in:
@@ -24,7 +24,8 @@ export default async function metrics({login, q}, {graphql, rest, plugins, conf,
|
||||
//Initialization
|
||||
const pending = []
|
||||
const {queries} = conf
|
||||
const data = {q, animated:true, large:false, base:{}, config:{}, errors:[], plugins:{}, computed:{}}
|
||||
const extras = {css:(conf.settings.extras?.css ?? conf.settings.extras?.default ? q["extras.css"] ?? "" : "")}
|
||||
const data = {q, animated:true, large:false, base:{}, config:{}, errors:[], plugins:{}, computed:{}, extras}
|
||||
const imports = {
|
||||
plugins:Plugins,
|
||||
templates:Templates,
|
||||
@@ -153,7 +154,7 @@ export default async function metrics({login, q}, {graphql, rest, plugins, conf,
|
||||
if (convert === "markdown-pdf") {
|
||||
return imports.svg.pdf(rendered, {
|
||||
paddings:q["config.padding"] || conf.settings.padding,
|
||||
style:(conf.settings.extras?.css ?? conf.settings.extras?.default ? q["extras.css"] ?? "" : ""),
|
||||
style:extras.css,
|
||||
twemojis:q["config.twemoji"],
|
||||
gemojis:q["config.gemoji"],
|
||||
rest,
|
||||
@@ -164,7 +165,7 @@ export default async function metrics({login, q}, {graphql, rest, plugins, conf,
|
||||
|
||||
//Rendering
|
||||
console.debug(`metrics/compute/${login} > render`)
|
||||
let rendered = await ejs.render(image, {...data, s:imports.s, f:imports.format, style:style + (conf.settings.extras?.css ?? conf.settings.extras?.default ? q["extras.css"] ?? "" : ""), fonts}, {views, async:true})
|
||||
let rendered = await ejs.render(image, {...data, s:imports.s, f:imports.format, style, fonts}, {views, async:true})
|
||||
|
||||
//Additional transformations
|
||||
if (q["config.twemoji"])
|
||||
|
||||
@@ -59,6 +59,8 @@
|
||||
columns: set.config.display === "columns",
|
||||
//Config
|
||||
config: set.config,
|
||||
//Extras
|
||||
extras:{css:options["extras.css"] ?? ""},
|
||||
//Base elements
|
||||
base: set.plugins.enabled.base,
|
||||
//Computed elements
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
|
||||
<defs><style><%= fonts %></style></defs>
|
||||
<style data-optimizable="true"><%= style %></style>
|
||||
<style><%= extras.css %></style>
|
||||
|
||||
<foreignObject x="0" y="0" width="100%" height="100%">
|
||||
<div xmlns="http://www.w3.org/1999/xhtml" xmlns:xlink="http://www.w3.org/1999/xlink" class="items-wrapper">
|
||||
|
||||
|
Before Width: | Height: | Size: 1.1 KiB After Width: | Height: | Size: 1.2 KiB |
@@ -2,9 +2,8 @@
|
||||
|
||||
<defs><style><%= fonts %></style></defs>
|
||||
|
||||
<style data-optimizable="true">
|
||||
<%= style %>
|
||||
</style>
|
||||
<style data-optimizable="true"><%= style %></style>
|
||||
<style><%= extras.css %></style>
|
||||
|
||||
<foreignObject x="0" y="0" width="100%" height="100%">
|
||||
<div xmlns="http://www.w3.org/1999/xhtml" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||
|
||||
|
Before Width: | Height: | Size: 1.4 KiB After Width: | Height: | Size: 1.4 KiB |
@@ -28,6 +28,7 @@
|
||||
<% } %>
|
||||
<% } %>
|
||||
</style>
|
||||
<style><%= extras.css %></style>
|
||||
|
||||
<foreignObject x="0" y="0" width="100%" height="100%">
|
||||
<div xmlns="http://www.w3.org/1999/xhtml" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||
|
||||
|
Before Width: | Height: | Size: 2.2 KiB After Width: | Height: | Size: 2.3 KiB |
Reference in New Issue
Block a user