import{isTruthy as p}from"../../../utils/guards/is-truthy.js";function r(t){const{name:e,property:i,content:n}=t;if(e&&i)return{name:e,property:i,content:n};if(e)return{name:e,content:n};if(i)return{property:i,content:n}}function c(t){const e=[];if(t.title){const i=[t.title,t.projectTitle].filter(p).join(" | ");e.push(r({name:"title",content:i})),e.push(r({property:"og:title",content:i})),e.push(r({name:"twitter:title",property:"twitter:title",content:i}))}if(t.description&&(e.push(r({name:"description",content:t.description})),e.push(r({property:"og:description",content:t.description})),e.push(r({name:"twitter:description",property:"twitter:description",content:t.description}))),t.image&&(e.push(r({name:"image",content:t.image})),e.push(r({property:"og:image",content:t.image})),e.push(r({name:"twitter:image",property:"twitter:image",content:t.image}))),t.keywords&&e.push(r({name:"keywords",content:Array.isArray(t.keywords)?t.keywords.join(", "):t.keywords})),t.meta)for(const{name:i,content:n}of t.meta)i.includes("og:")?e.push(r({property:i,content:n})):e.push(r({name:i,content:n}));return e.filter(p)}export{c as getMetaTagsAttributes};
