1

I built a blog using jekyll and githubpages, and everything was going swimmingly until I added a custom domain name. After adding a custom domain name any link embedded in the website to another part of the blog (except for the homepage) is broken.

i.e. http://blog.com/about becomes -> http://about
i.e. http://blog.com/contact becomes -> http://contact

I can type in any of the addresses manually and it works fine, but if I click a link on the website to a post, the about page, or the contact page I get the broken url. How do I stop the site portion of the url from disappearing? Link to blog and its repository below

marcanuy
  • 23,118
  • 9
  • 64
  • 113

1 Answers1

0

To generate the correct URL, you need to prepend the site.url variable.

You can generate the URLs manually in index.html:

  {{site.url}}/{{ site.baseurl }}{{ post.url }}

Or use absolute_url to have them added automatically (it prepends site.url and site.baseurl):

 <a href="{{ post.url|absolute_url }}">{{ post.title }}</a>
marcanuy
  • 23,118
  • 9
  • 64
  • 113