๐Ÿš€ jekyll ์†๋„ ์˜ฌ๋ฆฌ๊ธฐ

๊ฐœ์ธ ๋ธ”๋กœ๊ทธ๋กœ github pages์™€ jekyll์„ ์‚ฌ์šฉํ•˜๊ณ  ๋‚˜์„œ๋ถ€ํ„ฐ ๋กœ์ปฌ์—์„œ jekyll์„ ๋Œ๋ฆฌ๋ฉด์„œ ํฌ์ŠคํŠธ๊ฐ€ ์ œ๋Œ€๋กœ ์ž‘์„ฑ๋˜์—ˆ๋Š”์ง€ ํ‘ธ์‰ฌํ•˜๊ธฐ ์ „ ๋งค๋ฒˆ ํ™•์ธํ•˜๊ณ  ์žˆ๋‹ค. ๋ณดํ†ต ๋‚˜๋Š” ํฌ์ŠคํŠธ๋ฅผ _drafts ํด๋”์— ์šฐ์„  ๋„ฃ์–ด๋†“๊ณ  ์ž‘์„ฑํ•˜๋Š” ํŽธ์ด๋ผ, ๋“œ๋ž˜ํ”„ํŠธ๊นŒ์ง€ ๋นŒ๋“œํ•˜๋ฉด์„œ ํ™•์ธํ•˜๊ณ  ์žˆ์—ˆ๋Š”๋ฐ, ํ•œ๋ฒˆ ์ €์žฅํ•˜๋ฉด ๋‹ค์‹œ ๋นŒ๋“œ๋ ๋•Œ๊นŒ์ง€ ๋„ˆ๋ฌด ์˜ค๋ž˜๊ฑธ๋ฆฐ๋‹ค. (12์ธ์น˜ ๋งฅ๋ถ์—์„œ 2์ดˆ์ •๋„ ๊ฑธ๋ฆฐ๋‹ค) ๊ทธ๋ž˜์„œ ์ด๊ฑธ ์–ด๋–ป๊ฒŒ ๋” ๋น ๋ฅด๊ฒŒ ๋งŒ๋“ค ๋ฐฉ๋ฒ•์ด ์—†์„๊นŒ ํ•˜๋ฉด์„œ ์ฐพ์•„๋ณด๋‹ค๊ฐ€ ์•„๋ž˜์ฒ˜๋Ÿผ ๋กœ์ปฌ ํ…Œ์ŠคํŠธ ๋‹จ๊ณ„์˜ ์†๋„๋ฅผ ์˜ฌ๋ ธ๋‹ค. (ํ‘ธ์‰ฌ๋˜๊ณ  ๋‚œ ํ›„์•ผ.. ๋ญ ๋‚ด ์„œ๋ฒ„ ์•„๋‹ˆ๋‹ˆ๊นŒ..)

config.yml ์ˆ˜์ •

.git/ ํด๋”์˜ ๊ฒฝ์šฐ ์ƒ๋‹นํžˆ ๋งŽ์€ ํŒŒ์ผ๋“ค์„ ํฌํ•จํ•˜๋Š”๋ฐ tree .git์„ ํ•ด๋ณด๋‹ˆ ์•„๋ž˜์ฒ˜๋Ÿผ ๋‚˜์˜จ๋‹ค.

$ tree .git
...
...
    โ”œโ”€โ”€ remotes
    โ”‚   โ””โ”€โ”€ origin
    โ”‚       โ””โ”€โ”€ master
    โ””โ”€โ”€ tags

267 directories, 799 files

์•ฝ 800๊ฐœ์˜ ํŒŒ์ผ๊ณผ 270๊ฐœ์˜ ํด๋”๊ฐ€ ์กด์žฌํ•˜๋Š”๋ฐ, ์ด๋ฅผ ์ผ์ผํžˆ ๋‹ค ํƒ์ƒ‰ํ•˜๋Š” ๊ฒƒ์€, ์ฝ”์–ด M์—์„œ ๋Œ์•„๊ฐ€๋Š” ํ•ซ ๋ฆฌ๋กœ๋”์—๊ฒŒ๋Š” ๋„ˆ๋ฌด ๋ฒ„๊ฑฐ์šด ์ž‘์—…์ผํ…Œ๋‹ˆ exclude์— ๋‹ค์Œ์ฒ˜๋Ÿผ ์ถ”๊ฐ€์‹œ์ผœ์ฃผ์—ˆ๋‹ค.

