Browse Source

fix: postProcessHtml

pull/18727/head
ycjcl868 5 years ago
committed by 偏右
parent
commit
caa6eb0973
  1. 5
      site/theme/index.js

5
site/theme/index.js

@ -51,13 +51,12 @@ module.exports = {
'bisheng-plugin-antd?injectProvider', 'bisheng-plugin-antd?injectProvider',
'bisheng-plugin-react?lang=__react', 'bisheng-plugin-react?lang=__react',
], ],
selector: ($, pathname) => { postProcessHtml: ($, pathname) => {
let description = ''; let description = '';
if (pathname !== '/') { if (pathname !== '/') {
const desc = ($('section.markdown p').text() || ''); const desc = $('section.markdown p').text() || '';
description = desc.length > 50 ? `${desc.slice(0, 50)}...` : desc; description = desc.length > 50 ? `${desc.slice(0, 50)}...` : desc;
} }
console.log('description', description);
return { return {
description: description || '', description: description || '',
}; };

Loading…
Cancel
Save