hexo-reference icon indicating copy to clipboard operation
hexo-reference copied to clipboard

json文件代码注入

Open BTMuli opened this issue 3 years ago • 0 comments

例:在vercel.json前面会添加一小段内容:

<link rel="stylesheet" type="text/css" href="https://cdn.jsdelivr.net/hint.css/2.4.1/hint.min.css">

我很好奇源码中的这一段:


// Add CDN CSS resources
hexo.extend.filter.register('after_post_render', function(data) {
  data.content =
      util.htmlTag('link', {rel: 'stylesheet', type: 'text/css', href: 'https://cdn.jsdelivr.net/hint.css/2.4.1/hint.min.css'}) +
      data.content;
  return data;
});

是不是没有过滤掉一些显然不是html的文件,比如json。

image

BTMuli avatar Nov 29 '22 12:11 BTMuli