Error record of github hexo building blog



 1. Error spawn git ENOENT

    Without cmd, git bash will not report errors. If you have to use cmd, I heard that you only need to configure the environment variables of git, but I have only used the former, because the former is simpler, why should I do one more step?

 

2. After running the hexo server command, view it in the browser, and Chinese garbled characters appear

    Re-save the config .yml and save it as utf-8 encoding, overwriting the original file

 

3.fatal: Not a git repository (or any of the parent directories): .git

     Delete the folder in the root directory: .deploy_git and re-deploy it.

 

4.FATAL:permission denied(publickey)

fatal: could not read from remote repository

please make sure you have the correct access rights.....................

 

    This error usually means not creating SSH or forgetting to add the SSH key to github, but this is impossible, because my git has always been useful, uploading code every day is correct, just tried git and it still works Safely upload the code, and also check that there is an SSH key

    So, I'm assuming it's a problem with that plugin, which doesn't judge my access rights.

    So assuming my guess is correct, what should I do? Write a plugin yourself? I don't have this ability yet, but I think as long as I figure out what the plugin does, maybe I can find a way.

    So I found that the hexo-deployer-git plugin is just for the convenience of users to update static files to github.

    Why do you say this?

     hexo clean  is to clear the public directory

     hexo g ( can also write generate) is to regenerate the public directory, which contains the static files of the website

    hexo d (can also write deploy) is deployment, this command does a lot of things:

     1. Copy the public directory to a new directory called .deploy_git. In fact, this new directory is equivalent to github corresponding to the local warehouse.

     2. Uploaded static files to github ( if we use git, we need multiple commands, including init, add, commit, push, etc.)

 

     Well, after figuring out the function of the plug-in, it is easy to handle. Since the plug-in cannot be used ( that is, the hexo deploy command does not work ), I will upload it manually with git, so I clone the original warehouse, and then Copy all the static files of public to the cloned repository, then upload them slowly with git, and you're done!

 

5. The style file does not work, and the website is in a mess after opening, which is very ugly

     This is because the css file cannot be loaded. There are two parameters that may affect this when configuring _config.yml.

     That is url and root.

     I configured it like this:

         url: https://www.yuzhyun.me/
         root: /

     I used the domain name I bought myself. When I started the configuration, I filled in the domain name provided by github. There was always a problem that CSS could not be loaded. I guess it was something wrong in the root. Hope someone guides one or two.

 

Let's see the results, it's alright!
 

 

    

 

 

 

 

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=326169989&siteId=291194637