import cheerio from 'cheerio'
export default {
// Global page headers: https://go.nuxtjs.dev/config-head
mode: 'universal',
//修改百度收录
hooks: {
'render:route': (url, result) => {
var html = cheerio.load(result.html,{decodeEntities: false});
//删除data-n-head
html(`meta`).removeAttr('data-n-head');
//修改meta标签闭合
result.html = html.html().replaceAll(/<meta.*>/g,function(word){
return word.replaceAll(" "," ").replaceAll(">"," />");}
);
}
},
}