JoeyBling / hexo-theme-yilia-plus

一个简洁优雅的hexo主题 A simple and elegant theme for hexo.
https://zhousiwei.gitee.io/yilia-plus-demo/
MIT License
732 stars 170 forks source link

发布到github page页面是空白(生成的index.html是空的) #69

Closed Ioridy closed 3 years ago

Ioridy commented 3 years ago

❓问题

发布到github page页面是空白(生成的index.html是空的)

🤔结果 & 预期

本地hexo s是正常的,但是发布后打开页面是空白(没有任何报错),不清楚什么原因

PS: 我有看别人的index.html都是有内容的,但是我的是空的,很奇怪本地server页面是正常的(测试过只留一个编辑的index.html, github page是显示正常的)。

我github page的地址(用了demo的数据,只改了发布的地方): ioridy.github.io

🐥环境 & 设置

Node.js & npm version

 npm -v
6.14.6

❯ node -v
v14.6.0

config

# Hexo Configuration
## Docs: https://hexo.io/docs/configuration.html
## Source: https://github.com/hexojs/hexo/

# Site
title: 試毅-思伟
#subtitle: Writing code is keep my heart beating only reason.
description: 試毅-思伟_技术博客
keywords: 試毅-思伟,試毅-思伟_技术博客
author: 試毅-思伟
language: zh-Hans
timezone: Asia/Shanghai

# URL
## If your site is put in a subdirectory, set url as 'http://yoursite.com/child' and root as '/child/'
url: https://ioridy.github.io
root: /
permalink: :year/:month/:day/:title/
#permalink: :category/:title/
permalink_defaults:

