iGuan7u/Acetolog

即使我使用的是一个纯净的环境来部署的时候, 页面不能正确加载

chappie2054 opened this issue · 6 comments

http://img.ljh666.xyz/img/20200817172410.png
很喜欢这个风格的主题, 作者很棒, 但我不知道哪里搞错了, 页面像上面图示那样
我使用的的
v12.0.0的node.js
5点多的hexo

你好,感谢你选择了 Acetolog。
截图的现象似乎是 hexo 的依赖没有安装成功,导致了模版渲染出现了问题,可以将 theme 改回为 hexo 默认的主题,看看效果是否正常?
如果依然不行的话,可以尝试一下去掉 node_modules 文件夹重新安装一下依赖

我尝试了你的方法, 不幸的是没有改变结果, 页面任然没有渲染
我删除了node_modules文件夹
重新安装
///////////////////////////////////////////////////
[root@node2 test]# npm install

deasync@0.1.20 install /www/test/node_modules/deasync
node ./build.js

linux-x64-node-12 exists; testing
Binary is fine; exiting

puppeteer@3.3.0 install /www/test/node_modules/puppeteer
node install.js

Downloading Chromium r756035 - 125.2 Mb [====================] 100% 0.0s
Chromium (756035) downloaded to /www/test/node_modules/puppeteer/.local-chromium/linux-756035

ejs@2.7.4 postinstall /www/test/node_modules/ejs
node ./postinstall.js

Thank you for installing EJS: built with the Jake JavaScript build tool (https://jakejs.com/)

npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@2.1.3 (node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@2.1.3: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})