exclude:
  - Gemfile
  - Gemfile.lock
  - LICENSE
  - README.md
  - .vscode
  - .git
  - .gitignore
  - .DS_Store

์ข€ ๋‹ค๋ฅธ ํ•„์š”์—†๋Š” ํŒŒ์ผ๊นŒ์ง€ ๋‹ค ํ•ฉ์ณค๋‹ค. ์ด๋ ‡๊ฒŒ ํ•˜๋‹ˆ๊นŒ jekyll serve๋ฅผ ์‹คํ–‰ํ•  ๋•Œ ๋ฆฌ๋กœ๋“œ ์†๋„๊ฐ€ ํ‰๊ท ์ ์œผ๋กœ 0.2์ดˆ ์ •๋„..? ๋นจ๋ฆฌ์ง„ ๋Š๋‚Œ์ด๋‹ค. (๋Œ€๋žต 2.0์ดˆ์—์„œ 1.8์ดˆ์ •๋„๊นŒ์ง€ ์ค„์—ˆ๋‹ค)

๋ Œ๋”๋ง ํ•˜๋Š”๋ฐ ์˜ค๋ž˜๊ฑธ๋ฆฌ๋Š” ํŒŒ์ผ ์ˆ˜์ •

jekyll ์†๋„ ์ด์Šˆ๋กœ ์ฐพ๋‹ค๋ณด๋‹ˆ jekyll์—์„œ ํ”„๋กœํŒŒ์ผ๋ง ์˜ต์…˜์„ ์ œ๊ณตํ•˜๋Š” ๊ฒƒ์„ ์•Œ๊ฒŒ๋˜์—ˆ๋‹ค. ๋‹ค์Œ์ฒ˜๋Ÿผ ์‹คํ–‰ํ•˜๋ฉด ๋œ๋‹ค.

Configuration file: {github repo ๊ฒฝ๋กœ!!}/jeongukjae.github.io/_config.yml
            Source: {github repo ๊ฒฝ๋กœ!!}/jeongukjae.github.io
       Destination: {github repo ๊ฒฝ๋กœ!!}/jeongukjae.github.io/_site
 Incremental build: disabled. Enable with --incremental
      Generating...
       Jekyll Feed: Generating feed for posts

Filename                                       | Count |   Bytes |  Time
-----------------------------------------------+-------+---------+------
_layouts/default.html                          |    57 | 775.53K | 0.214
_includes/meta.html                            |    57 |  54.90K | 0.093
feed.xml                                       |     1 | 123.26K | 0.083
sitemap.xml                                    |     1 |   8.51K | 0.062
_includes/svg-icons.html                       |    57 |  20.87K | 0.052
tags.html                                      |     1 |  33.85K | 0.049
_layouts/post.html                             |    49 | 541.59K | 0.029
_includes/analytics.html                       |    57 |   0.06K | 0.018
_posts/2018/2018-11-13-CNN ๊ณต๋ถ€.md              |     1 |   8.04K | 0.006
index.html                                     |     1 |  10.08K | 0.006
page2/index.html                               |     1 |  11.61K | 0.004
about.md                                       |     1 |   0.83K | 0.004
_includes/image.html                           |    12 |   4.28K | 0.004
...
...
                    done in 2.226 seconds.
 Auto-regeneration: disabled. Use --watch to enable.

