# Jekyll and GitHub layout issues

**URL:** <https://talk.jekyllrb.com/t/jekyll-and-github-layout-issues/1257>\
**Category:** Uncategorized\
**Created:** [December 14, 2017, 10:05am UTC](https://talk.jekyllrb.com/t/jekyll-and-github-layout-issues/1257 "2017-12-14T10:05:42Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![dougfinke](https://yyz2.discourse-cdn.com/flex030/user_avatar/talk.jekyllrb.com/dougfinke/32/618_2.png) [@dougfinke](https://talk.jekyllrb.com/u/dougfinke)\
**Post date:** [December 14, 2017, 10:05am UTC](https://talk.jekyllrb.com/t/jekyll-and-github-layout-issues/1257/1 "2017-12-14T10:05:42Z")

</div>

I’ve had my blog on github for a Jekyll. Out of nowhere, when I drill into a post, the formatting of the post is not right.

Any suggestions on what to tweak to get it back to it’s defaults?

[https://dfinke.github.io/](https://dfinke.github.io/) [https://github.com/dfinke/dfinke.github.io](https://github.com/dfinke/dfinke.github.io)

---

<div class="post-metadata">

**Author:** ![chuckhoupt](https://yyz2.discourse-cdn.com/flex030/user_avatar/talk.jekyllrb.com/chuckhoupt/32/523_2.png) [@chuckhoupt](https://talk.jekyllrb.com/u/chuckhoupt)\
**Post date:** [December 14, 2017, 3:21pm UTC](https://talk.jekyllrb.com/t/jekyll-and-github-layout-issues/1257/2 "2017-12-14T15:21:04Z")

</div>

I think this issue explains the problem and solution. Basically `baseurl` is always the empty string on Github, so all URLs in [`head.html`](https://github.com/dfinke/dfinke.github.io/blob/master/_includes/head.html) need to be absolute:

[https://github.com/github/pages-gem/issues/460](https://github.com/github/pages-gem/issues/460)

---

<div class="post-metadata">

**Author:** ![dougfinke](https://yyz2.discourse-cdn.com/flex030/user_avatar/talk.jekyllrb.com/dougfinke/32/618_2.png) [@dougfinke](https://talk.jekyllrb.com/u/dougfinke)\
**Post date:** [December 17, 2017, 6:21pm UTC](https://talk.jekyllrb.com/t/jekyll-and-github-layout-issues/1257/3 "2017-12-17T18:21:42Z")

</div>

Thank you, this solved some of the issues. I’m a noob in this space, is there a script, migration or a way to update my existing blog that fixes this?

---

<div class="post-metadata">

**Author:** ![chuckhoupt](https://yyz2.discourse-cdn.com/flex030/user_avatar/talk.jekyllrb.com/chuckhoupt/32/523_2.png) [@chuckhoupt](https://talk.jekyllrb.com/u/chuckhoupt)\
**Post date:** [December 17, 2017, 8:54pm UTC](https://talk.jekyllrb.com/t/jekyll-and-github-layout-issues/1257/4 "2017-12-17T20:54:52Z")

</div>

The issue I mentioned references [Parker’s post that gives a good explanation of how `baseurl` and `url` work](https://byparker.com/blog/2014/clearing-up-confusion-around-baseurl/) (note that the post predates the [`relative_url`/`absolue_url` filters](https://jekyllrb.com/docs/templates/#filters)).

To fix your site, you should set `basurl` to the empty string in `_config.yml`:

```auto
baseurl: ''

```

Then change all your site-relative-path-relative URLs to site-relative-path- **absolute** URLs (and optionally switch to `relative_url`). For example:

```auto
<link rel="stylesheet" href="{{ "css/main.css" | prepend: site.baseurl }}">

```

to:

```auto
<link rel="stylesheet" href="{{ "/css/main.css" | relative_url }}">

```

Note that you are not required to use `baseurl` and `relative_url` – it is only there to help when you need to move a site to a different location (e.g. from `example.com` to `example.com/blog`). For a site at the root, `relative_url` will always be a no-op.

For RSS feeds, you should use absolute URL everywhere (generated with `absolute_url`). Be sure to test any changes with the [RSS Feed Validator](http://www.feedvalidator.org).

---

<div class="post-metadata">

**Author:** ![chuckhoupt](https://yyz2.discourse-cdn.com/flex030/user_avatar/talk.jekyllrb.com/chuckhoupt/32/523_2.png) [@chuckhoupt](https://talk.jekyllrb.com/u/chuckhoupt)\
**Post date:** [December 17, 2017, 10:42pm UTC](https://talk.jekyllrb.com/t/jekyll-and-github-layout-issues/1257/5 "2017-12-17T22:42:54Z")

</div>

Looking more closely, it appears your blog uses a copy of the [Jekyll-Uno theme](https://github.com/joshgerdes/jekyll-uno) from 2016.

Unfortunately, at that time the Uno theme had a bug in its `baseurl` setup. [The bug (issue #56)](https://github.com/joshgerdes/jekyll-uno/issues/59) was found and fixed in August by this commit:

[https://github.com/joshgerdes/jekyll-uno/commit/26c1b3ce9a68d2d9280c58f8cb985cb289c12fd9](https://github.com/joshgerdes/jekyll-uno/commit/26c1b3ce9a68d2d9280c58f8cb985cb289c12fd9)

You could probably cherry-pick that commit or better, merge all the changes from the last year so that your theme is up to date.

---

<div class="post-metadata">

**Author:** ![dougfinke](https://yyz2.discourse-cdn.com/flex030/user_avatar/talk.jekyllrb.com/dougfinke/32/618_2.png) [@dougfinke](https://talk.jekyllrb.com/u/dougfinke)\
**Post date:** [December 17, 2017, 11:48pm UTC](https://talk.jekyllrb.com/t/jekyll-and-github-layout-issues/1257/6 "2017-12-17T23:48:47Z")

</div>

Thank you for tracking that down.
