/seungriyou.github.io

πŸ“š SR's Dev-Log πŸ“š

Primary LanguageSCSSMIT LicenseMIT

Chirpy Starter Gem Version GitHub license

When installing the Chirpy theme through RubyGems.org, Jekyll can only read files in the folders /_data, /_layouts, /_includes, /_sass and /assets, as well as a small part of options of the /_config.yml file from the theme's gem. If you have ever installed this theme gem, you can use the command bundle info --path jekyll-theme-chirpy to locate these files.

The Jekyll team claims that this is to leave the ball in the user’s court, but this also results in users not being able to enjoy the out-of-the-box experience when using feature-rich themes.

To fully use all the features of Chirpy, you need to copy the other critical files from the theme's gem to your Jekyll site. The following is a list of targets:

.
β”œβ”€β”€ _config.yml
β”œβ”€β”€ _plugins
β”œβ”€β”€ _tabs
└── index.html

To save you time, and also in case you lose some files while copying, we extract those files/configurations of the latest version of the Chirpy theme and the CD workflow to here, so that you can start writing in minutes.

Prerequisites

Follow the instructions in the Jekyll Docs to complete the installation of Ruby, RubyGems, Jekyll and Bundler.

Installation

Use this template to generate a brand new repository and name it <GH_USERNAME>.github.io, where GH_USERNAME represents your GitHub username.

Then clone it to your local machine and run:

$ bundle

Usage

Please see the theme's docs.

License

This work is published under MIT License.




Personal Notes

TODO

  • _config.yml - google_site_verification, google_analytics, giscus 정보 μΆ”κ°€ν•˜κΈ°
  • a tag areaκ°€ imgλ₯Ό λ²—μ–΄λ‚˜λŠ” 문제
  • imageμ—μ„œ .left / .right / .normal 등이 먹지 μ•ŠλŠ” 문제

How to Upgrade

starter둜 μ„€μΉ˜ν•œ 경우, λ‹€μŒκ³Ό 같이 ν•˜λ©΄ λœλ‹€.

If you are using the theme gem (there will be gem "jekyll-theme-chirpy" in the Gemfile), editing the Gemfile and update the version number of the theme gem, for example:

- gem "jekyll-theme-chirpy", "~> 3.2"
+ gem "jekyll-theme-chirpy", "~> 4.0"

And then execute the following command:

bundle update jekyll-theme-chirpy

As the version upgrades, the critical files (for details, see the startup template) and configuration options will change. We can use the GitHub API to get the file changes in the version upgrade.

The URL format is as follows:

https://github.com/cotes2020/chirpy-starter/compare/<older_version>...<newer_version>

For instance, to upgrade from v4.0.0 to v5.0.0, visit: https://github.com/cotes2020/chirpy-starter/compare/v4.0.0...v5.0.0


ref:


jekyll, gem κ΄€λ ¨ 이슈

GemNotFound

λ‹€μŒκ³Ό 같은 μ—λŸ¬κ°€ λ°œμƒν•  λ•ŒλŠ”

