D0n9X1n / hexo-blog-encrypt

Yet, just another hexo plugin for security.
https://www.npmjs.com/package/hexo-blog-encrypt
MIT License
971 stars 101 forks source link

hexo butterfly主题使用gulp压缩和pjax后异常,已解决记录下来 #184

Closed kuole-o closed 2 years ago

kuole-o commented 2 years ago

目前问题已解决,记录在这里,也许会帮助到某个陌生人。

使用了gulp-uglify 压缩js,会出现问题。(表现是:出现输入密码页面,但是无论正确还是错误,回车都无响应)报错Uncaught ReferenceError: regeneratorRuntime is not defined

解决方法:gulpfile.js文件中,不压缩hbe.js即可。

//minify js babel
gulp.task('compress', () =>
  gulp.src(['./public/**/*.js', '!./public/**/*.min.js'**, '!./public/lib/hbe.js'**])
        .pipe(babel({
            presets: ['@babel/preset-env']
        }))
    .pipe(uglify().on('error', function(e){
      console.log(e);
    }))
        .pipe(gulp.dest('./public'))
);

使用pjax,页面里一些图片解锁会不加载

解决方法:在配置文件里,把那个页面加到pjax排除列表里就行

# Pjax 缓存功能
# 它可能包含错误且不稳定,请在发现错误时提供反馈。
# https://github.com/MoOx/pjax
pjax:
  enable: true
  exclude:
      - /xxxx/
D0n9X1n commented 2 years ago

Nice job!

D0n9X1n commented 2 years ago

Pinned on top.

ghost commented 2 years ago

Thx