Yoan
Yoan

Reputation: 75

How to change the URL of the title in Jekyll?

Is it possible to change the target URL when clicking on the value title defined in _config.yml ?

To define the context, I have my static HTML website hosted on GitHub, it's a one page website. I have on the same repository the Jekyll blog accessible on mysite.github.com/blog. When I click on the header title, the Jekyll blog redirect me to / which is my website and I would like to be redirected in /blog.

What is the simpliest method ?

Upvotes: 0

Views: 668

Answers (2)

Anonymous
Anonymous

Reputation: 456

You need to rewrite the header.html of the minima theme template. The goal is to change the target of the link in the header. To do that :

  1. Create a folder _includes and a file header.html inside
  2. Copy and paste the original code for the official repository https://raw.githubusercontent.com/jekyll/minima/master/_includes/header.html into the header.html file
  3. replace the content of href="{{ "/" | relative_url }}" by href="{{ "/blog" | relative_url }}"

Upvotes: 1

Bailey S
Bailey S

Reputation: 627

Have you tried setting url and baseurl in the config for the blog? Baseurl should be used for the "home" page.

Upvotes: 0

Related Questions