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

Default ASSET_PATH fails for latest jekyll version #290

Closed
brbrr opened this Issue Nov 14, 2015 · 11 comments

Comments

Projects
None yet
@brbrr

brbrr commented Nov 14, 2015

serving default jekyll-bootstrap blog with latest (3.0.0) jekyll will not load assets for blogs i.e. core-samples/lessons/2011/12/29/jekyll-introduction
Looks like with new verison Jekyll/Liquid front matter do not inherit theme variable from layouts, thats why page.theme.name is empty.

as workaround its possible to define theme for every post, or define ASSET_PATH directly in config.

btw - why not to define theme variable in config file to use in JB/setup ?

UPD: as for jekyll 3.0 layout variables now accessible with layout.variable. So updating JB/setup's capture of ASSET_PATH would resolve issue but only for posts.

I'm not sure why, but it still wont work for any layout: page pages.

Here is my workaroud

# JB/setup
{% capture ASSET_PATH %}{{ BASE_PATH }}/assets/themes/{{ site.JB.THEME }}{% endcapture %}

# _config.yml
JB :
  THEME : bootstrap-3
@tops357

This comment has been minimized.

tops357 commented Nov 15, 2015

Had the same problem. The solution for the Bootstrap Theme included the above hack and:

  1. Rename /assets/themes/bootstrap-3 to bootstrap
  2. Rename /assets/themes/bootstrap/css to css-backup
  3. Move /assets/themes/bootstrap/bootstrap folders (css, fonts, js) to /assets/themes/bootstrap

Not very pretty, but it works for my site.

@wesleywerner

This comment has been minimized.

wesleywerner commented Nov 28, 2015

@tops357 if you replace your #2 with:

mv /assets/themes/bootstrap/css /assets/themes/

then if will also fix the style.css file. But I see switching to another theme breaks this hack too.

What works for me is:

  1. rake theme:switch name="bootstrap-3/twitter"
  2. define ASSET_PATH directly in config as pointed out by @brbrr - ASSET_PATH : /assets/themes/{bootstrap-3/twitter}

Unfortunate it is a double-barrel step but it works.

@bdeanindy

This comment has been minimized.

bdeanindy commented Dec 28, 2015

A quick cheat for this (if you just need to get things working and you want to use a theme, for instance I was using the hooligan theme which I really like).

I just opened the /_config.yml and changed ASSET_PATH to be /assets/themes/hooligan.

That seemed to do the trick (for now until I can figure out what the heck is causing the theme.name value to get lost).

I know this is a total hack, but I was looking for a "single location" to make the changes I needed and that seemed to do the trick (so I could leave all the other structure alone).

Hope it helps someone.

qh added a commit to qh/jekyll-bootstrap that referenced this issue Jan 15, 2016

Fix issue plusjade#290.
(plusjade#290)
solution: if page.theme.name unavailable (empty) use layout.theme.name

@qh qh referenced this issue Jan 15, 2016

Merged

Issue 290 #293

@wizardxbl

This comment has been minimized.

wizardxbl commented Jan 15, 2016

I have the same problem.
when i run jekyll serve
i can see the index.html for first page, it has right theme
but the other pages has no theme.

the right link is like is:

but the wrong link is:

i try the layout.theme.name but not work for me.....

UPD:
Sorry, the layout.theme.name is worked!
for index.html , page.theme.name is work
and for other pages, layout.theme.name is work
so the patch #293 is well done. if -- else for two situation.

thanks a lot.

@seoyoochan

This comment has been minimized.

seoyoochan commented Jan 25, 2016

this is still not working... i had to manually set ASSET_PATH with the theme name

@lefttree

This comment has been minimized.

lefttree commented Feb 1, 2016

Have the same problem when I run jekyll serve on Mac. It's always trying to find assets at /assets/themes/ directory instead of /assets/themes/<theme name>.

Hack as above to manually change the ASSET_PATH, hope for a better solution.

@yanhaijing

This comment has been minimized.

yanhaijing commented Feb 2, 2016

i have same question,let me try #293,it work,good job!!!

@einverne

This comment has been minimized.

einverne commented Feb 2, 2016

@qh 's patch is working. See qh@a1d17ef or #293

@brbrr

This comment has been minimized.

brbrr commented Feb 2, 2016

Closing, as #293 was merged in to develop branch.

@brbrr brbrr closed this Feb 2, 2016

einverne added a commit to einverne/einverne.github.io that referenced this issue Feb 2, 2016

reznoa added a commit to reznoa/reznoa.github.io that referenced this issue Feb 2, 2016

ploeh added a commit to ploeh/ploeh.github.com that referenced this issue Feb 3, 2016

Set ASSET_PATH in _config.yml,
as a hack to overcome troubles with rendering in GitHub Pages. See
plusjade/jekyll-bootstrap#290 for more
information.

azu added a commit to ecmascript-daily/ecmascript-daily.github.com that referenced this issue Feb 6, 2016

VincentTam added a commit to VincentTam/blog2 that referenced this issue Feb 14, 2016

Fix issue #290.
(plusjade/jekyll-bootstrap#290)
solution: if page.theme.name unavailable (empty) use layout.theme.name

bkloppenborg added a commit to bkloppenborg/bkloppenborg.github.io that referenced this issue Feb 18, 2016

leoman730 added a commit to leoman730/notetoself that referenced this issue Feb 19, 2016

TimSoethout added a commit to TimSoethout/TimSoethout.github.io that referenced this issue Feb 21, 2016

mrpippy added a commit to bslabs/bslabs.github.io that referenced this issue Feb 29, 2016

@dsposito

This comment has been minimized.

dsposito commented Mar 4, 2016

Thanks for documenting a fix here. 👍 Setting ASSET_PATH in my config did the trick.

hroncok added a commit to hroncok/eng.hroncok.cz that referenced this issue Mar 28, 2016

andreasaronsson added a commit to andreasaronsson/andreasaronsson.github.com that referenced this issue Apr 2, 2016

@1kohei1

This comment has been minimized.

1kohei1 commented Apr 11, 2016

Thanks for this issue!
It was trouble some last several months!

manojo added a commit to manojo/manojo.github.com that referenced this issue Apr 19, 2016

WIZARDISHUNGRY added a commit to WIZARDISHUNGRY/jonwillia.ms that referenced this issue Apr 22, 2016

pogin503 added a commit to emacs-jp/emacs-jp.github.com that referenced this issue Jun 3, 2016

Fix css not found
CSSが読み込まれない理由としては、 {{ page.theme.name }} が空になってしまうようで、linkタグが
<link href="/assets/themes//bootstrap/css/bootstrap.min.css" rel="stylesheet">
このように生成されてしまいます。

以下を参考にして、_include/JB/setup の {{ page.theme.name }} を
{{ layout.theme.name }} に変えたらCSSを読み込みました。

[Default ASSET_PATH fails for latest jekyll version #290](plusjade/jekyll-bootstrap#290)
[Problems with {{ ASSET_PATH }} in Jekyll 3.1.1 #295](plusjade/jekyll-bootstrap#295)

Error Message:
[2016-06-04 01:47:15] ERROR `/assets/themes/bootstrap/css/bootstrap.min.css' not found.
[2016-06-04 01:47:15] ERROR `/assets/themes/css/style.css' not found.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment