-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
{{ ASSET_PATH }} only seems to work in _includes/theme/themename/default.html, leaves off theme name in post.html and page.html #113
Comments
Same issue for me. Thanks for pointing out your workaround! |
Actually - here's how to do it. The default template explicitly declares the theme in the YAML front matter as: theme : Include that in your layout and you should be golden. |
I am having the same issue. I've placed a png in:
but I have the YAML front matter in the theme, I'm hoping to make my theme public so manually declaring the theme asset location in the |
the issue appears to be in _includes/JB/setup The var |
+1 |
Still an issue... Just as @daithi-coombes described it. |
+1 |
Housekeeping. I'll review the comment stream and @fujii's tweak. Will create PR after review / testing. |
OK. Discussion time. The fix from @fujii works as expected. There's one snag, though. And I don't think it's a show-stopper. Somewhat related to #227, but barely. There's an issue with variable scope and ASSET_PATH. The fix will allow the themes to access assets using the variable, but actual posts, drafts, and pages won't have a valid ASSET_PATH. And I'm not 100% convinced that they need it. Happy Path (for templates): Gray Area (for posts, pages, and drafts): If that's not an issue for you guys, I'm fine with just sticking a footnote somewhere that says that ASSET_PATH is only valid for themes. Pages, posts, and drafts are on their own. |
Tested without issue. No activity on #113 comments. Merging.
Tested without issue. No activity on comments. Merged. |
Post pages were broken with Jekyll 3.0, fix this by applying this patch: plusjade/jekyll-bootstrap@c3d3cbe issues: plusjade/jekyll-bootstrap#113 plusjade/jekyll-bootstrap#290
Workaround for known bug plusjade/jekyll-bootstrap#113
…34825422ec05b704f7114d.
To reproduce:
rake theme:switch name="twitter"
assets/themes/twitter/
_includes/themes/twitter/page.html
to include the image path using the liquid variable {{ ASSET_PATH }}:_includes/themes/twitter/default.html
to includefoo.jpg
Generate a new page using
rake page name="bar.html"
Start Jekyll using
jekyll --server --safe
Navigate to http://localhost:4000
Expected Result
foo.jpg
appears above the nav bar: screenshotNow, navigate to http://localhost:4000
Expected Result
foo.jpg
appears above the nav bar (from default.html template) as well as under the H1Actual Result
foo.jpg
appears above the nav bar (from default.html template) but shows as a broken image under the H1. screenshot. The image tag is rendered as<img src="/assets/themes//foo.jpg">
, missing the theme directory.I can reproduce this issue on
includes/themes/[any theme]/page.html
andincludes/themes/[any theme]/post.html
.If I manually set asset_path in _config.yml, it behaves as expected.
The text was updated successfully, but these errors were encountered: