index.js
function injectManifest(data) {
  let manifestHtml = `<head><link rel=manifest href=${hexo.config.pwa.manifest.path}>`;

  if (data.indexOf(manifestHtml) === -1) {
    data = data.replace('<head>', manifestHtml);
  }

  return data;
}
function injectManifest(data) {
  let manifestHtml = `<head><link rel=manifest href=${hexo.config.pwa.manifest.path}>`;

  if (data.indexOf(manifestHtml) === -1) {
    data = data.replace('<head>', manifestHtml);
  }

  return data;
}
inject manifest html fragment into page code

@param {string} data html
@return {string}