... `materialize': Could not find sass-embedded-1.58.3 in any of the sources (Bundler::GemNotFound)

λ‹€μŒμ˜ λͺ…λ Ήμ–΄λ‘œ gem을 μ •λ¦¬ν•œλ‹€.

bundler

jekyll s not working

λ‹€μŒμ˜ λͺ…λ Ήμ–΄λ‘œ μ‹€ν–‰ν•œλ‹€.

bundle exec jekyll s

(23.10.27 μΆ”κ°€) μš”μ¦˜μ€ λ‹€μŒκ³Ό 같이 싀행해도 λœλ‹€...!

jekyll s

rbenv

rbenv versions
rbenv local
rbenv local 3.1.0

Adding Custom CSS Settings

  • _etc λ‚΄λΆ€μ˜ sass νŒŒμΌλ“€μ€ 기쑴에 배포된 chirpy theme의 νŒŒμΌμ΄λ‹€. ν•΄λ‹Ή νŒŒμΌλ“€μ„ μ°Έκ³ ν•˜λ©΄ λœλ‹€.

  • μ‹€μ œ custom νŒŒμΌμ€ _sass/custom 폴더 밑에 μž‘μ„±ν•œλ‹€.

    • μƒˆλ‘œ νŒŒμΌμ„ μž‘μ„±ν•  경우, assets/css/style.scss에 @import ν•΄μ£Όλ©΄ λœλ‹€.
    • μ˜ˆμ™Έλ‘œ, ν¬μŠ€νŒ… λ‚΄ μ½”λ“œ λΈ”λŸ­μ˜ 색상 νŒ”λ ˆνŠΈ 섀정은 _sass/colors에 μœ„μΉ˜μ‹œμΌœ 별닀λ₯Έ @import μž‘μ—… 없이 & overriding λ™μž‘ 없이 μ μš©λ˜λ„λ‘ ν•œλ‹€.
  • @mixin을 override ν•˜κΈ° μœ„ν•΄ μ‚½μ§ˆμ„ μ˜€λž˜ν–ˆλŠ”λ°, _sass/custom/addon/commons.scss, _sass/custom/addon/syntax.scss νŒŒμΌμ„ μ°Έκ³ ν•˜μ—¬ μ‚¬μš©ν•˜λ©΄ override λ™μž‘λ„ μˆ˜ν–‰ν•  수 μžˆλ‹€.


version 6.2.0 λΆ€ν„°λŠ” sass variablesλ₯Ό overwrite ν•˜λŠ” 방법이 바뀐 λ“―ν•˜λ‹€. μΆ”ν›„ ν•„μš”ν•˜λ©΄ μ°Έκ³ ν•˜μž!

https://chirpy.cotes.page/posts/getting-started/#customizing-stylesheet


Custom Ordering in Categories Tab

  • _layouts/categories.html νŒŒμΌμ„ μƒμ„±ν•˜μ—¬ https://seungriyou.github.io/categories/ νƒ­μ—μ„œμ˜ μ΅œμƒμœ„ μΉ΄ν…Œκ³ λ¦¬ μ •λ ¬ μˆœμ„œλ₯Ό μ»€μŠ€ν„°λ§ˆμ΄μ§• ν–ˆλ‹€.

    원본 μ½”λ“œμ—μ„œλŠ” λ‹€μŒκ³Ό 같이 μΉ΄ν…Œκ³ λ¦¬ μ΄λ¦„μ˜ 사전식 μˆœμ„œλ‘œ μ •λ ¬ν•˜μ˜€λ‹€.

    {% assign sort_categories = site.categories | sort %}
  • ν•΄λ‹Ή html 파일의 원본 νŒŒμΌμ€ jekyll-theme-chirpy의 원본 categories.html νŒŒμΌμ—μ„œ 확인할 수 μžˆλ‹€.

  • post μž‘μ„± μ‹œ μƒˆλ‘œμš΄ μΉ΄ν…Œκ³ λ¦¬λ₯Ό λ§Œλ“€ 것이라면, _layouts/categories.html νŒŒμΌμ— λ‹€μŒκ³Ό 같이 custom_order λ‚΄μ—μ„œ μ μ ˆν•œ μœ„μΉ˜μ— , 와 ν•¨κ»˜ μΆ”κ°€ν•΄μ£Όλ©΄ λœλ‹€. μˆœμ„œλ₯Ό μˆ˜μ •ν•˜κ³  싢을 λ•Œλ„ λ§ˆμ°¬κ°€μ§€λ‘œ custom_orderλ₯Ό μˆ˜μ •ν•œλ‹€.

    <!-- [START] add custom order of categories in `CATEGORIES` tab -->
    <!-- ref: https://twpower.github.io/228-make-array-and-add-element-in-jekyll-liquid-en -->
    {% assign custom_order = 'Python, Dev-Log, MLOps, Problem Solving, Computer Science, Deep Learning, Experience, Daily-Log' | split: ', ' %}
    {% assign sort_categories = '' | split: ',' %}
    {% for co in custom_order %}
      {% for category in site.categories %}
        {% if category[0] == co %}
          {% assign sort_categories = sort_categories | push: category %}
        {% endif %}
      {% endfor %}
    {% endfor %}
    <!-- [END] add custom order of categories in `CATEGORIES` tab -->
  • Jekyll liquid λ¬Έλ²•μ—μ„œ arrayλ₯Ό μƒμ„±ν•˜λŠ” 방법은 Make array and add element in liquidλ₯Ό μ°Έκ³ ν–ˆλ‹€.


Small Tips for Posting

(1) 이미지 크기 μ„€μ •

![example-image](/assets/img/posts/category/subcategory/image.png){: style="max-width: 70%"}

ν˜Ήμ€, λ‹€μŒμ˜ μˆ˜μΉ˜λ“€μ— λŒ€ν•΄μ„œλŠ” bootstrap 섀정을 μ‚¬μš©ν•  μˆ˜λ„ μžˆλ‹€.

![example-image](/assets/img/posts/category/subcategory/image.png){: .w-25} (width 25%)
![example-image](/assets/img/posts/category/subcategory/image.png){: .w-50} (width 50%)
![example-image](/assets/img/posts/category/subcategory/image.png){: .w-75} (width 75%)
![example-image](/assets/img/posts/category/subcategory/image.png){: .w-100} (width 100%)
![example-image](/assets/img/posts/category/subcategory/image.png){: .w-auto} (default)

(2) ν…μŠ€νŠΈ 색상 μ„€μ •

HTML color name은 λ§ν¬μ—μ„œ ν™•μΈν•˜κΈ°!

<span style="color: red">this is **red**</span>

(3) Math: Curly Bracket

ref: https://github.com/orgs/community/discussions/16993#discussioncomment-4056560

curly bracket을 ν‘œν˜„ν•˜κΈ° μœ„ν•΄ \{, \}λ₯Ό μ‚¬μš©ν•˜λ©΄ 좜λ ₯이 μ•ˆ λœλ‹€. λŒ€μ‹ , \lbrace와 \rbraceλ₯Ό μ‚¬μš©ν•΄μ•Ό ν•œλ‹€.

  • {} 좜λ ₯ μ•ˆ λ˜λŠ” μ˜ˆμ‹œ

    $\mathbf s^0=\{s^0(j)\in [n]\}_{j \in [m]}$
  • {} 좜λ ₯ λ˜λŠ” μ˜ˆμ‹œ

    $\mathbf s^0=\lbrace s^0(j)\in [n]\rbrace_{j \in [m]}$

(4) Math: Degree Symbol

degree symbol을 λ‚˜νƒ€λ‚΄λ €λ©΄ \degreeκ°€ μ•„λ‹Œ ^{\circ}을 μ‚¬μš©ν•΄μ•Ό ν•œλ‹€.

  • Β° 좜λ ₯ μ•ˆ λ˜λŠ” μ˜ˆμ‹œ

    $70\degree$
  • Β° 좜λ ₯ λ˜λŠ” μ˜ˆμ‹œ

    $70^{\circ}$

(5) Toggle

<details>
<summary>제λͺ©</summary>
<div markdown="1">

λ‚΄μš©

</div>
</details>