generator-jekyllrb
generator-jekyllrb copied to clipboard
Css and Js files link to wrong directory for project Github Pages
My github page's css is being generated at http://mountainview-webdesign.github.io/lifestonechurch/main.f4ca.css, but in the index.html it points to http://mountainview-webdesign.github.io/css/main.f4ca.css
I can't figure out how to get it to work. I would think that this should work out of the box. What am I doing wrong?
Did you check your Gruntfile.js for problems with paths?
No, I didn't know that was necessary. What part of the Gruntfile.js should I change to make this work?
I don't know, can't really help without your code.
Here it is. https://github.com/Mountainview-WebDesign/lifestonechurch Also, you can check out the site itself and see that it can't load the css. http://mountainview-webdesign.github.io/lifestonechurch/
I think the only thing I've changed in the Gruntfile is the buildcontrol.dist.options.remote. Also, I tried commenting out the usemin stuff, but I went back.
http://jekyllrb.com/docs/configuration/
you need baseurl: /name-of-github-project, in other words baseurl: /lifestonechurch
Should that go in _config.build.yml or _config.yml?
That still isn't working for me, but it looks like I've also got another problem on my hands. It's not generating the css files at all in my gh-pages branch.
This generator won't help you much if you are not already familiar with jekyll, there is a ton of documentation for github pages out there.
I am familiar with jekyll. I've created sites with it before, which is why I wanted to streamline my workflow with this generator.
But I'm not sure what's happening in this Gruntfile, what belongs in _config.build.yml as opposed to _config.yml, and what in the Gruntfile.js that I should change. It seems to me that I should keep my hands off of the Gruntfile.js so that I can update my code when there is an update to the generator.
I would have expected this generator to work out of the box with github pages on a project (repo), and if not, I would expect some specific instruction on the readme to help me set it up.
Does that make sense?
I think the baseurl setting goes in _config.yml and that you could use jekyll serve to test it out locally.
I think it actually goes in _config.build.yml because it breaks it for me locally if I change it in _config.yml.
I think it could be an issue with grunt-usemin. Because even if I say:
<link rel="stylesheet" href="{{site.baseurl}}/css/syntax.css">
It always changes the path to:
<link rel="stylesheet" href="/css/main.f4ca.css">
http://stackoverflow.com/questions/18964875/how-should-i-configure-grunt-usemin-to-work-with-relative-path https://github.com/yeoman/grunt-usemin/issues/447 https://github.com/yeoman/grunt-usemin/issues/184 https://github.com/yeoman/grunt-usemin/issues/368
But my question would be, has anyone ever gotten this generator to work with github pages projects?
Yes, I got it to work by shimming the url...but now in a new project grunt-cdn explicitly requires cwd and dest paths.
I have been working on this https://gist.github.com/mashcode/27643189f1f42dcbb176 but have hit a wall when it stalls at the cdn task. Maybe the paths are wrong? Requires [email protected] node_modules/grunt-cdn
Marc
Hi, A work around I just implemented is to use a CNAME alias. So instead of [ user.github.io/whatever ] it can redirect to [ whatever.myTLD.foo ]
This will obviously require the ability to manage your own dns records.
That's true, a custom domain would solve the problem. What do you mean you got it it work by "shimming" the url?
On Feb 19, 2015, at 1:47 PM, Adam Harris [email protected] wrote:
That's true, a custom domain would solve the problem. What do you mean you got it it work by "shimming" the url?
Hey Adam, Best to look at the gist I posted. It essentially prepends the project path to media, eg css/js files in the grunt build execution at min. Typically used for CDN URL hacking, hence the name. In theory it should work with any path.
Does CNAME point all requests, even GitHub.io, to the alias? Or does one have to write a rule?
Marc
Reply to this email directly or view it on GitHub.
Ok, so this is the part you added: https://gist.github.com/mashcode/27643189f1f42dcbb176#file-gruntfile-js-L198-L208
Perhaps, this jekyll generator should consider using grunt-cdn?
On Feb 19, 2015, at 2:19 PM, Adam Harris [email protected] wrote:
Ok, so this is the part you added: https://gist.github.com/mashcode/27643189f1f42dcbb176#file-gruntfile-js-L198-L208
Perhaps, this jekyll generator should consider using grunt-cdn?
Sure, if I can figure out why the task hangs.
Well in all fairness the system is really designed for dev => production flow. A vanilla Jekyll can handle the majority of the factions and can serve up static project pages
Marc
Reply to this email directly or view it on GitHub.
What do you mean by a "dev => production flow"
On Feb 19, 2015, at 4:06 PM, Adam Harris [email protected] wrote:
What do you mean by a "dev => production flow"
I know, sorry, I realize now a bad choice of words and to be honest not real worthy of definition, suffice it to say the Jekyllrb threadbare workflow to me looks like:
local check/build => dist remote check/deploy => prod
Hope it makes sense, Marc
Reply to this email directly or view it on GitHub.
+1 on this issue
+1
+1
I'm not longer using this project, so I'm going to unsubscribe from notifications, but if other people are still having this issue, I'll leave it open.