【解決】hexo 生成的publish中html都是空的?

往常新增文章之後,直接hexo d -g一鍵就發佈了,然後去網站一看,啥也沒有。就鬱悶了。

因爲目前https的證書也到期了,懷疑了好多點。

  1. nginx配置
    因爲看頁面的狀態是302,懷疑是nginx的配置問題,之前https證書到期,需要把443的監聽去掉,修改了一些配置,所以首度懷疑是配置問題。但配置就那幾行,排除這個點。
  2. _config.yml配置文件
    網上很多說是_config.yml的配置問題,這個我確實改了一處,就是把avartar從https://media.lvxiang.site/file/avatar.jpeg改爲了//media.lvxiang.site/file/avatar.jpeg,然後改回去,重新hexo clean & hexo d -gpublic中的html還是空的。
    PS:配置文件有問題可能會導致build失敗
  3. hexo的版本
    又懷疑是hexo的版本問題,雖然都是3+,但不妨一試,使用了package中的3.7版本試了一下,還是不行 - -
  4. node版本
    接着運行hexo s --debug,然後打開網站,發現日誌中有一些warning:
(node:37667) Warning: Accessing non-existent property 'lineno' of module exports inside circular dependency
(Use `node --trace-warnings ...` to show where the warning was created)
(node:37667) Warning: Accessing non-existent property 'column' of module exports inside circular dependency
(node:37667) Warning: Accessing non-existent property 'filename' of module exports inside circular dependency
(node:37667) Warning: Accessing non-existent property 'lineno' of module exports inside circular dependency
(node:37667) Warning: Accessing non-existent property 'column' of module exports inside circular dependency
(node:37667) Warning: Accessing non-existent property 'filename' of module exports inside circular dependency
(node:37667) Warning: Accessing non-existent property 'lineno' of module exports inside circular dependency
(node:37667) Warning: Accessing non-existent property 'column' of module exports inside circular dependency
(node:37667) Warning: Accessing non-existent property 'filename' of module exports inside circular dependency
(node:37667) Warning: Accessing non-existent property 'lineno' of module exports inside circular dependency
(node:37667) Warning: Accessing non-existent property 'column' of module exports inside circular dependency
(node:37667) Warning: Accessing non-existent property 'filename' of module exports inside circular dependency

查了一下相關issue
然後nvm下了一個12+的版本,重新build,結果html有內容了!!!

證書到期了,懶得搞了,個人博客地址如下:
http://blog.lvxiang.site/

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章