Você pode modificar as configurações do site em _config.yml ou em um arquivo de configuração alternativo.
Site
| Configuração | Descrição |
|---|---|
title |
O título do seu site |
subtitle |
O subtítulo do seu site |
description |
A descrição do seu site |
keywords |
The keywords of your website. Supports multiple values. |
author |
Seu nome |
language |
O idioma do seu site. Use a 2-lettter ISO-639-1 code. O padrão é en. |
timezone |
O fuso horário do seu site. O Hexo usa a configuração do seu computador por padrão. Você pode encontrar a lista de fusos horários disponíveis aqui. Alguns exemplos são America/New_York, Japan e UTC. |
URL
| Configuração | Descrição | Padrão |
|---|---|---|
url |
A URL do seu site, must starts with http:// or https:// |
|
root |
O diretório raiz do seu site | url's pathname |
permalink |
O formato de permalink dos artigos | :year/:month/:day/:title/ |
permalink_defaults |
Valores padrão de cada segmento no permalink | |
pretty_urls |
Rewrite the permalink variables to pretty URLs |
|
pretty_urls.trailing_index |
Trailing index.html, set to false to remove it |
true |
pretty_urls.trailing_html |
Trailing .html, set to false to remove it (does not apply to trailing index.html) |
true |
Site em subdiretórioSe o seu site estiver em um subdiretório (como por exemplo
http://example.org/blog) definaurlparahttp://example.org/bloge definarootpara/blog/.
Transformar títulos em maiúsculo?
# e.g. page.permalink is http://example.com/foo/bar/index.html |
Diretório
| Configuração | Descrição | Padrão |
|---|---|---|
source_dir |
Diretório dos fonte. Onde seu conteúdo está armazenado | source |
public_dir |
Diretório dos arquivos públicos. Onde o site estático será gerado | public |
tag_dir |
Diretório de tags | tags |
archive_dir |
Diretório de archives | archives |
category_dir |
Diretório de categorias | categories |
code_dir |
Diretório de código (subdiretório de source_dir) |
downloads/code |
i18n_dir |
Diretório de internacionalização (i18n) | :lang |
skip_render |
Caminhos que não devem ser renderizados. Você pode usar expressões globais para fazer correspondência de caminho |
O Hexo irá ignorar os arquivos e diretórios listados abaixo deste campo
skip_render: "mypage/**/*" |
Escrita
| Configuração | Descrição | Padrão |
|---|---|---|
new_post_name |
O formato do nome do arquivo para novas postagens | :title.md |
default_layout |
Layout padrão | post |
titlecase |
Transform titles into title case? | false |
external_link |
Abrir links externos em uma nova aba? | |
external_link.enable |
Abrir links externos em uma nova aba? | true |
external_link.field |
Applies to the whole site or post only |
site |
external_link.exclude |
Exclude hostname. Specify subdomain when applicable, including www |
[] |
filename_case |
Converter nomes de arquivos para minúsculos 1; maiúsculos 2 |
0 |
render_drafts |
Display drafts? | false |
post_asset_folder |
Ativar o diretório de Asset? | false |
relative_link |
Links para o diretório raiz? | false |
future |
Exibir postagens futuras? | true |
syntax_highlighter |
Configurações de bloco de código, see Highlight.js section for usage guide | highlight.js |
highlight |
Configurações de bloco de código, see PrismJS section for usage guide | |
prismjs |
Code block syntax highlight settings, see PrismJS section for usage guide |
Home page setting
| Configuração | Descrição | Padrão |
|---|---|---|
index_generator |
Generate an archive of posts, powered by hexo-generator-index | |
index_generator.path |
Root path for your blog’s index page | '' |
index_generator.per_page |
Posts displayed per page. | 10 |
index_generator.order_by |
Posts order. Order by descending date (new to old) by default. | -date |
Diretório de paginação |
URL format, see Pagination setting below | page |
Categoria & Tag
| Configuração | Descrição | Padrão |
|---|---|---|
default_category |
Mapa de Categoria | uncategorized |
category_map |
Override category slugs | |
tag_map |
Override tag slugs |
Exibir rascunhos?
category_map: |
Formato de Data / Hora
Hexo usa Moment.js para processar datas.
| Configuração | Descrição | Padrão |
|---|---|---|
date_format |
Formato de data | YYYY-MM-DD |
time_format |
Formado de hora | HH:mm:ss |
updated_option |
The updated value to used when not provided in the front-matter |
mtime |
updated_option
updated_optioncontrols theupdatedvalue when not provided in the front-matter:
mtime: Use file modification date asupdated. It is the default behavior of Hexo since 3.0.0date: Usedateasupdated. Typically used with Git workflow when file modification date could be different.empty: Simply dropupdatedwhen not provided. May not be compatible with most themes and plugins.
use_date_for_updatedis deprecated and will be removed in next major version. Please useupdated_option: 'date'instead.
Paginação
| Configuração | Descrição | Categoria padrão |
|---|---|---|
per_page |
A quantidade de postagens exibidas em uma única página. 0 desabilita paginação |
10 |
pagination_dir |
URL format | page |
Mapa de Tag
pagination_dir: 'page' |
Extensões
| Configuração | Descrição |
|---|---|
theme |
Nome do tema. false desabilita o tema |
theme_config |
Configuração do tema. Inclui quaisquer configurações de tema personalizado sob esta chave para substituir os padrões do tema. |
deploy |
Configurações de implantação |
meta_generator |
Meta generator tag. false disables injection of the tag. |
Incluir/Excluir Arquivos ou Diretórios
Use the following options to explicitly process or ignore certain files/folders. Support glob expressions for path matching.
include and exclude options only apply to the source/ folder, whereas ignore option applies to all folders.
| Por padrão, o Hexo ignora os arquivos e diretórios ocultos, mas configurar este campo fará com que o Hexo os processe também | Description |
|---|---|
include |
Include hidden files (including files/folders with a name that starts with an underscore, with an exception*) |
exclude |
No arquivo de configuração, defina a chave de include/exclude para que o hexo processe ou ignore, explicitamente, determinados arquivos/diretórios. |
ignore |
Ignore files/folders |
Exemplo:
# Incluir/Excluir Arquivos/Diretórios |
Each value in the list must be enclosed with single/double quotes.
include: and exclude: do not apply to the themes/ folder. Either use ignore: or alternatively, prepend an underscore to the file/folder name to exclude.
* Notable exception is the source/_posts folder, but any file or folder with a name that starts with an underscore under that folder would still be ignored. Using include: rule in that folder is not recommended.
Using an Alternate Config
A custom config file path can be specified by adding the --config flag to your hexo commands with a path to an alternate YAML or JSON config file, or a comma-separated list (no spaces) of multiple YAML or JSON files.
# use 'custom.yml' in place of '_config.yml' |
Using multiple files combines all the config files and saves the merged settings to _multiconfig.yml. The later values take precedence. It works with any number of JSON and YAML files with arbitrarily deep objects. Note that no spaces are allowed in the list.
For instance, in the above example if foo: bar is in custom.yml, but "foo": "dinosaur" is in custom2.json, _multiconfig.yml will contain foo: dinosaur.
Alternate Theme Config
Hexo themes are independent projects, with separate _config.yml files.
Instead of forking a theme, and maintaining a custom branch with your settings, you can configure it from somewhere else.
theme_config in site’s primary configuration file
Supported since Hexo 2.8.2
# _config.yml |
# themes/my-theme/_config.yml |
Resulting in theme configuration:
{ |
dedicated _config.[theme].yml file
Supported since Hexo 5.0.0
The file should be placed in your site folder, both yml and json are supported. theme inside _config.yml must be configured for Hexo to read _config.[theme].yml
# _config.yml |
# _config.my-theme.yml |
# themes/my-theme/_config.yml |
Resulting in theme configuration:
{ |
We strongly recommends you to store your theme configuration in one place. But in case you have to store your theme configuration separately, those information is quite important: The
theme_configinside site’s primary configuration file has the highest priority during merging, then the dedicated theme configuration file. the_config.ymlfile under the theme directory has the lowest priority.