Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

有关博客传到github css js 404的问题 解决方案!!! #1220

Closed
imkratos opened this issue Nov 4, 2016 · 22 comments
Closed

有关博客传到github css js 404的问题 解决方案!!! #1220

imkratos opened this issue Nov 4, 2016 · 22 comments

Comments

@imkratos
Copy link

imkratos commented Nov 4, 2016

Thanks for reaching out! We recently updated to Jekyll v3.3, which ignores the vendor folder by default. If you're not using Jekyll, you can add a .nojekyll file to the root of your repository to disable Jekyll from building your site. Once you do that, your site should build with your vendor folder.

各位,这是我给github官方邮件,他们的回复,就是在根目录下加一个.nojekyll 资源就可以访问了。
但是如果.nojekyll加在source文件夹内,不会被hexo 生成出来,不知道各位谁有解决办法?

@imkratos imkratos changed the title 有关博客传到github css jss 404的问题 解决方案!!! 有关博客传到github css js 404的问题 解决方案!!! Nov 4, 2016
@monsterLin
Copy link

那你就放到public 文件夹下试试

@imkratos imkratos closed this as completed Nov 4, 2016
@imkratos imkratos reopened this Nov 4, 2016
@BBBOND
Copy link

BBBOND commented Nov 4, 2016

我试过了 但是发现.nojekyll没有被push上来@monsterLin

@imkratos
Copy link
Author

imkratos commented Nov 4, 2016

@BBBOND 所以我现在暂时的解决方案是手动在github上加。。。hexo d 之后,手动在github页面创建

我还没时间去研究一下源码,不知道各位谁知道呢,哈哈哈。

@BBBOND
Copy link

BBBOND commented Nov 4, 2016

我在public 和 .deploy_git 里都加上了.nojekyll 然后 deploy 就可以了@imkratos

@imkratos
Copy link
Author

imkratos commented Nov 4, 2016

@BBBOND 恩,我明白了,因为. deploy_git 里的东西是要往git上push的,所以添加了.nojekyll之后,hexo程序并不会处理,但是会提交上来,哈哈。多谢。

@guoyiang
Copy link

guoyiang commented Nov 5, 2016

可以在source目录里加入.nojekyll文件,然后更改Hexo_config.yml加入以下配置:

include:
  - .nojekyll

这样在hexo -g的时候就会包含.nojekyll文件了

@linkcd
Copy link

linkcd commented Nov 7, 2016

@guoyiang 这样的确可以保证public文件夹里面有.nojekyll文件, 但是最后在git_deploy文件夹里面,这个文件还是没有被拷贝过去。我还在找解决方法

@imkratos
Copy link
Author

imkratos commented Nov 7, 2016

@linkcd 现在最简单的办法是更新一下主题 next的代码,源码已经改名了,改成lib目录了,如果更新代码不方便的话,我现在的做法是把这个文件加在.develop_git目录里,现在是可以用的。

@MisterZhai
Copy link

在.deploy_git 里加上了.nojekyll 后,就可以上传上去了,我的现在可以了

@yuqirong
Copy link

yuqirong commented Nov 7, 2016

请问 .nojekyll 文件里面要写什么东西吗?还是一个空文件?

@imkratos
Copy link
Author

imkratos commented Nov 8, 2016

@yuqirong 空文件就可以。

@monster-wang-aws
Copy link

不得不说这个真是太坑了 我还以为我自己配置哪里出了问题 折腾了大半天 deploy 几十次最后只好换 landsacpe 了_(:з」∠)_ 现在再试试看

@zedxpp
Copy link

zedxpp commented Nov 8, 2016

@imkratos 请教一下如何更新next主题的代码? 更新后, 原来的配置和数据是否会丢失?

@imkratos
Copy link
Author

imkratos commented Nov 8, 2016

@simlecp 这个就是git的基本使用问题啊,如果你改了和源码里有冲突的话,是更新不下来的,git会提示让你提交你的修改,然后再更新。

@zedxpp
Copy link

zedxpp commented Nov 8, 2016

@imkratos 直接更新了代码 已经弄好了. 忘记当时是怎么安装主题了 所以才问的怎么更新主题代码. ^-^

@kaito-kidd
Copy link

在.deploy_git里加上.nojekyll,部署是有效的。

@cpudream
Copy link

我加进去也不行,怎么回事了,有点懵逼了

@fgcui1204
Copy link

同问,加进去了也不行。

@imkratos
Copy link
Author

@cpudream @fgcui1204 能提供更详细的信息吗,你们查看下github 分支上 那个文件在根目录了吗

@fgcui1204
Copy link

@imkratos 已找到解决方案,根据 #1214

@ivan-nginx
Copy link
Collaborator

@imkratos dont understand u, write in English if not solved. If solved, close it please. Thank's!

@segmafrontend
Copy link

我的情况是这样:
问题:本地预览正常,部署到github,无法显示头像、图标等,打开控制台显示加载lib目录下的文件404
分析:public下的lib目录和next/source下的lib目录内容一致,next目录指向另一个git,且next目录下的.gitignore文件下设置了对next/source/lib目录下一些文件的忽略导致未上传到github
解决:删除next目录下的.git文件夹,删除next目录下.gitignore里面和next/source/lib有关的部分
有关hexo的安装、自动打包部署、评论插件,欢迎来我的博客交流,西格马技术分享

yan12125 pushed a commit to yan12125/yan12125.github.io that referenced this issue Sep 22, 2019
* Remove Hinet-specific stuffs, including the email address and the
  guestbook counter.
* Change absolute URLs to relative
* Add a link to the backup
* Disable Jekyll so that files in _themes are just copied [1].

[1] iissnan/hexo-theme-next#1220
yan12125 pushed a commit to yan12125/yan12125.github.io that referenced this issue Sep 22, 2019
* Remove Hinet-specific stuffs, including the email address and the
  guestbook counter.
* Change absolute URLs to relative
* Add a link to the backup
* Disable Jekyll so that files in _themes are just copied [1].

[1] iissnan/hexo-theme-next#1220
snowyu pushed a commit to snowyu/hexo-theme-next that referenced this issue Nov 23, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests