多電腦同步hexo的問題
我有一臺筆記本用來寫博客,但是想在公司的電腦上也可以發佈博客,但是現在的問題是,公司的電腦衹要運行:
hexo d -g
博客就會顯示404.然後再用筆記本發佈才能回復。
這是我運行上面代碼之後顯示的
INFO Start processing
INFO Files loaded in 582 ms
INFO Generated: index.html
INFO Generated: 2017/04/18/人类简史/index.html
INFO 2 files generated in 607 ms
INFO Deploying: git
INFO Clearing .deploy_git folder...
INFO Copying files from public folder...
warning: LF will be replaced by CRLF in 2017/04/03/gulp使用小记/index.html.
The file will have its original line endings in your working directory.
warning: LF will be replaced by CRLF in 2017/04/03/博客建站过程记录/index.html.
The file will have its original line endings in your working directory.
warning: LF will be replaced by CRLF in 2017/04/18/人类简史/index.html.
The file will have its original line endings in your working directory.
warning: LF will be replaced by CRLF in 2017/04/21/多电脑同步hexo/index.html.
The file will have its original line endings in your working directory.
warning: LF will be replaced by CRLF in about/index.html.
The file will have its original line endings in your working directory.
warning: LF will be replaced by CRLF in archives/2017/04/index.html.
The file will have its original line endings in your working directory.
warning: LF will be replaced by CRLF in archives/2017/index.html.
The file will have its original line endings in your working directory.
warning: LF will be replaced by CRLF in archives/index.html.
The file will have its original line endings in your working directory.
warning: LF will be replaced by CRLF in categories/Git/index.html.
The file will have its original line endings in your working directory.
warning: LF will be replaced by CRLF in categories/index.html.
The file will have its original line endings in your working directory.
warning: LF will be replaced by CRLF in categories/前端/index.html.
The file will have its original line endings in your working directory.
warning: LF will be replaced by CRLF in css/main.css.
The file will have its original line endings in your working directory.
warning: LF will be replaced by CRLF in images/algolia_logo.svg.
The file will have its original line endings in your working directory.
warning: LF will be replaced by CRLF in images/cc-by-nc-nd.svg.
The file will have its original line endings in your working directory.
warning: LF will be replaced by CRLF in images/cc-by-nc-sa.svg.
The file will have its original line endings in your working directory.
warning: LF will be replaced by CRLF in images/cc-by-nc.svg.
The file will have its original line endings in your working directory.
warning: LF will be replaced by CRLF in images/cc-by-nd.svg.
The file will have its original line endings in your working directory.
warning: LF will be replaced by CRLF in images/cc-by-sa.svg.
The file will have its original line endings in your working directory.
warning: LF will be replaced by CRLF in images/cc-by.svg.
The file will have its original line endings in your working directory.
warning: LF will be replaced by CRLF in images/cc-zero.svg.
The file will have its original line endings in your working directory.
warning: LF will be replaced by CRLF in images/quote-l.svg.
The file will have its original line endings in your working directory.
warning: LF will be replaced by CRLF in images/quote-r.svg.
The file will have its original line endings in your working directory.
warning: LF will be replaced by CRLF in index.html.
The file will have its original line endings in your working directory.
warning: LF will be replaced by CRLF in js/src/affix.js.
The file will have its original line endings in your working directory.
warning: LF will be replaced by CRLF in js/src/algolia-search.js.
The file will have its original line endings in your working directory.
warning: LF will be replaced by CRLF in js/src/bootstrap.js.
The file will have its original line endings in your working directory.
warning: LF will be replaced by CRLF in js/src/exturl.js.
The file will have its original line endings in your working directory.
warning: LF will be replaced by CRLF in js/src/hook-duoshuo.js.
The file will have its original line endings in your working directory.
warning: LF will be replaced by CRLF in js/src/motion.js.
The file will have its original line endings in your working directory.
warning: LF will be replaced by CRLF in js/src/post-details.js.
The file will have its original line endings in your working directory.
warning: LF will be replaced by CRLF in js/src/schemes/pisces.js.
The file will have its original line endings in your working directory.
warning: LF will be replaced by CRLF in js/src/scrollspy.js.
The file will have its original line endings in your working directory.
warning: LF will be replaced by CRLF in js/src/utils.js.
The file will have its original line endings in your working directory.
warning: LF will be replaced by CRLF in lib/algolia-instant-search/instantsearch.min.js.
The file will have its original line endings in your working directory.
warning: LF will be replaced by CRLF in lib/fancybox/source/helpers/jquery.fancybox-buttons.css.
The file will have its original line endings in your working directory.
warning: LF will be replaced by CRLF in lib/fancybox/source/helpers/jquery.fancybox-buttons.js.
The file will have its original line endings in your working directory.
warning: LF will be replaced by CRLF in lib/fancybox/source/helpers/jquery.fancybox-media.js.
The file will have its original line endings in your working directory.
warning: LF will be replaced by CRLF in lib/fancybox/source/helpers/jquery.fancybox-thumbs.css.
The file will have its original line endings in your working directory.
warning: LF will be replaced by CRLF in lib/fancybox/source/helpers/jquery.fancybox-thumbs.js.
The file will have its original line endings in your working directory.
warning: LF will be replaced by CRLF in lib/fancybox/source/jquery.fancybox.css.
The file will have its original line endings in your working directory.
warning: LF will be replaced by CRLF in lib/fancybox/source/jquery.fancybox.js.
The file will have its original line endings in your working directory.
warning: LF will be replaced by CRLF in lib/fancybox/source/jquery.fancybox.pack.js.
The file will have its original line endings in your working directory.
warning: LF will be replaced by CRLF in lib/fastclick/LICENSE.
The file will have its original line endings in your working directory.
warning: LF will be replaced by CRLF in lib/fastclick/README.html.
The file will have its original line endings in your working directory.
warning: LF will be replaced by CRLF in lib/fastclick/lib/fastclick.js.
The file will have its original line endings in your working directory.
warning: LF will be replaced by CRLF in lib/font-awesome/HELP-US-OUT.txt.
The file will have its original line endings in your working directory.
warning: LF will be replaced by CRLF in lib/font-awesome/css/font-awesome.css.
The file will have its original line endings in your working directory.
warning: LF will be replaced by CRLF in lib/font-awesome/css/font-awesome.css.map.
The file will have its original line endings in your working directory.
warning: LF will be replaced by CRLF in lib/font-awesome/css/font-awesome.min.css.
The file will have its original line endings in your working directory.
warning: LF will be replaced by CRLF in lib/font-awesome/fonts/fontawesome-webfont.svg.
The file will have its original line endings in your working directory.
warning: LF will be replaced by CRLF in lib/jquery/index.js.
The file will have its original line endings in your working directory.
warning: LF will be replaced by CRLF in lib/jquery_lazyload/CONTRIBUTING.html.
The file will have its original line endings in your working directory.
warning: LF will be replaced by CRLF in lib/jquery_lazyload/README.html.
The file will have its original line endings in your working directory.
warning: LF will be replaced by CRLF in lib/jquery_lazyload/jquery.lazyload.js.
The file will have its original line endings in your working directory.
warning: LF will be replaced by CRLF in lib/jquery_lazyload/jquery.scrollstop.js.
The file will have its original line endings in your working directory.
warning: LF will be replaced by CRLF in lib/three/three-waves.min.js.
The file will have its original line endings in your working directory.
warning: LF will be replaced by CRLF in lib/three/three.min.js.
The file will have its original line endings in your working directory.
warning: LF will be replaced by CRLF in lib/ua-parser-js/dist/ua-parser.min.js.
The file will have its original line endings in your working directory.
warning: LF will be replaced by CRLF in lib/ua-parser-js/dist/ua-parser.pack.js.
The file will have its original line endings in your working directory.
warning: LF will be replaced by CRLF in lib/velocity/velocity.js.
The file will have its original line endings in your working directory.
warning: LF will be replaced by CRLF in lib/velocity/velocity.min.js.
The file will have its original line endings in your working directory.
warning: LF will be replaced by CRLF in lib/velocity/velocity.ui.js.
The file will have its original line endings in your working directory.
warning: LF will be replaced by CRLF in lib/velocity/velocity.ui.min.js.
The file will have its original line endings in your working directory.
warning: LF will be replaced by CRLF in tags/index.html.
The file will have its original line endings in your working directory.
[master 1740b9c] Site updated: 2017-04-21 15:22:53
2 files changed, 8 insertions(+), 3 deletions(-)
Warning: Permanently added 'github.com,192.30.255.113' (RSA) to the list of known hosts.
Branch master set up to track remote branch master from git@github.com:JaneSu/JaneSu.github.io.
To github.com:JaneSu/JaneSu.github.io
+ 0f96793...1740b9c HEAD -> master (forced update)
INFO Deploy done: git
公司電腦首先做的是克隆遠程庫,然後運行
// 在该文件内创建hexo
npm install hexo
// 安装依赖库
npm install
// 安装部署相关配置
npm install hexo-deployer-git
在本地預覽是沒有問題的,但是就是不能發佈,這是什麽原因??
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
最近也在玩这个静态博客,你这个问题虽然很久以前了,但是我还是回答一下,可能还会有人看到呢。
先说一说这个Hexo的工作原理:
Hexo部署到GithubPages的原理是将本地的
~/your-blog/public
文件夹的内容通过git上传到仓库。当在仓库开启GithubPages的功能后,当
yourname.github.io
被访问时,GitHub就会引发一个hooks
,把仓库的文件拉取到网页空间里。所以可以明显感觉到部署后第一次访问会很慢。
接下来说你的问题:
根据原理,你
git
下来的只是基本的网页文件,是Hexo生成后产生的,所以自然是能够预览的,但是怎么能够编辑呢?然后你尝试生成、部署就会把
public
清空然后把空文件git
到GitHub,所以访问就404了,因为的确是什么都没有~有没有给这台用户一个ssh,
然后去github setting上去看key -ssh,复制上去