Ghost : changing font, 폰트 바꾸기

Share
Ghost : changing font, 폰트 바꾸기

In short;

Assuming you have Ghost v1.0.0 (or above) with default theme, Casper.
Default font is Georgia. We will change font with Google Web fonts.

cd {your-ghost-dir}/content/themes/casper    # move to theme directory
npm install gulp-cli -g                      # install gulp globally
npm install                                  # install npm packages in theme dir
gulp                                  # execute gulp. monitoring changes in theme

And remove every font-family : Georgia, serif; in ./assets/css/screen.css
For ex)

.post-card-excerpt {
    font-family: Nanum Gothic, serif;
}

to

.post-card-excerpt {
}

The changes in ./assets/css/screen.css will be compiled to ./assets/built/screen.css by gulp.
And restart your blog at theme directory by ghost restart

So, if you don't want to npm install anything, probabily removing all font-family : Georgia, serif; in ./assets/built/screen.css also works.

Then, find favorite font in Google Web fonts. I picked Nanum Gothic font. Inject following code at the first row of Blog Header into in Labs, http://your-blog.com/ghost/#/settings/code-injection/

<link href='https://fonts.googleapis.com/css?family=Nanum+Gothic' rel='stylesheet' type='text/css'>
<style>
body,  
h1, h2, h3, h4, h5, h6,  
.main-nav a,
.subscribe-button,
.page-title,
.post-meta,
.read-next-story .post:before,
.pagination,
.site-footer,{
    font-family:"Nanum Gothic", sans-serif;
}
[class^="icon-"]:before, [class*=" icon-"]:before {
	font-family:"Nanum Gothic", sans-serif;
</style>

Done.


우리말로 길게 말해서;

어느 일본 블로그를 자동 한글 번역해서 봤는데, 참고해서 해봄. code injection을 통해서하는데, 목표는 구글 웹포트의 Nanum gothic을 사용하는 것. 구글 웹폰트 그리고 무료 사용 가능 한글 구글 웹폰트에서 원하는 폰트를 찾는다.

나눔고딕은

<link href='https://fonts.googleapis.com/css?family=Nanum+Gothic' rel='stylesheet' type='text/css'>
<style>
body,  
h1, h2, h3, h4, h5, h6,  
.main-nav a,
.subscribe-button,
.page-title,
.post-meta,
.read-next-story .post:before,
.pagination,
.site-footer,{
    font-family:"Nanum Gothic", sans-serif;
}
[class^="icon-"]:before, [class*=" icon-"]:before {
	font-family:"Nanum Gothic", sans-serif;
</style>

그리고 내가 더 좋아하는 나눔바른고딕은

<link href='https://cdn.rawgit.com/openhiun/hangul/14c0f6faa2941116bb53001d6a7dcd5e82300c3f/nanumbarungothic.css' rel='stylesheet' type='text/css'>
<style>
body,  
h1, h2, h3, h4, h5, h6,  
.main-nav a,
.subscribe-button,
.page-title,
.post-meta,
.read-next-story .post:before,
.pagination,
.site-footer,
[class^="icon-"]:before, [class*=" icon-"]:before {
	font-family:"Nanum Barun Gothic", sans-serif;
</style>

를 code injection에서 Blog Header에서 맨 처음에 삽입해준다.

그러나 이상하게도 블로그 제목만 반영되는 현상 발견..
블로그 front 페이지 abstract와 포스트의 메인 컨텐츠의 폰트가 바뀌지 않음 발견. 보니까 안바뀌는 폰트가 Georgia이었다. ghost의 theme폴더에서 ./asset/css/screen.css 파일에서 Georgia 폰트를 발견했다.

특히 그부분에서 문제가 됬던 파트들, .post-card-excerpt, .post-full-content 등에서 Georgia로 고정되어 있음을 알수있었다. 따라서 그 부분 font-family : Georgia, serif;를 원하는 폰트로 바꾸거나 아니면 아예 삭제한다.

그리고 css파일이 바뀔때마다 테마 홈 디렉토리에서 ghost restart 해준다.

하지만 그래도 반영이 안되는데. 왜냐하면 ./default.hbs에서 <link rel="stylesheet" type="text/css" href="{{asset "built/screen.css"}}" /> 로 built된 css만 반영되기 때문이다.

그래서 built가 무엇인가 하니 ./READEME.md에서 자동으로 css의 폴더를 compile한 것이라 한다. 즉 ./assets/built/screen.css는 ./assets/css/screen.css를 압축시킨 동일한 code이다. 이는 css의 inlining을 통해 optimize한다 라는 글에서 힌트를 얻었다.

따라서 ./assets/built/screen.css 문제되는 부분의 Georgia를 Nanum Gothic으로 바꿔주면 되는데 테마 개발 의도랑 다르니 그냥 테마 READEME.md가 하라는대로 하자.

그래서 우선 gulp가 필요한데, 지속적으로 테마의 file들을 보다가 수정사항이 있으면 자동으로 compile해주는 것이라 보면 된다. 전역 설치해줘야 하니 npm install gulp-cli -g. 테마 폴더에서 npm install 후 gulp실행 계속 켜져있는다.

그럼 아까 했던 바꿨던 Georgia를 Nanum Gothic으로 바꾼게 compile되는 것이 확인되면 블로그 폰트도 바뀌는 것을 확인할 수 있다.

나는 거기에 code block의 폰트까지 내가 좋아하는 Ubuntu로 바꾸었다. 만족감 에헿.

Read more

허깅페이스 르로봇 해커톤 후기

허깅페이스 르로봇 해커톤 후기

본 블로그의 주인장들은 이번 허깅페이스의 르로봇 월드와이드 해커톤의 서울 호스트를 맡았습니다. 너무 재밌었고, 그 과정들과 후기를 남깁니다. 현장은 다큐 형식의 작은 영상을 만들었으니 한번 봐주세요. 계기 저는 LLM 만 하고 있었고, Action 모델은 사실 관심이 없었습니다, 준호는 1년 정도 로봇에 AI 를 넣는 일을 하고 있었죠. 허깅페이스에서 르로봇 플랫폼을 만들고

By park jong hyun
DeepDive LLM 3편 - Reinforcement Learning

DeepDive LLM 3편 - Reinforcement Learning

* 1편 - 사전 학습 (Pre Training) * 2편 - Supervised Fine Tuning * 3편 - Reinforcement Learning Reinforcement Learning Pretrain, SFT 에 이어서 세번째 단계는 Reinforcement Learning (RL, 강화학습) 입니다. 비유를 해보자면, pretrain은 그냥 책을 읽는 것이고요, SFT는 예제 문제와 이미 작성된 해설을 보는 것입니다. RL 은 해설이 없는 문제를 직접 풀어보는 것입니다. 어떻게 풀든

By park jong hyun
DeepDive LLM 2편 - Supervised Fine Tuning

DeepDive LLM 2편 - Supervised Fine Tuning

* 1편 - 사전 학습 (Pre Training) * 2편 - Supervised Fine Tuning * 3편 - 강화 학습 (Reinforcement Learning) Supervised Fine Tuning Post Training 의 첫번째 단계 SFT 입니다. Pre Training 에 비하면 아주 작은 양의 데이터만 필요하지만, 실제로 성능을 이끌어 내는데에는 중요한 단계입니다. 멀티턴 대화 (Multi Turn Conversation) ChatGPT 를 포함해서 대부분의 AI 서비스들은

By park jong hyun
DeepDive LLM 1편 - 사전 학습 (Pre-Training)

DeepDive LLM 1편 - 사전 학습 (Pre-Training)

본 포스트 시리즈는 카파시 선생님의 영상 을 기반으로 정리한 내용입니다. 직접 유투브에서 다루기도 했으니 영상으로 보셔도 됩니다. * 1편 - 사전 학습 (Pre-Training) * 2편 - Supervised Fine Tuning * 3편 - 강화 학습 (Reinforcement Learning) LLM 의 Training LLM을 만들 때는 크게 세 가지 주요 단계가 있습니다. 1. 사전 학습(Pre-Training) * 인터넷 텍스트(

By park jong hyun