Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I change the default font for a Jekyll website

Tags:

css

yaml

jekyll

I'm new to using Jekyll, css, etc, and I forked the Jekyll now repo. Is there a way I can change, or add, default fonts to the entire jekyll website? It looks like this post may have some answers, but I don't really understand it.

like image 400
doubledaffy888 Avatar asked Jan 09 '17 15:01

doubledaffy888


2 Answers

Edit the file style.scss located at the root of the jekyll instance, you can change the font from this:

body {
  ...
  font: 18px/1.4 $helvetica;
}

to this:

body {
      font-family: "Times New Roman", Times, serif;
}

or whatever font you want.

If you want to make it better, use variables, add them to _sass/_variables.css

$times: "Times New Roman", sans-serif;

and then change in style.scss:

body {
    font: 18px/1.4 $times;
}
like image 54
marcanuy Avatar answered Sep 17 '22 17:09

marcanuy


check this Font change Jekyll

The answer you mention telling is to edit your _config.yml file by adding the font names. i prefer add your font in sass file.

like image 35
PMArtz Avatar answered Sep 19 '22 17:09

PMArtz