1
0
mirror of https://github.com/keeweb/keeweb.git synced 2024-06-22 07:16:38 +02:00
keeweb/app/scripts/hbs-helpers/svg.js
2020-04-15 16:50:01 +02:00

10 lines
251 B
JavaScript

import Handlebars from 'hbs';
Handlebars.registerHelper('svg', (name, cls) => {
const icon = require(`svg/${name}.svg`).default;
if (typeof cls === 'string') {
return `<svg class="${cls}"` + icon.substr(4);
}
return icon;
});