E:\Hexo>hexo init blog INFO Cloning hexo-starter https://github.com/hexojs/hexo-starter.git [32mINFO [39m Install dependencies added 242 packages from 207 contributors in 105.871s 15 packages are looking for funding run `npm fund` for details INFO Start blogging with Hexo! E:\Hexo>
下面通过 cd 进入我的博客文件夹,
即输入 cd blog 后按回车,我会看到:
1 2
E:\Hexo>cd blog E:\Hexo\blog>
现在我就是处于 E:\Hexo\blog 文件夹下操作了,
现在在这个文件夹内默认安装所有 package.json 文件中提到的包,
即输入 npm install 然后回车,我会看到:
1 2 3 4 5 6 7 8
E:\Hexo\blog>npm install npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@2.3.2 (node_modules\fsevents): npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@2.3.2: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"}) audited 243 packages in 4.956s 15 packages are looking for funding run `npm fund` for details found 0 vulnerabilities E:\Hexo\blog>
E:\Hexo\blog>hexo g INFO Validating config INFO Start processing INFO Files loaded in 209 ms INFO Generated: archives/index.html INFO Generated: archives/2021/index.html INFO Generated: archives/2021/08/index.html (node:20772) Warning: Accessing non-existent property 'lineno' of module exports inside circular dependency (Use `node --trace-warnings ...` to show where the warning was created) (node:20772) Warning: Accessing non-existent property 'column' of module exports inside circular dependency (node:20772) Warning: Accessing non-existent property 'filename' of module exports inside circular dependency (node:20772) Warning: Accessing non-existent property 'lineno' of module exports inside circular dependency (node:20772) Warning: Accessing non-existent property 'column' of module exports inside circular dependency (node:20772) Warning: Accessing non-existent property 'filename' of module exports inside circular dependency INFO Generated: index.html INFO Generated: fancybox/jquery.fancybox.min.css INFO Generated: js/script.js INFO Generated: 2021/08/25/hello-world/index.html INFO Generated: css/style.css INFO Generated: css/fonts/fontawesome-webfont.woff2 INFO Generated: css/fonts/fontawesome-webfont.woff INFO Generated: fancybox/jquery.fancybox.min.js INFO Generated: css/fonts/fontawesome-webfont.ttf INFO Generated: css/fonts/FontAwesome.otf INFO Generated: css/fonts/fontawesome-webfont.eot INFO Generated: js/jquery-3.4.1.min.js INFO Generated: css/images/banner.jpg INFO Generated: css/fonts/fontawesome-webfont.svg INFO 17 files generated in 1.98 s E:\Hexo\blog>
此时我的文件夹目录下会出现 public 这个文件夹,里面存放的就是我的站点的静态文件。
8 与远程仓库建立关联
接下来我们将本地的仓库与此前在 GitHub 上建立的仓库建立关联。
输入 git init 初始化 Git 仓库,只需要执行一次即可,看到:
1 2
E:\Hexo\blog>git init Initialized empty Git repository in E:/Hexo/blog/.git/
E:\Hexo\blog>hexo deploy INFO Validating config INFO Deploying: git INFO Setting up Git deployment... Initialized empty Git repository in E:/Hexo/blog/.deploy_git/.git/ Author identity unknown *** Please tell me who you are. Run git config --global user.email "you@example.com" git config --global user.name "Your Name" to set your account's default identity. Omit --global to set the identity only in this repository. fatal: unable to auto-detect email address (got '10272@DESKTOP-N3PNS7C.(none)') FATAL { err: Error: Spawn failed at ChildProcess.<anonymous> (E:\Hexo\blog\node_modules\hexo-util\lib\spawn.js:51:21) at ChildProcess.emit (events.js:400:28) at ChildProcess.cp.emit (E:\Hexo\blog\node_modules\cross-spawn\lib\enoent.js:34:29) at Process.ChildProcess._handle.onexit (internal/child_process.js:277:12) { code: 128 } } Something's wrong. Maybe you can find the solution here: %s https://hexo.io/docs/troubleshooting.html E:\Hexo\blog>
E:\Hexo\blog>hexo deploy INFO Validating config INFO Deploying: git INFO Clearing .deploy_git folder... INFO Copying files from public folder... INFO Copying files from extend dirs... warning: LF will be replaced by CRLF in 2021/08/25/hello-world/index.html. The file will have its original line endings in your working directory warning: LF will be replaced by CRLF in archives/2021/08/index.html. The file will have its original line endings in your working directory warning: LF will be replaced by CRLF in archives/2021/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 css/fonts/fontawesome-webfont.svg. The file will have its original line endings in your working directory warning: LF will be replaced by CRLF in css/style.css. The file will have its original line endings in your working directory warning: LF will be replaced by CRLF in fancybox/jquery.fancybox.min.js. 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/jquery-3.4.1.min.js. The file will have its original line endings in your working directory warning: LF will be replaced by CRLF in js/script.js. The file will have its original line endings in your working directory [master (root-commit) a9fc5f8] Update Hexo Static Content 17 files changed, 5174 insertions(+) create mode 100644 2021/08/25/hello-world/index.html create mode 100644 archives/2021/08/index.html create mode 100644 archives/2021/index.html create mode 100644 archives/index.html create mode 100644 css/fonts/FontAwesome.otf create mode 100644 css/fonts/fontawesome-webfont.eot create mode 100644 css/fonts/fontawesome-webfont.svg create mode 100644 css/fonts/fontawesome-webfont.ttf create mode 100644 css/fonts/fontawesome-webfont.woff create mode 100644 css/fonts/fontawesome-webfont.woff2 create mode 100644 css/images/banner.jpg create mode 100644 css/style.css create mode 100644 fancybox/jquery.fancybox.min.css create mode 100644 fancybox/jquery.fancybox.min.js create mode 100644 index.html create mode 100644 js/jquery-3.4.1.min.js create mode 100644 js/script.js fatal: unable to access 'https://github.com/Barry-Flynn/blog/': OpenSSL SSL_read: Connection was reset, errno 10054 FATAL { err: Error: Spawn failed at ChildProcess.<anonymous> (E:\Hexo\blog\node_modules\hexo-util\lib\spawn.js:51:21) at ChildProcess.emit (events.js:400:28) at ChildProcess.cp.emit (E:\Hexo\blog\node_modules\cross-spawn\lib\enoent.js:34:29) at Process.ChildProcess._handle.onexit (internal/child_process.js:277:12) { code: 128 } } Something's wrong. Maybe you can find the solution here: %s https://hexo.io/docs/troubleshooting.html E:\Hexo\blog>
E:\Hexo\blog>hexo deploy INFO Validating config INFO Deploying: git INFO Clearing .deploy_git folder... INFO Copying files from public folder... INFO Copying files from extend dirs... warning: LF will be replaced by CRLF in 2021/08/25/hello-world/index.html. The file will have its original line endings in your working directory warning: LF will be replaced by CRLF in archives/2021/08/index.html. The file will have its original line endings in your working directory warning: LF will be replaced by CRLF in archives/2021/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 css/fonts/fontawesome-webfont.svg. The file will have its original line endings in your working directory warning: LF will be replaced by CRLF in css/style.css. The file will have its original line endings in your working directory warning: LF will be replaced by CRLF in fancybox/jquery.fancybox.min.js. 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/jquery-3.4.1.min.js. The file will have its original line endings in your working directory warning: LF will be replaced by CRLF in js/script.js. The file will have its original line endings in your working directory On branch master nothing to commit, working tree clean info: please complete authentication in your browser... Enumerating objects: 31, done. Counting objects: 100% (31/31), done. Delta compression using up to 4 threads Compressing objects: 100% (25/25), done. Writing objects: 100% (31/31), 882.21 KiB | 4.98 MiB/s, done. Total 31 (delta 3), reused 0 (delta 0), pack-reused 0 remote: Resolving deltas: 100% (3/3), done. To https://github.com/Barry-Flynn/blog + 4b62927...a9fc5f8 HEAD -> main (forced update) Branch 'master' set up to track remote branch 'main' from 'https://github.com/Barry-Flynn/blog'. [32mINFO [39m Deploy done: [35mgit[39m E:\Hexo\blog>