Skip to content

Node.js based forum software built for the modern web

feat: add hreflang to buildLinkTag

Barış Soner Uşaklıba85474dfba9
diff --git a/public/src/modules/helpers.common.js b/public/src/modules/helpers.common.js
index aa1825adda..b9c46fa3cc 100644
--- a/public/src/modules/helpers.common.js
+++ b/public/src/modules/helpers.common.js
@@ -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) {