Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enabling gem causes all HTML to be downloaded in the browser #3

Open
ghost opened this issue Oct 31, 2016 · 11 comments
Open

Enabling gem causes all HTML to be downloaded in the browser #3

ghost opened this issue Oct 31, 2016 · 11 comments
Assignees

Comments

@ghost
Copy link

ghost commented Oct 31, 2016

After updating the gem to the latest version, a new issue cropped up. When serving up the site with:

$ jekyll serve

the site appears fine in the browser at 127.0.0.1:4000. But if I add the gem to my Gemfile (and do nothing else), HTML pages are downloaded instead of displayed in the browser. Doesn't matter what page I try to bring up, the whole site won't display. If I then remove the gem and run jekyll serve, the site displays correctly.

@alfanick alfanick self-assigned this Nov 1, 2016
@nhoizey
Copy link

nhoizey commented Jan 17, 2017

I still have the same issue.

I am using Jekyll 3.3.1.

@joshkissel
Copy link

@dstout @nhoizey @alfanick Any fix or work around for this? TIA!

Seems to connected to jekyll serve because if you just build the site the gem works as expected.

I noticed that with the gem the base url for the site was not being edited correctly when being updated in _site.

@ghost
Copy link
Author

ghost commented Feb 23, 2017

@joshkissel I tried this on a 1000+ post site, and the publish time went from ~20 sec. to over 5 min. It doesn't store the results of its calculations, so every publish took that long. I like the concept, but this plugin didn't work for my needs.

@nhoizey
Copy link

nhoizey commented Feb 23, 2017

@dstout how is it related to this issue?

@ghost
Copy link
Author

ghost commented Feb 23, 2017

@nhoizey Relevant because the developer is MIA.

@nhoizey
Copy link

nhoizey commented Feb 23, 2017

@dstout well, I really think you should have open another issue for this…

@jamesbrewerdev
Copy link

Not a final solution, but I got around this problem by replacing jekyll serve --watch with jekyll build --watch and running a web server from the _site directory.

Steps:

  1. Open a new tab in your terminal and cd to the root directory of your project.
  2. Run jekyll build --watch or jekyll build --watch --drafts if you want to see your drafts.
  3. Open another tab in your terminal and cd to <root-directory>/_site.
  4. Run a Python web server:
  • If you have Python 2.x, run: python -m SimpleHTTPServer 4000
  • If you have Python 3.x, run: python -m http.server 4000
  1. Load http://localhost:4000/ as normal.

Hope that helps someone.

@darekmydlarz
Copy link

darekmydlarz commented Nov 9, 2017

Hey, I have the same issue, you can see my code at this branch:
https://github.com/dmydlarz/blog/compare/related-posts?expand=1

The Content-Type header is changed to application/octet-stream after applying the plugin.

/cc @alfanick

@khliu1238
Copy link

khliu1238 commented Nov 22, 2017

I encountered this error and digged in a little bit. It was related to this issue. An easy hack would be to explicitly set separator for io.each to avoid being messed up by change made in Packable required by nmatrix required by jekyll-related-posts

In /usr/lib/ruby/2.3.0/webrick/httputils.rb change the following in load_mime_types:
io.each{ |line|
to:
io.each(sep=$/){ |line|

should work fine.

@darekmydlarz
Copy link

darekmydlarz commented Nov 30, 2017

@khliu1238 I use rbenv and ruby 2.1.3 on macOS. How can I apply this fix?

EDIT
I found it at: ~/.rbenv/versions/2.1.3/lib/ruby/2.1.0/webrick. But I believe there should be a better fix for this ;)

@khliu1238
Copy link

khliu1238 commented Dec 1, 2017

I personally think Packable shouldn't overwrite io functions and break other gems that include it and use those functions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants