_config.yml
파일의 사이트 환경 설정을 수정할 수 있습니다.
Site
Setting | Description |
---|---|
title |
웹 사이트의 제목 |
subtitle |
The subtitle of your website |
description |
웹 사이트에 대한 설명 |
keywords |
The keywords of your website. Supports multiple values. |
author |
작성자 이름 |
language |
웹 사이트의 주 사용언어. 2-lettter ISO-639-1 code 참조. 기본값은 en . |
timezone |
웹 사이트에서 사용하는 timezone. Hexo는 기본적으로 PC의 시간값을 사용합니다. 사용 가능한 timezone의 종류는 여기에서 확인할 수 있습니다. America/New_York , Japan , UTC . |
URL
Setting | Description | 기본값 |
---|---|---|
url |
웹 사이트의 URL, must starts with http:// or https:// |
|
root |
웹 사이트의 루트 디렉토리 | url's pathname |
permalink |
게시글의 permalink 형식 | :year/:month/:day/:title/ |
permalink_defaults |
Permalink 각 부분(segment)의 기본값 | |
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 |
Website in subdirectory당신의 웹 사이트가
http://example.org/blog
와 같이 서브디렉토리에 있다면url
은http://example.org/blog
고 설정하고root
는/blog/
로 설정하세요.
Examples:
# e.g. page.permalink is http://example.com/foo/bar/index.html |
Directory
Setting | Description | 기본값 |
---|---|---|
source_dir |
컨텐츠들이 저장되어 있는 소스 폴더 Where your content is stored | source |
public_dir |
Public folder. 생성된 정적 사이트들이 저장될 공용 폴더 | public |
tag_dir |
태그 디렉토리 | tags |
archive_dir |
저장소 디렉토리 | archives |
category_dir |
카테고리 디렉토리 | categories |
code_dir |
Include code directory (subdirectory of source_dir ) |
downloads/code |
i18n_dir |
i18n 디렉토리 | :lang |
skip_render |
렌더링하지 않을 경로. 경로 매칭을 위해 glob expressions를 사용할 수 있습니다. |
Examples:
skip_render: "mypage/**/*" |
Writing
Setting | Description | 기본값 |
---|---|---|
new_post_name |
새 포스트의 파일명 형식 | :title.md |
default_layout |
기본 레이아웃 | post |
titlecase |
Transform titles into title case? | false |
external_link |
외부 링크를 새 탭에서 열 것인지 선택 | |
external_link.enable |
외부 링크를 새 탭에서 열 것인지 선택 | 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 |
파일명을 소문자(1 ) 또는 대문자(2 )로 변경 |
0 |
render_drafts |
Display drafts? | false |
post_asset_folder |
Asset 폴더를 활성화 할 것인지 선택 | false |
relative_link |
루트 폴더에 대한 상대 경로로 링크를 만들 것인지 선택 | false |
future |
미래의 포스트를 표시할 것인지 선택 | true |
syntax_highlighter |
Code block의 설정, see Highlight.js section for usage guide | highlight.js |
highlight |
Code block의 설정, see PrismJS section for usage guide | |
prismjs |
Code block syntax highlight settings, see PrismJS section for usage guide |
Home page setting
Setting | Description | 기본값 |
---|---|---|
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 |
index_generator.pagination_dir |
URL format, see Pagination setting below | page |
Category & Tag
Setting | Description | 기본값 |
---|---|---|
default_category |
기본 분류 | uncategorized |
category_map |
Override category slugs | |
tag_map |
Override tag slugs |
Examples:
category_map: |
Date / Time format
Hexo는 날짜 처리 시 Moment.js를 사용합니다.
Setting | Description | 기본값 |
---|---|---|
date_format |
날짜 형식 | YYYY-MM-DD |
time_format |
시간 형식 | HH:mm:ss |
updated_option |
The [updated ](/ko/docs/variables#페이지 변수) value to used when not provided in the front-matter |
mtime |
updated_option
updated_option
controls theupdated
value when not provided in the front-matter:
mtime
: Use file modification date asupdated
. It is the default behavior of Hexo since 3.0.0date
: Usedate
asupdated
. Typically used with Git workflow when file modification date could be different.empty
: Simply dropupdated
when not provided. May not be compatible with most themes and plugins.
use_date_for_updated
is deprecated and will be removed in next major version. Please useupdated_option: 'date'
instead.
Pagination
Setting | Description | 설정 |
---|---|---|
per_page |
하나의 페이지에 표시할 포스트의 개수. 0 이면 pagination을 표시하지 않습니다. |
10 |
pagination_dir |
URL format | page |
Examples:
pagination_dir: 'page' |
Extensions
Setting | Description |
---|---|
theme |
테마명. false 라면 테마를 끕니다. |
theme_config |
Theme configuration. Include any custom theme settings under this key to override theme defaults. |
deploy |
Deployment 설정 |
meta_generator |
Meta generator tag. false disables injection of the tag. |
Include/Exclude Files or Folders
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.
Setting | Description |
---|---|
include |
Include hidden files (including files/folders with a name that start with an underscore, with an exception*) |
exclude |
Exclude files/folders |
ignore |
Ignore files/folders |
Examples:
# Include/Exclude Files/Folders |
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_config
inside site’s primary configuration file has the highest priority during merging, then the dedicated theme configuration file. the_config.yml
file under the theme directory has the lowest priority.