added 433 packages from 624 contributors and audited 434 packages in 836.577s
found 1 low severity vulnerability
run npm audit fix to fix them, or npm audit for details
/////////////////////////////////////////////////////////////////////////
但不清楚我缺少了什么依赖, 所以我这里展示出我所有的环境
/////////////////////////////////////////////////////////////////////////
[root@node2 node_modules]# hexo version
INFO Validating config
hexo: 5.0.2
hexo-cli: 4.2.0
os: Linux 3.10.0-1062.el7.x86_64 linux x64
node: 12.0.0
v8: 7.4.288.21-node.16
uv: 1.28.0
zlib: 1.2.11
brotli: 1.0.7
ares: 1.15.0
modules: 72
nghttp2: 1.38.0
napi: 4
llhttp: 1.1.1
http_parser: 2.8.0
openssl: 1.1.1b
cldr: 34.0
icu: 63.1
tz: 2018e
unicode: 11.0
/////////////////////////////////////////////////////////////////////////
[root@node2 test]# cat package.json
{
"name": "hexo-site",
"version": "0.0.0",
"private": true,
"scripts": {
"build": "hexo generate",
"clean": "hexo clean",
"deploy": "hexo deploy",
"server": "hexo server"
},
"hexo": {
"version": "5.0.2"
},
"dependencies": {
"hexo": "^5.0.2",
"hexo-autoprefixer": "^2.0.0",
"hexo-generator-archive": "^1.0.0",
"hexo-generator-category": "^1.0.0",
"hexo-generator-index": "^2.0.0",
"hexo-generator-tag": "^1.0.0",
"hexo-renderer-ejs": "^1.0.0",
"hexo-renderer-marked": "^3.0.0",
"hexo-renderer-multi-markdown-it": "0.0.7",
"hexo-renderer-stylus": "^2.0.0",
"hexo-server": "^2.0.0"
}
}
/////////////////////////////////////////////////////////////////////////
[root@node2 node_modules]# ls
abbrev
accepts
agent-base
align-text
amdefine
ansi-regex
ansi-styles
anymatch
archy
argparse
asap
async
a-sync-waterfall
atob
a.txt
autoprefixer
@babel
babel-eslint
balanced-match
base64-js
basic-auth
binary-extensions
bindings
bl
bluebird
brace-expansion
braces
@braintree
browserslist
buffer
buffer-crc32
buffer-from
bytes
camelcase
camel-case
caniuse-lite
center-align
chalk
change-case
chokidar
chownr
clean-css
clipboard
cliui
clone
color-convert
colorette
color-name
commander
command-exists
compressible
compression
concat-map
connect
constant-case
cross-spawn
css
css-b64-images
css-parse
cuid
d3
d3-array
d3-axis
d3-brush
d3-chord
d3-collection
d3-color
d3-contour
d3-dispatch
d3-drag
d3-dsv
d3-ease
d3-fetch
d3-force
d3-format
d3-geo
d3-hierarchy
d3-interpolate
d3-path
d3-polygon
d3-quadtree
d3-random
d3-scale
d3-scale-chromatic
d3-selection
d3-shape
d3-time
d3-time-format
d3-timer
d3-transition
d3-voronoi
d3-zoom
dagre
dagre-d3
deasync
deasync-promise
debug
decamelize
decode-uri-component
deepmerge
delegate
depd
destroy
domelementtype
domhandler
dom-serializer
domutils
dot-case
ee-first
ejs
electron-to-chromium
encodeurl
end-of-stream
entities
entity-decode
escalade
escape-html
escape-string-regexp
eslint-visitor-keys
esprima
etag
extract-zip
fd-slicer
file-uri-to-path
fill-range
finalhandler
frappe-charts
fresh
fs-constants
fs.realpath
get-stream
glob
globals
glob-parent
good-listener
graceful-fs
graceful-readlink
graphlib
has-flag
he
header-case
hexo
hexo-autoprefixer
hexo-front-matter
hexo-fs
hexo-generator-archive
hexo-generator-category
hexo-generator-index
hexo-generator-tag
hexo-i18n
hexo-log
hexo-pagination
hexo-renderer-ejs
hexo-renderer-marked
hexo-renderer-multi-markdown-it
hexo-renderer-stylus
hexo-server
hexo-util
highlight.js
html-minifier
htmlparser2
http-errors
https-proxy-agent
iconv-lite
ieee754
inflight
inherits
is-binary-path
is-buffer
is-docker
isexe
is-extglob
is-glob
is-lower-case
is-number
is-plain-object
is-upper-case
is-wsl
jsesc
jsonparse
JSONStream
js-tokens
js-yaml
katex
khroma
kind-of
lazy-cache
linkify-it
lodash
longest
lower-case
lower-case-first
markdown-it
markdown-it-abbr
markdown-it-attrs
markdown-it-bracketed-spans
markdown-it-charts
markdown-it-collapsible
markdown-it-container
markdown-it-deflist
markdown-it-emoji
markdown-it-footnote
markdown-it-ins
markdown-it-mark
markdown-it-multimd-table
markdown-it-pangu
markdown-it-sub
markdown-it-sup
markdown-it-task-checkbox
markdown-it-toc-and-anchor
marked
mdurl
mermaid
micromatch
mime
mime-db
mime-types
minify
minimatch
minimist
min-indent
mkdirp
mkdirp-classic
moment
moment-mini
moment-timezone
morgan
ms
ncname
negotiator
@neilsustc
nib
no-case
node-addon-api
node-releases
normalize-path
normalize-range
num2fraction
nunjucks
once
on-finished
on-headers
open
pangu
param-case
parseurl
pascal-case
path-case
path-is-absolute
path-key
path-parse
pend
picomatch
postcss
postcss-value-parser
pretty-hrtime
prismjs
progress
proxy-from-env
pump
puppeteer
range-parser
readable-stream
readdirp
relateurl
repeat-string
resolve
resolve-url
rfdc
right-align
rimraf
rw
safe-buffer
safer-buffer
sax
select
semver
send
sentence-case
serve-static
setprototypeof
shebang-command
shebang-regex
snake-case
source-map
source-map-resolve
source-map-support
source-map-url
sprintf-js
statuses
string_decoder
strip-ansi
strip-indent
striptags
stylis
stylus
supports-color
swap-case
tar-fs
tar-stream
terser
text-table
through
tildify
timsort
tiny-emitter
titlecase
title-case
to-fast-properties
toidentifier
to-regex-range
try-catch
try-to-catch
tslib
@types
uc.micro
uglify-js
uglify-to-browserify
unbzip2-stream
unorm
unpipe
upper-case
upper-case-first
urix
uslug
util-deprecate
utils-merge
vary
warehouse
which
window-size
wordwrap
wrappy
ws
xml-char-classes
yargs
yauzl

如果我使用hexo默认自带的主题, 页面渲染正常, 显示正常

测试了一下,似乎 Hexo 在 5.0 版本中去掉了 hexo-renderer-swig 插件的依赖,导致渲染模版出错了

这里需要执行 npm install hexo-renderer-swig --save 命令安装一下依赖,然后再重新 hexo g 渲染一下即可。

感谢你的反馈

后续我再想办法将 swig 模版迁移到 hexo 推荐的 ejs 上,避免对插件的依赖

自测能正常渲染目录了,后续有问题请重新打开 issuse