3 분 소요

기본 설정

Site Settings (사이트 설정)

  • title: 사이트 제목
  • description: 사이트 설명
  • url: 사이트의 기본 URL
  • baseurl: 사이트의 기본 경로 (예: /blog)
    title: My Blog
    description: A blog about Jekyll and Liquid
    url: "https://myblog.github.io"
    baseurl: ""
    

Build Settings (빌드 설정)

  • source: 소스 파일이 위치한 디렉토리 (기본값: .)
  • destination: 빌드된 파일이 위치한 디렉토리 (기본값: _site)
  • plugins_dir: 플러그인 파일이 위치한 디렉토리 (기본값: _plugins)
  • layouts_dir: 레이아웃 파일이 위치한 디렉토리 (기본값: _layouts)
    source: .
    destination: _site
    plugins_dir: _plugins
    layouts_dir: _layouts
    

Markdown 설정

  • markdown: Markdown 변환기에 대한 설정 (예: kramdown, redcarpet)
    markdown: kramdown
    

Kramdown 설정 예시

kramdown:
  input: GFM
  auto_ids: true
  hard_wrap: false
  • permalink: 게시물의 URL 구조를 정의
    permalink: /:categories/:year/:month/:day/:title.html
    

Pagination (페이지 네비게이션 설정)

  • paginate: 페이지당 표시할 게시물 수
  • paginate_path: 페이지 네비게이션의 경로
    paginate: 10
    paginate_path: "/page:num/"
    

Collections (컬렉션 설정)

컬렉션을 정의하여 블로그 포스트 이외의 콘텐츠를 관리

collections:
  my_collection:
    output: true
    permalink: /:collection/:name

Defaults (기본 값 설정)

특정 범위에 대한 기본 설정을 정의

defaults:
  - scope:
      path: ""
      type: "posts"
    values:
      layout: "post"
      author: "John Doe"

Exclude / Include (제외 / 포함 설정)

빌드 시 포함하거나 제외할 파일 또는 디렉토리

exclude:
  - README.md
  - Gemfile
include:
  - _pages

Plugins (플러그인 설정)

사용할 플러그인 목록

plugins:
  - jekyll-feed
  - jekyll-seo-tag

Sass (Sass 설정)

Sass 파일을 처리하는 방법 설정

sass:
  sass_dir: _sass
  style: compressed

Liquid (Liquid 설정)

Liquid 템플릿 엔진에 대한 설정

liquid:
  error_mode: warn

URL (URL 설정)

URL 관련 설정

  • url: 사이트의 기본 URL
  • baseurl: 사이트의 기본 경로 (예: /blog)
    url: "https://myblog.github.io"
    baseurl: "/blog"
    

Host (호스트 설정)

로컬 서버 호스트 및 포트 설정

host: 127.0.0.1
port: 4000

Incremental (증분 빌드 설정)

증분 빌드 활성화 (변경된 파일만 빌드)

incremental: true

Watch (파일 변경 감지 설정)

파일 변경 감지 활성화

watch: true

Future (미래 게시물 설정)

미래 날짜의 게시물을 포함할지 여부 설정

future: true

Timezone (시간대 설정)

사이트의 시간대 설정

timezone: "America/New_York"

Plugins Directory (플러그인 디렉토리 설정)

플러그인 파일이 위치한 디렉토리 설정

plugins_dir: _plugins

기타 설정

Safe Mode (안전 모드) 사용자 정의 플러그인을 비활성화합니다.

safe: true

Include (포함할 파일/디렉토리 목록)

빌드할 때 포함할 추가 파일/디렉토리 목록을 지정합니다.

include:
  - .htaccess

Exclude (제외할 파일/디렉토리 목록)

빌드할 때 제외할 파일/디렉토리 목록을 지정합니다.

exclude:
  - Gemfile
  - Gemfile.lock

Keep Files (유지할 파일 목록)

정적 사이트 빌드 중 유지할 파일 목록을 지정합니다.

keep_files:
  - .git
  - .svn

Markdown (마크다운 처리기 설정)

사용할 마크다운 처리기를 설정합니다.

markdown: kramdown

Encoding (인코딩 설정)

사이트의 기본 인코딩을 설정합니다.

encoding: UTF-8

Include (포함할 파일 목록)

빌드할 때 포함할 파일 목록을 지정합니다.

include:
  - .htaccess

Exclude (제외할 파일 목록)

빌드할 때 제외할 파일 목록을 지정합니다.

exclude:
  - Gemfile
  - Gemfile.lock

Whitelisted Plugins (허용된 플러그인 목록)

특정 플러그인만 허용합니다.

whitelist:
  - jekyll-paginate
  - jekyll-seo-tag

Markdown (마크다운 처리기 설정)

사용할 마크다운 처리기를 설정합니다.

markdown: kramdown

Kramdown (Kramdown 설정)

Kramdown 마크다운 처리기에 대한 설정을 지정합니다.

kramdown:
  input: GFM
  auto_ids: true
  syntax_highlighter: rouge

Gems (젬 설정)

사용할 젬 목록을 지정합니다.

gems:
  - jekyll-paginate
  - jekyll-seo-tag

게시물의 퍼머링크 형식을 지정합니다.

permalink: /:categories/:year/:month/:day/:title/

Pagination (페이지네이션 설정)

페이지네이션 설정을 지정합니다.

paginate: 10
paginate_path: "/page:num/"

예제 _config.yml

# Site settings
title: My Blog
description: A blog about Jekyll and Liquid
url: "https://myblog.github.io"
baseurl: ""

# Build settings
source: .
destination: _site
plugins_dir: _plugins
layouts_dir: _layouts

# Markdown settings
markdown: kramdown
kramdown:
  input: GFM
  auto_ids: true
  syntax_highlighter: rouge

# Permalinks
permalink: /:categories/:year/:month/:day/:title.html

# Pagination
paginate: 10
paginate_path: "/page:num/"

# Collections
collections:
  my_collection:
    output: true
    permalink: /:collection/:name

# Defaults
defaults:
  - scope:
      path: ""
      type: "posts"
    values:
      layout: "post"
      author: "John Doe"

# Exclude / Include
exclude:
  - README.md
  - Gemfile
include:
  - _pages

# Plugins
plugins:
  - jekyll-feed
  - jekyll-seo-tag

# Sass
sass:
  sass_dir: _sass
  style: compressed

# Liquid
liquid:
  error_mode: warn

# URL
url: "https://myblog.github.io"
baseurl: "/blog"

# Host
host: 127.0.0.1
port: 4000

# Incremental build
incremental: true

# Watch files
watch: true

# Future posts
future: true

# Timezone
timezone: "America/New_York"

이 예제는 Jekyll의 _config.yml 파일에서 설정 가능한 다양한 항목을 포함하고 있습니다. 필요에 따라 설정을 추가하거나 수정하여 사이트를 원하는 대로 구성할 수 있습니다.

댓글남기기