| title | Documentação |
|---|
Bem-vindo à documentação do Hexo. Se você encontrar algum problema ao usar o Hexo, dê uma olhada no guia de solução de problemas, abra uma issue no GitHub ou inicie um tópico no Google Group.
O Hexo é uma ferramenta simples, rápida e poderosa para criação blog. Você escreve postagens em Markdown (ou outras linguagens) e o Hexo gera arquivos estáticos com um lindo tema em segundos.
Demora apenas alguns minutos para configurar o Hexo. Se você encontrar um problema e não conseguir encontrar a solução aqui, por favor abra uma issue no GitHub e vamos tentar resolvê-lo.
{% youtube ARted4RniaU %}
Instalar o Hexo é bastante fácil. No entanto, você precisa ter algumas outras coisas instaladas primeiro:
Se o seu computador já possui estes, parabéns! You can skip to the Instalando Hexo step.
Caso contrário, siga as instruções a seguir para instalar todos os requisitos.
- Windows: Download e instalação do Git.
- Mac: Intalação com o Homebrew, MacPorts ou installer.
- Linux (Ubuntu, Debian):
sudo apt-get install git-core - Linux (Fedora, Red Hat, CentOS):
sudo yum install git-core
{% note warn Para usuários Mac %} Você pode encontrar alguns problemas ao compilar. Instale o Xcode da App Store primeiro. Depois que o Xcode estiver instalado, abra o Xcode e vá para Preferences -> Download -> Command Line Tools -> Install para instalar as ferramentas de linhas de comandos. {% endnote %}
Node.js provides official installer for most platforms.
Alternative installation methods:
- Windows: Install it with nvs (recommended) or nvm.
- Mac: Install it with Homebrew or MacPorts.
- Linux (DEB/RPM-based): Install it with NodeSource.
- Others: Install it through respective package manager. Refer to the guide provided by Node.js.
nvs is also recommended for Mac and Linux to avoid possible permission issue.
{% note info Windows %} If you use the official installer, make sure Add to PATH is checked (it's checked by default). {% endnote %}
{% note warn Mac / Linux %}
If you encounter EACCES permission error when trying to install Hexo, please follow the workaround provided by npmjs; overriding with root/sudo is highly discouraged.
{% endnote %}
{% note info Linux %}
If you installed Node.js using Snap, you may need to manually run npm install in the target folder when initializing a blog.
{% endnote %}
Uma vez que todos os requisitos estão instalados, você pode instalar o Hexo com npm:
$ npm install -g hexo-cliThe Hexo installed using the commands above is globally effective. If the installation is successful, executing the following command will display the version information.
$ hexo --version{% note info %}
For advanced users familiar with npm, you can opt for a local installation of the hexo package instead of a global one. This approach can help avoid potential permission issues associated with global installations. For example, you can clone an existing Hexo blog repository, and after installing dependencies, execute Hexo commands using npx hexo.
$ git clone https://github.com/hexojs/hexo-starter
$ cd hexo-starter
$ npm install
$ npx hexo --versionIf you choose a local installation of hexo, Linux users can add the node_modules directory in the Hexo directory to their PATH environment variable to directly use hexo <command>:
echo 'PATH="$PATH:./node_modules/.bin"' >> ~/.profile{% endnote %}
If you are stuck with older Node.js, you can consider installing a past version of Hexo.
Please note we do not provide bugfixes to past versions of Hexo.
We highly recommend to always install the latest version of Hexo and the recommended version of Node.js, whenever possible.
| Hexo version | Minimum (Node.js version) | Less than (Node.js version) |
|---|---|---|
| 7.0+ | 14.0.0 | latest |
| 6.2+ | 12.13.0 | latest |
| 6.0+ | 12.13.0 | 18.5.0 |
| 5.0+ | 10.13.0 | 12.0.0 |
| 4.1 - 4.2 | 8.10 | 10.0.0 |
| 4.0 | 8.6 | 8.10.0 |
| 3.3 - 3.9 | 6.9 | 8.0.0 |
| 3.2 - 3.3 | 0.12 | unknown |
| 3.0 - 3.1 | 0.10 or iojs | unknown |
| 0.0.1 - 2.8 | 0.10 | unknown |