# Directory
source_dir: source
public_dir: public
tag_dir: tags
archive_dir: archives
category_dir: categories
code_dir: downloads/code
i18n_dir: :lang
# 跳过 hexo 渲染
skip_render:
  - screenshots/**
  - anires/**
  - screenshots/**
  - gitment/**
  - baidu_sitepush/**
  - canvas_nest/**
  - '*.html'
  - '*.js'
  - README.md
  - '*.sh'
  - '*.txt'
  - '*.md'

# Writing
new_post_name: :title.md # File name of new posts
default_layout: post
titlecase: false # Transform title into titlecase
external_link: true # Open external links in new tab
filename_case: 0
render_drafts: false
post_asset_folder: false
relative_link: false
future: true
highlight:
  enable: true
  line_number: true
  auto_detect: false
  tab_replace:

# Home page setting
# path: Root path for your blogs index page. (default = '')
# per_page: Posts displayed per page. (0 = disable pagination)
# order_by: Posts order. (Order by date descending by default)
index_generator:
  path: ''
  per_page: 10
  order_by: -date
    #top: 1
    #date: -1

# Category & Tag
default_category: uncategorized
category_map:
tag_map:

# Date / Time format
## Hexo uses Moment.js to parse and display date
## You can customize the date format as defined in
## http://momentjs.com/docs/#/displaying/format/
date_format: YYYY-MM-DD
time_format: HH:mm:ss

# Pagination
## Set per_page to 0 to disable pagination
per_page: 10
pagination_dir: page

# Extensions
## Plugins: https://hexo.io/plugins/
## Themes: https://hexo.io/themes/
theme: yilia-plus

# Deployment
## Docs: https://hexo.io/docs/deployment.html
deploy:
  type: git
  repository: https://github.com/ioridy/ioridy.github.io.git
  brabcg: master

jsonContent:
  file: content.json
  meta: false
  pages: false
  posts:
    title: true
    date: true
    path: true
    text: true
    raw: false
    content: false
    slug: false
    updated: false
    comments: false
    link: true
    permalink: false
    excerpt: false
    categories: false
    tags: true

# Extensions
plugins:
  hexo-generator-feed

# Feed Atom
feed:
  type: atom
  path: atom.xml
  limit: 20

# https://github.com/JoeyBling/hexo-filter-image
filter_image:
   # 日志是否启用
   #   log: true

themes config

# Header-菜单
menu:
  主页: /
  技术笔记: https://zhousiwei.gitee.io/ibooks/
  个人简历: https://zhousiwei.gitee.io/cv/
  日记本: /tags/日记本/
  Linux: /tags/Linux

# subNav-子导航
subNav:
  github: "https://github.com/JoeyBling"
  gitee: "https://gitee.com/zhousiwei" # 码云
  jianshu: "https://www.jianshu.com/u/02cbf31a043a" #简书
  csdn: "https://blog.csdn.net/qq_30930805"
  #csdn: "#"
  #rss: "#"
  zhihu: "https://zhihu.com/people/joeybling"
  qq: "img/2434387555.jpg"
  weixin: "img/weixin_.png"
  weibo: "http://weibo.com/jayinfo"
  #douban: "#"
  #segmentfault: "#"
  #bilibili: "#"
  #acfun: "#"
  mail: "mailto:zhousiwei0911@qq.com"
  #facebook: "#"
  #google: "#"
  #twitter: "#"
  #linkedin: "#"

# 悬停预览图片效果
hover_effect:
  ## `global` 0: Set separately, 1: Enable global 2: Close global
  ## `global` 0: 分开设置, 1: 全局启用, 2: 全局关闭
  global: 1
  # SubNav-导航
  subNav: true

# RSS订阅(关于如何配置启用:https://www.jianshu.com/p/2aaac7a19736)
rss: /atom.xml

# 是否需要修改 root 路径
# 如果您的网站存放在子目录中,例如 http://yoursite.com/blog,
# 请将您的 url 设为 http://yoursite.com/blog 并把 / 设为 /blog/。
root: /

# Content

# 文章太长,截断按钮文字
excerpt_link: more
# 文章卡片右下角常驻链接,不需要请设置为false
show_all_link: '展开全文'
# 数学公式
mathjax: false

# Open link in a new tab | 是否在新窗口打开链接
open_in_new:
  article: true  # 文章链接
  menu: true   # 导航菜单
  subNav: true  # 子菜单

# 打赏
# 打赏type设定:0-关闭打赏; 1-文章对应的md文件里有reward:true属性,才有打赏; 2-所有文章均有打赏
reward_type: 2
# 打赏wording
reward_wording: '谢谢你请我吃糖果'
# 支付宝二维码图片地址,跟你设置头像的方式一样。比如:/assets/img/alipay.jpg
alipay: /img/alipay.jpg
# 微信二维码图片地址
weixin: /img/weixin.png

# 目录
# 目录设定:0-不显示目录; 1-文章对应的md文件里有toc:true属性,才有目录; 2-所有文章均显示目录
toc: 1
# 根据自己的习惯来设置,如果你的目录标题习惯有标号,置为true即可隐藏hexo重复的序号;否则置为false
toc_hide_index: true
# 目录为空时的提示
toc_empty_wording: '目录,不存在的…'

# 是否有快速回到顶部的按钮
top: true

# Miscellaneous
# 百度统计
baidu_analytics: ''
google_analytics: ''

# 网站图标
favicon: /favicon.ico

# 你的头像url
avatar: /img/head.jpg

# 是否开启分享
share_jia: true

# 评论:1、畅言;2、Disqus;3、Gitment;4、Giteement
# 不需要使用某项,直接设置值为false,或注释掉
# 具体请参考wiki:https://github.com/JoeyBling/hexo-theme-yilia-plus/wiki

# 1、畅言
changyan_appid: false
changyan_conf: false

# 2、Disqus 在hexo根目录的config里也有disqus_shortname字段,优先使用yilia-plus的
disqus: false

# 3、Gitment----基于GitHub的评论系统(关闭请设置gitment_owner为false)
# 关于如何集成:https://www.jianshu.com/p/ac7658cc912f
gitment_owner: JoeyBling      #你的 GitHub ID
# 是否使用官方js(false可以提升访问速度,本地修改过一部分的js,官方js可能会出现服务器不稳定,不太建议使用)
gitment_remote: false
gitment_repo: 'yilia-plus-demo'          #存储评论的 repo name(需要在Github创建)
gitment_oauth:
  client_id: '1062039060f4021e8ae2'           #client ID
  client_secret: '6ffbfcbd49ef5b123d524664657145a662179f34'       #client secret

# 4、Giteement----【国内用户建议使用这个,相对比较快】
# 关于如何集成:https://www.jianshu.com/p/f5c4633524c7
# 基于码云的评论系统(https://gitee.com/zhousiwei/giteement)
giteement:
  enable: false  # 是否启用码云评论系统
  # 是否使用官方js(false可以提升访问速度)
  remote: false
  redirect_uri: 'https://zhousiwei.gitee.io/yilia-plus-demo'   # 应用回调地址(请和配置的第三方应用保持一致)
  # 不能更改(网上开源项目https://github.com/Rob--W/cors-anywhere作者提供的专门用来跨域服务器的配置)
  oauth_uri: https://cors-anywhere.herokuapp.com/https://gitee.com/oauth/token
  giteeID: 'zhousiwei'  # 你的码云账号英文名
  # 存储评论的 repo name(需要在码云仓库创建公开仓库)
  repo: 'yilia-plus-demo'
  gitment_oauth:
    client_id: '91e05bd40f24e75e7a61e8e0aafc1b541f525851874fe5b0b4d25cc9ea0bf68c'           #client ID
    client_secret: '70d725414c22dc29ca7291c9a853acb4d9de666126ba95dfcb3a186f1ff52d38'       #client secret

# 访问量统计功能(不蒜子)
busuanzi:
  enable: true
  site_visit: true  # 站点访问量显示
  article_visit: true  # 文章访问量显示

# 网易云音乐插件
music:
  enable: false
  # 播放器尺寸类型(1:长尺寸、2:短尺寸)
  type: 2
  #id: 1332647902  # 网易云分享的音乐ID(更换音乐请更改此配置项)
  autoPlay: true  # 是否开启自动播放
  # 提示文本(关闭请设置为false)
  text: '这似乎是首纯音乐,请尽情的欣赏它吧!'

# 页面点击小红心
clickLove:
  # (关闭请设置为false)
  enable: true

# GitHub Ribbons(https://github.blog/2008-12-19-github-ribbons/)
github:
  # (关闭请设置为false)
  url: https://github.com/JoeyBling/hexo-theme-yilia-plus

# 页脚 Litten(此配置项已弃用)
# 帮助我们让更多人可以更方便使用Hexo,请尽量不要修改此主题配置
pageFooter:
  litten: GitHub:<a href="https://github.com/JoeyBling/hexo-theme-yilia-plus" target="_blank">hexo-theme-yilia-plus</a>

# 开启百度站长平台自动推送(https://ziyuan.baidu.com/linksubmit/index)
baidu_push: false

# 版权声明
# 版权声明type设定:0-关闭版权声明; 1-文章对应的md文件里有copyright: true属性,才有版权声明; 2-所有文章均有版权声明
copyright_type: 2

# 网站成立年份(默认为 2018,若填入年份小于当前年份,则显示为 2018-2019 类似的格式)
since: 2018

# Progress Bar | 页面加载进度条
# Demo: http://github.hubspot.com/pace/docs/welcome/
# type: barber-shop|big-counter|bounce|center-atom|center-circle|
#       center-radar|center-simple|corner-indicator|flash|flat-top|
#       loading-bar|mac-osx|minimal
# color: black|blue|green|orange|pink|purple|red|silver|white|yellow|
progressBar:
  enable: false
  type: 'flash'  # Keep Quotes | 保留引号避免出错(某些type会导致样式重叠排版错误)
  color: blue

# Apple Touch icon 苹果图标(关闭请设置为false)
apple_touch_icon: '/apple-touch-icon-180x180.png'

# Tab Title Change | 标签页标题切换
tab_title_change:
  enable: true
  left_tab_title: '(つェ⊂) 我藏好了哦~ '
  return_tab_title: '(*´∇`*) 被你发现啦~ '

# https://github.com/willin/hexo-wordcount
# 是否开启字数统计(关闭请设置enable为false)
# 也可以单独在md文件里Front-matter设置`no_word_count: true`属性,来自定义关闭字数统计
word_count:
  enable: true
  # 只在文章详情显示(不在首页显示)
  only_article_visit: true

# 文字输入特效
# https://github.com/disjukr/activate-power-mode
activate_power_mode:
  enable: true
  # 使输入模式丰富多彩
  colorful: true
  # 是否开启摇动
  shake: false

# 看板娘动态模型插件
## https://github.com/JoeyBling/live2d-widget.js
live2d:
  # (关闭请设置为false)
  enable: true
  # 模型名称(取值请参考:https://github.com/JoeyBling/hexo-theme-yilia-plus/wiki/live2d%E6%A8%A1%E5%9E%8B%E5%8C%85%E5%B1%95%E7%A4%BA)
  model: miku
  display:
    position: right # 显示位置:left/right(default: 'right')
    width: 145  # 模型的长度(default: 150)
    height: 320 # 模型的高度(default: 300)
    hOffset: 50 # 水平偏移(default: 0)
    #vOffset: -20 # 垂直偏移(default: -20)
  mobile:
    show: false # 是否在移动设备上显示(default: true)
    scale: 0.6 # 移动设备上的缩放(default: 0.5)
  react:
    opacity: 1 # 模型透明度(default: 0.7)

# 样式定制 - 一般不需要修改,除非有很强的定制欲望…
style:
  # 头像上面的背景颜色
  # header: '#D3D1DC'
  header: '#4d4d4d'
  gif:
    # 是否启用左侧边栏动态图效果
    enable: false
    # 自定义背景图路径(默认可以不设置,提供默认背景图)
    # path: /img/biubiubiu.gif
  # 右滑板块背景
  slider: 'linear-gradient(200deg,#a0cfe4,#e8c37e)'

# slider的设置
slider:
  # 是否默认展开tags板块
  showTags: false

# 智能菜单
# 如不需要,将该对应项置为false
# 比如
#smart_menu:
#  friends: false
smart_menu:
  innerArchive: '所有文章'
  friends: '友链'
  aboutme: '关于我'

# 友情链接
friends:
  Liu_Cabbage(我徒弟,多多支持):
    url: http://www.baocaige.top
    img: http://www.baocaige.top/favicon.ico
    description: 一叶浮萍归大海,人生何处不相逢(我徒弟,多多支持)
  技术笔记:
    url: https://zhousiwei.gitee.io/ibooks/
    img: https://zhousiwei.gitee.io/ibooks/favicon.ico
    description: 记录工作和学习过程中的笔记:Java、前端开发、Hexo博客、聚合支付、Linux笔记、ElasticSearch、ELK日志分析
  GitHub:
    url: https://github.com/JoeyBling
  码云:
    url: https://gitee.com/zhousiwei
  简书:
    url: https://www.jianshu.com/u/02cbf31a043a
  CSDN:
    url: https://blog.csdn.net/qq_30930805
  知乎:
    url: https://www.zhihu.com/people/joeybling
  微博:
    url: http://weibo.com/jayinfo
  燕十三:
    url: https://www.yanshisan.cn
    img: https://www.yanshisan.cn/logo.png
    description: 燕十三·一个人的江湖
  悠溯志的技术小站:
    url: https://www.yszh.ml/
    img: https://www.yszh.ml/favicon.ico
    description: 走自己的路,让别人说去吧。适合自己的才是最好的!

# 关于我
aboutme: 主要涉及技术:<br>Java后端开发、聚合支付、<br>公众号开发、开源爱好者、Linux<br><br>联系QQ:2434387555<br><br>很惭愧<br><br>只做了一点微小的工作<br>谢谢大家
ghost commented 3 years ago

如果pages部署中有warning或error github应该会发个邮件给你

JoeyBling commented 3 years ago

hexo的版本是多少,以及生成是不是有报错,主题代码是最新的吗?

Ioridy commented 3 years ago

hexo的版本是多少,以及生成是不是有报错,主题代码是最新的吗?

 hexo version
hexo: 3.9.0
hexo-cli: 4.2.0
os: Windows_NT 10.0.19042 win32 x64
node: 14.6.0
v8: 8.4.371.19-node.12
uv: 1.38.1
zlib: 1.2.11
brotli: 1.0.7
ares: 1.16.0
modules: 83
nghttp2: 1.41.0
napi: 6
llhttp: 2.0.4
openssl: 1.1.1g
cldr: 37.0
icu: 67.1
tz: 2020a
unicode: 13.0

主题代码是github上master分支最新代码

生成没有报错,且local server显示正常

JoeyBling commented 3 years ago

是哪个仓库的代码?demo代码吗?,你试试在本地生成后打开看是不是空白页面

Ioridy commented 3 years ago

是哪个仓库的代码?demo代码吗?,你试试在本地生成后打开看是不是空白页面

是demo仓库的代码, 本地是正常的,然后只修改了发布的配置,发布到我的github上

PS: github page是确认没有问题的(我自己用index.html单独测试过,可以正常显示)

JoeyBling commented 3 years ago

仓库源代码有吗?

Ioridy commented 3 years ago

仓库源代码有吗?

上传到仓库了:https://github.com/Ioridy/hexo-test.git

上传了我的发布配置以及生成的文件到仓库

JoeyBling commented 3 years ago

@Ioridy 你加下我吧,看代码是没问题的

Ioridy commented 3 years ago

问题已经解决。

问题原因: hexo版本过高,导致生成的index.html错误(空的),发布后不显示任何内容

解决办法: 降低hexo版本,目前我使用的hexo-cli 3.1.0

具体可参考: #33