์ด๋ ‡๊ฒŒ ์ญ‰ ๋‚˜์˜ค๋Š”๋ฐ, tags.html์˜ ๊ฒฝ์šฐ๋Š” ๋งŽ์ด ์ค„์ธ๊ฑฐ๋‹ค. ์›๋ž˜ 0.150์ •๋„๋ฅผ ์žก์•„๋จน๊ณ  ์žˆ์—ˆ๋‹ค.. ใ… ใ…  ๋ชจ๋“  ํฌ์ŠคํŠธ๋ฅผ ํƒœ๊ทธ ์ˆ˜ + 1๋งŒํผ ์ˆœํšŒํ•˜๋Š”๋ฐ, liquid์˜ ๊ธฐ๋Šฅ์ด ๋ถ€์กฑํ•œ๊ฑด์ง€ ๋‚ด๊ฐ€ ๋ชป์ฐพ๋Š”๊ฑด์ง€ ๋งŽ์ด๋Š” ๋ชป์ค„์ด๊ณ  ์–ด๋–ค ํƒœ๊ทธ๊ฐ€ ์žˆ๋Š”์ง€ ์ฐพ์•„์˜ค๋Š” ๋ถ€๋ถ„๋งŒ ์ค„์˜€๋‹ค. ๋ฌธ์„œ๋ฅผ ์ฐพ์•„๋ณด๋‹ˆ ์•„๋ž˜์ฒ˜๋Ÿผ ๋ชจ๋“  ํƒœ๊ทธ๋ฅผ ์ค‘๋ณต์ œ๊ฑฐํ•˜๋ฉด์„œ ์ •๋ ฌํ•ด์„œ ์ด๋ ‡๊ฒŒ ๋“ค๊ณ  ์˜ฌ ์ˆ˜ ์žˆ๋”๋ผ.

{% assign all_tags = site.posts | map: 'tags' | compact | uniq | sort %}

์ด๋ ‡๊ฒŒ ์‚ฌ์šฉํ•˜๋‹ˆ๊นŒ ์•ฝ๊ฐ„.. ๋” ์ค„์—ˆ๋‹ค. ๋งค ๋ฆฌ๋กœ๋“œ๋งˆ๋‹ค 1.7 ~ 1.8์ดˆ์ •๋„ ๊ฑธ๋ฆฐ๋‹ค. ๊ทผ๋ฐ ์ด๊ฒŒ ๊ทธ๋ž˜๋„ ๋งŽ์ด ๋Š๋ฆฌ๋‹ค.

incremental serve

jekyll ๋ฌธ์„œ์— incremental regeneration์— ๊ด€ํ•œ ๋ฌธ์„œ๊ฐ€ ์žˆ๋‹ค. ์•„์ง experimental feature์ด๊ธด ํ•˜์ง€๋งŒ, ๋ญ ๋ณ„ ๋ฌธ์ œ ์—†์œผ๋ฉด ๊ฐœ์ธ์šฉ์œผ๋กœ ์‚ฌ์šฉํ• ๋งŒ ํ•˜๋‹ค๊ณ  ์ƒ๊ฐํ•ด์„œ ์ ์šฉํ•ด๋ณด์•˜๋‹ค. ์ ์šฉํ•ด๋ณด๋‹ˆ live reload, drafts ๋นŒ๋“œ๊นŒ์ง€ ํ•ฉ์ณค์„ ๋•Œ 0.7์ดˆ๊นŒ์ง€ ์ค„์–ด๋“ ๋‹ค.. ใ… ใ… ใ… ใ… ใ…  ๋ญ 1์ดˆ ๊ฐ€๊นŒ์ด ์ค„์–ด๋“  ์…ˆ์ด๋‹ค.

limit posts

๊ทธ๋ฆฌ๊ณ  ํ•œ๊ฐœ์˜ ํฌ์ŠคํŠธ๋งŒ ๋นŒ๋“œํ•˜๋„๋ก ์„ค์ •์ด ๊ฐ€๋Šฅํ•˜๋‹ค. ์–ด์ฐจํ”ผ ์ž‘์„ฑ์‹œ์—๋Š” ํ•˜๋‚˜์˜ ํฌ์ŠคํŠธ๋งŒ ๋ณด๋‹ˆ๊นŒ ์„ค์ •ํ•˜๋ฉด ์ข‹์„ ๋“ฏํ•˜๋‹ค.

