22 lines
379 B
JavaScript
22 lines
379 B
JavaScript
|
const selectors = [
|
||
|
"meta[property='og:image']",
|
||
|
];
|
||
|
|
||
|
module.exports = ($) => {
|
||
|
const icons = [];
|
||
|
|
||
|
selectors.forEach((selector) => {
|
||
|
$(selector).each((i, elem) => {
|
||
|
const { content } = elem.attribs;
|
||
|
if (content && content !== '#') {
|
||
|
const icon = {
|
||
|
src: content
|
||
|
};
|
||
|
icons.push(icon);
|
||
|
}
|
||
|
});
|
||
|
});
|
||
|
|
||
|
return icons;
|
||
|
};
|