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

Comments

@imkratos
Copy link

@imkratos 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

This comment has been minimized.

Copy link

@monsterLin monsterLin commented Nov 4, 2016

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

@imkratos imkratos closed this Nov 4, 2016
@imkratos imkratos reopened this Nov 4, 2016
@BBBOND

This comment has been minimized.

Copy link

@BBBOND BBBOND commented Nov 4, 2016

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

@imkratos

This comment has been minimized.

Copy link
Author

@imkratos imkratos commented Nov 4, 2016

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

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

@BBBOND

This comment has been minimized.

Copy link

@BBBOND BBBOND commented Nov 4, 2016

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

@imkratos

This comment has been minimized.

Copy link
Author

@imkratos imkratos commented Nov 4, 2016

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

@guoyiang

This comment has been minimized.

Copy link

@guoyiang guoyiang commented Nov 5, 2016

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

include:
  - .nojekyll

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

@linkcd

This comment has been minimized.

Copy link

@linkcd linkcd commented Nov 7, 2016

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

@imkratos

This comment has been minimized.

Copy link
Author

@imkratos imkratos commented Nov 7, 2016

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

@MisterZhai

This comment has been minimized.

Copy link

@MisterZhai MisterZhai commented Nov 7, 2016

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

@yuqirong

This comment has been minimized.

Copy link

@yuqirong yuqirong commented Nov 7, 2016

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

@imkratos

This comment has been minimized.

Copy link
Author

@imkratos imkratos commented Nov 8, 2016

@yuqirong 空文件就可以。

@monster-wang-aws

This comment has been minimized.

Copy link

@monster-wang-aws monster-wang-aws commented Nov 8, 2016

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

@zedxpp

This comment has been minimized.

Copy link

@zedxpp zedxpp commented Nov 8, 2016

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

@imkratos

This comment has been minimized.

Copy link
Author

@imkratos imkratos commented Nov 8, 2016

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

@zedxpp

This comment has been minimized.

Copy link

@zedxpp zedxpp commented Nov 8, 2016

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

@kaito-kidd

This comment has been minimized.

Copy link

@kaito-kidd kaito-kidd commented Nov 10, 2016

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

@CPUdream

This comment has been minimized.

Copy link

@CPUdream CPUdream commented Nov 12, 2016

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

@fgcui1204

This comment has been minimized.

Copy link

@fgcui1204 fgcui1204 commented Nov 13, 2016

同问,加进去了也不行。

@imkratos

This comment has been minimized.

Copy link
Author

@imkratos imkratos commented Nov 13, 2016

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

@fgcui1204

This comment has been minimized.

Copy link

@fgcui1204 fgcui1204 commented Nov 13, 2016

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

@ivan-nginx

This comment has been minimized.

Copy link
Collaborator

@ivan-nginx ivan-nginx commented Jul 20, 2017

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

@segmafrontend

This comment has been minimized.

Copy link

@segmafrontend segmafrontend commented Sep 14, 2018

我的情况是这样:
问题:本地预览正常,部署到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 added 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 added 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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
You can’t perform that action at this time.