Hexo excerpt <! - more & # 8594; not working after update

I just updated my Hexo blog to the latest version. After the update, the tag <!-- more -->seems to stop working. Instead of showing an excerpt on the main page, it simply displays all the content. I use the "Next" theme.

I found the problem in github hexo: https://github.com/hexojs/hexo/pull/1519

What does the problem I am facing look like. I tried changing this file locally, but nothing is happening, still not working.

Is there an npm cache or something that I need to clear when I edit the package in node_modules directly?

thanks

+4
source share
1

node_modules npm install?

: Hexo, "hexo": "hexo.stable.version" package.json scripts . Hexo. : excerpt.js. : ////excerpt.js

var rExcerpt = /<!-- ?more ?-->/;

hexo.extend.filter.register('after_post_render', function(data) {
    var content = data.content;

    if (rExcerpt.test(content)){
        data.content = content.replace(rExcerpt, function(match, index){
            data.excerpt = content.substring(0, index).trim();
            data.more = content.substring(index + match.length).trim();

            return '<a id="more"></a>';
        });
    } else {
        data.excerpt = '';
        data.more = content;
    }
});

.

+1

Source: https://habr.com/ru/post/1610160/


All Articles