feat: add hreflang to buildLinkTag

This commit is contained in:
Barış Soner Uşaklı
2025-12-03 09:49:16 -05:00
parent 53e22acffb
commit ba85474dfb

View File

@@ -77,10 +77,12 @@ module.exports = function (utils, Benchpress, relative_path) {
}
function buildLinkTag(tag) {
const attributes = ['link', 'rel', 'as', 'type', 'href', 'sizes', 'title', 'crossorigin'];
const [link, rel, as, type, href, sizes, title, crossorigin] = attributes.map(attr => (tag[attr] ? `${attr}="${tag[attr]}" ` : ''));
const attributes = [
'link', 'rel', 'as', 'type', 'href', 'hreflang', 'sizes', 'title', 'crossorigin'
];
const [link, rel, as, type, href, hreflang, sizes, title, crossorigin] = attributes.map(attr => (tag[attr] ? `${attr}="${tag[attr]}" ` : ''));
return '<link ' + link + rel + as + type + sizes + title + href + crossorigin + '/>\n\t';
return '<link ' + link + rel + as + type + sizes + title + href + hreflang + crossorigin + '/>\n\t';
}
function stringify(obj) {