Jaskirat Singh
Jaskirat Singh

Reputation: 39

How to add different title and description for different pages in Cayman github pages?

I'm currently using the Cayman theme for making GitHub pages. I can understand that there is a default layout. Suppose I want to have a different title and Description within the header for different pages. For instance as shown below enter image description here "Data Collection" is a Title and "It automates....." is a description. Suppose I create another page and want to change this title and description for another how can I do that in this?

Upvotes: 2

Views: 428

Answers (1)

VonC
VonC

Reputation: 1326736

Actually, that theme has some issue with the title.
See "Title is not working #134"

Ben Souchet adds:

The only correct solution currently is to "create a custom layout", this is ultra easy and can be done in 1min.
The steps are:

  • On your repo where you have the _config.yml file you need to create a folder named "_layouts/" and in that new folder create a file named "default.html"
  • In that "default.html" past the content of this page.
  • Replace this line <h1 class="project-name">{{ page.title | default: site.title | default: site.github.repository_name }}</h1> with this line <h1 class="project-name">{{ site.title | default: site.github.repository_name }}</h1>
  • And replace this line <h2 class="project-tagline">{{ page.description | default: site.description | default: site.github.project_tagline }}</h2> with <h2 class="project-tagline">{{ site.description | default: site.github.project_tagline }}</h2>
  • Save the file ("default.html")
  • Wait approx 2mins for the build of your page to be fully done
  • Voilà

But that is only for one page, which is what that theme is make for.
For multiple pages, you need a different theme.

Upvotes: 1

Related Questions