shakyShane / jekyll-gulp-sass-browser-sync

A starter project including full setup for Jekyll, GulpJS, SASS & BrowserSync
728 stars 169 forks source link

Local BrowserSync IP is overridden in Jekyll when custom permalinks are set #1

Closed kevinSuttle closed 10 years ago

kevinSuttle commented 10 years ago

_config.yml

permalink: /posts/:title

index.html

<a href="{{ post.url }}">{{ post.title }}</a>

The IP set by browser-sync is valid, but Jekyll (?) replaces the IP address/port combo with localhost, which 404s.

Example <a href="http://0.0.0.0:3002/posts/the-right-questions-to-ask-mobile-first-deniers"> click => resolves to: http://localhost/posts/the-right-questions-to-ask-mobile-first-deniers

kevinSuttle commented 10 years ago

I tried setting baseurl and host in my _config.yml, but to no avail. http://jekyllrb.com/docs/configuration/#serve_command_options

shakyShane commented 10 years ago

I'm not sure what you mean - permalinks or not, the URL from <a href="{{ post.url }}">{{ post.title }}</a> should start with / - unless you've set a hostname in jekyll somewhere?

kevinSuttle commented 10 years ago

Nope. Just setting a custom permalink triggers the behavior. Confirmed in your boilerplate repo as well. https://github.com/kevinSuttle/kevinsuttle.github.io/blob/master/_config.yml#L7

kevinSuttle commented 10 years ago

Wait. Now it's working in yours. Hm. Still broken in mine.

kevinSuttle commented 10 years ago

Looks to be just the first post for some reason. Guessing the - in the post title has something to do with it. https://github.com/kevinSuttle/kevinsuttle.github.io/blob/master/_posts/2014-03-04-the-right-questions-to-ask-mobile-first-deniers.md