4
votes

I created index.md for my GitHub pages site with the following in index.md

---
title: This is my title
layout: default
---
## Welcome to GitHub Pages My Index.md
 etc

I am just editing the index.md directly in the GitHub editor. I have not installed Jekyll locally.

What do I change so that the generated source does not have my repository name in the title ? Looking at the source I have enter image description here

I have tried changing the theme.

I also tried experimented with adding a header.html to the _includes folder

This caused me to start receiving emails with subject containing "Page build failed"

Since then I have removed all the folders. I no longer get the "Page build failed" email, but I am unsure of how to proceed.

3
Studying help.github.com/articles/… I copied the default.html as described. I think I need to change the line <title>{{ site.title | default: site.github.repository_name }} by {{ site.github.owner_name }}</title>Kirsten

3 Answers

2
votes

GitHub Pages silently sets default layouts using jekyll-default-layout, as described in Publishing with GitHub Pages, now as easy as 1, 2, 3.

To avoid this, you can create your own _layouts/default.html, which should look something like this:

<!doctype>
<html>
  <head>
    <title></title>
  </head>
  <body>
    {{ content }}
  </body>
</html>

And then apply the layout to your files:

---
layout: default
---

...

If you want to include the page title in the title tag, you can do something like this instead of the _layouts/default.html above:

<!doctype>
<html>
  <head>
    <title>{{ page.title }}</title>
  </head>
  <body>
    {{ content }}
  </body>
</html>

Which will use the title in your YAML front matter:

---
layout: default
title: Title
---

...

For more information, take a look at the Jekyll documentation:

https://jekyllrb.com/docs/home/

1
votes

The site title can be set in _config.yml

However it seems that the _layout\default.html is also required to make the setting work.

The help to set up the default.html is here under the title "Customizing your Jekyll theme's HTML layout"

1
votes

HOW IT WORKS ?

Post content will mention name of layout file which will be in _layout folder. So for following post corresponding layout will be in _layouts/default.html

---
title: This is a post with default layout
layout: default
---
Some text for post

Typically default.html layout consumes files head.html and header.html inside _includes folder.

ACTION

Now you have to look at markdown of your page or post and identify its parent layout (inside _layouts) and from there drill-down into _includes. This will allow you to trace lines those are getting generated into output html. Also you can have your own _includes and _layouts for custom html output.