Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Define site.title in a Jekyll template

My Problem

I am building a Jekyll static site using the jekyll-materialize-starter-template.

The home page contains an h1 title in the front center:

enter image description here

Which reads Your awesome title, and defined in _layouts/home.html:

<h1 class="header center orange-text">{{ site.title }}</h1>

How can I set the value of site.title?

What have I tried

  • Searched for site.title and title
  • Read the docs about variables
  • Hard-code my title. Works, but it feels like the wrong thing to do - variables should be properly set.

My question

How can I set the site.title variable used by a Jekyll template?

like image 375
Adam Matan Avatar asked Oct 30 '25 05:10

Adam Matan


1 Answers

Edit _config.yml and locate the title key:

title: Starter Template

or

title: Your awesome title

and change that value.

If you are developing with a local server, restart the jekyll server to reflect changes to config.

like image 152
marcanuy Avatar answered Nov 03 '25 00:11

marcanuy



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!