$ jekyll serve --help
...
...
        -s, --source SOURCE  Custom source directory
            --future       Publishes posts with a future date
            --limit_posts MAX_POSTS  Limits the number of posts to parse and publish
        -w, --[no-]watch   Watch for changes and rebuild
...
...

์ด๋ ‡๊ฒŒ ์ค‘๊ฐ„์— limit-posts ์˜ต์…˜์ด ์žˆ๋‹ค. 1๋กœ ์„ค์ •ํ•ด์„œ ์‚ฌ์šฉํ•˜์ž! ์ด๋ ‡๊ฒŒ ์“ฐ๋‹ˆ๊นŒ ์ดˆ๊ธฐ ๋กœ๋”ฉ์€ ์กฐ๊ธˆ ๋Š๋ ธ๋Š”๋ฐ (2์ดˆ) ์ดˆ๊ธฐ๋กœ๋”ฉ๊นŒ์ง€ 0.6์ดˆ์ •๋„๋กœ ์—„์ฒญ ๋นจ๋ผ์กŒ๋‹ค!! ๊ฒŒ๋‹ค๊ฐ€ ๋ผ์ด๋ธŒ ๋ผ๋กœ๋“œ๋Š” 0.3์ดˆ์ •๋„๋กœ ๊ฑฐ์˜ ์ˆ˜์ •์‚ฌํ•ญ์„ ๋ฐ”๋กœ ํ™•์ธํ•  ์ˆ˜ ์žˆ๊ฒŒ ๋นจ๋ผ์กŒ๋‹ค.

๊ทธ๋ž˜์„œ ์ด๋ ‡๊ฒŒ ์“ฐ๋Š” ์ค‘์ด๋‹ค

$ jekyll serve -lDI --limit-posts 1
Configuration file: {githug repo ๋งํฌ์ž…๋‹ˆ๋‹ค!!}/jeongukjae.github.io/_config.yml
            Source: {githug repo ๋งํฌ์ž…๋‹ˆ๋‹ค!!}/jeongukjae.github.io
       Destination: {githug repo ๋งํฌ์ž…๋‹ˆ๋‹ค!!}/jeongukjae.github.io/_site
 Incremental build: enabled
      Generating...
       Jekyll Feed: Generating feed for posts
                    done in 0.657 seconds.
 Auto-regeneration: enabled for '{githug repo ๋งํฌ์ž…๋‹ˆ๋‹ค!!}/jeongukjae.github.io'
LiveReload address: http://127.0.0.1:35729
    Server address: http://127.0.0.1:4000/
  Server running... press ctrl-c to stop.
      Regenerating: 1 file(s) changed at 2019-04-07 14:25:31
                    _posts/2019/2019-04-07-jekyll-์†๋„-์˜ฌ๋ฆฌ๊ธฐ.md
       Jekyll Feed: Generating feed for posts
                    ...done in 0.363427 seconds.

์ €์žฅํ•˜๊ณ  ๋ธŒ๋ผ์šฐ์ € ์˜ฌ๋ฆฌ๋ฉด ๋ฆฌ๋กœ๋“œ๊ฐ€ ๋๋‚˜ ์žˆ์„ ์ •๋„์ด๋‹ค. ๋Œ€๋žต ์ดˆ๊ธฐ๋กœ๋”ฉ๋„ 2.5์ดˆ์ •๋„์—์„œ 0.6 ~ 0.7์ดˆ๊นŒ์ง€ ์ค„์—ˆ๊ณ , ๋ผ์ด๋ธŒ ๋ฆฌ๋กœ๋“œ๋„ 2์ดˆ์—์„œ 0.3 ~ 0.4์ดˆ๊นŒ์ง€ ์ค„์—ˆ๋‹ค. ์ด์ œ ์•ž์œผ๋กœ ํŽธํ•˜๊ฒŒ ๋ธ”๋กœ๊ทธ ๊ธ€ ์ž‘์„ฑํ•ฉ์‹œ๋‹ค ๐Ÿค—

April 7, 2019 ์— ์ž‘์„ฑ
Tags: jekyll