多電腦同步hexo的問題

发布于 2022-09-04 20:22:37 字数 10118 浏览 10 评论 0

我有一臺筆記本用來寫博客,但是想在公司的電腦上也可以發佈博客,但是現在的問題是,公司的電腦衹要運行:

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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

晨曦慕雪 2022-09-11 20:22:38

最近也在玩这个静态博客,你这个问题虽然很久以前了,但是我还是回答一下,可能还会有人看到呢。

先说一说这个Hexo的工作原理:

Hexo部署到GithubPages的原理是将本地的~/your-blog/public文件夹的内容通过git上传到仓库。

当在仓库开启GithubPages的功能后,当yourname.github.io被访问时,GitHub就会引发一个hooks,把仓库的文件拉取到网页空间里。

所以可以明显感觉到部署后第一次访问会很慢。

接下来说你的问题:

根据原理,你git下来的只是基本的网页文件,是Hexo生成后产生的,所以自然是能够预览的,但是怎么能够编辑呢?

然后你尝试生成、部署就会把public清空然后把空文件git到GitHub,所以访问就404了,因为的确是什么都没有~

围归者 2022-09-11 20:22:38

有没有给这台用户一个ssh,
然后去github setting上去看key -ssh,复制上去

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文