Skip to content
This repository has been archived by the owner on Nov 30, 2024. It is now read-only.

Default ASSET_PATH fails for latest jekyll version #290

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

Default ASSET_PATH fails for latest jekyll version #290

brbrr opened this issue Nov 14, 2015 · 11 comments

Comments

@brbrr
Copy link

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
@aaronxn
Copy link

aaronxn 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
Copy link

@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
Copy link

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
(plusjade#290)
solution: if page.theme.name unavailable (empty) use layout.theme.name
@qh qh mentioned this issue Jan 15, 2016
@wizardxbl
Copy link

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
Copy link

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

@lefttree
Copy link

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
Copy link

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

@einverne
Copy link

einverne commented Feb 2, 2016

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

@brbrr
Copy link
Author

brbrr commented Feb 2, 2016

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

@brbrr brbrr closed this as completed 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
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 pushed a commit to VincentTam/blog2 that referenced this issue Feb 14, 2016
(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
phuang07 added a commit to phuang07/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
Copy link

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
Copy link

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
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.
asfgit pushed a commit to apache/bahir-website that referenced this issue Mar 14, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests