Source Code
I am new to Jekyll and got it installed with Grunt and SASS. My issues is that while my test site will show my new posts, When I click on the post link I get an error "Cannot GET /blog/example-post-name".
Grunt doesn't show any errors when running Grunt Serve. However if I run Jekyll serve I get the following errors:
Build Warning: Layout 'article' requested in app/_posts/2015-01-31-optimized-jekyll-site-with-grunt.markdown does not exist.
Build Warning: Layout 'article' requested in app/_posts/2017-03-20-welcome-to-jekyll.markdown does not exist.
Liquid Exception: Could not locate the included file 'blog.html' in any of ["/Users/rich/jekyll-site/_includes"]. Ensure it exists in one of those directories and, if it is a symlink, does not point outside your site source. in app/index.html
jekyll 3.4.2 | Error: Could not locate the included file 'blog.html' in any of ["/Users/rich/jekyll-site/_includes"]. Ensure it exists in one of those directories and, if it is a symlink, does not point outside your site source.
It appears that it cannot find anything in my: _includes, _layouts, ect... folders.
Any help would be appreciated.
Since your template files are in the app/ directory, simply build with app as the source directory.
Add the following to your _config.yml:
source: app
Then run jekyll serve as usual.
Try adding blog.html file in _includes folder or use layout: default in your posts 2015-01-31-optimized-jekyll-site-with-grunt.markdown etc.
Related
I am using Jekyll and GitHub Pages to host a blog. However, I have the following issue:
I have created a new post in the _posts folder and then built the site locally using the following command: bundle exec jekyll serve. When I access the site on localhost:4000, I can click on the link to the new post and access it.
When I commit my changes to the master branch on this repo, it builds without any errors. However, when I now click on the new post, it throws a 404 Error saying the page could not be found.
How do I resolve this error?
You've hardcoded a link.
/functional/2019/03/02/make-use-of-reduce.html
must be :
/functional/2019/03/01/make-use-of-reduce.html
Note : Your index.html looks like it is integrally hard coded. This is not how jekyll is supposed to be used. This can quickly lead to unmaintainable code base.
Tried to change the default theme. First tried the hacker theme, then the primer theme. Got the same error both times:
jekyll 3.5.0 | Error: Could not locate the included file 'head.html' in any of ["/home/david/Sites/dwmclaughlin.com/_includes"]. Ensure it exists in one of those directories and, if it is a symlink, does not point outside your site source.
I created head.html, then ran jekyll serve. Got the same error but this time it was header.html that was missing. I kept going and created the missing files. Got to the CSS file and got this error:
jekyll 3.5.0 | Error: Invalid US-ASCII character "\xE2" on line 5
What am I doing wrong?
As you are including _head.html you probably have a _layouts directory which would prevent the hacker theme to load properly, remove the _layouts directory (or copy that directory from the jekyll-theme-hacker folder) and then it should work.
You probably would have to fix the layout used in posts to use the default layout (they probably has the post layout now)
I created a simple jekyll site as https://github.com/nagachinta/nagachinta.github.io, but throws 404 error. I observed the git commits I made and the commits in the git says.
" A file was included in about.md that is a symlink , doesnot exist in your '_includes', directory."
The file is not a symlink, it's just a real file.
The index files , etc are real files not symlinks.
You're using Jekyll 3.2 locally. This means that you're now using gem based themes. No more _includes, _layouts and _sass folder when you do your jekyll new.
On the other side github pages uses Jekyll 3.1.6 (reference).
So when you pull a site created without _includes, _layouts and _sass folders on github pages, it results in build errors. Your site is not created and you get 404s errors.
If you want to be sure that a site developed locally to work on github pages, you can go with gh-pages gems. See install instructions here.
If you just want to stay with jekyll 3.2 locally and copy themes's files, you can have a look at this answer.
I have a simple website and tried to add a Jekyll blog in it in a new folder blog thus I have run jekyll new blog in the folder /path. However when I'm running the command jekyll build in /path I have these errors:
$ jekyll build
Configuration file: none
Source: /path
Destination: /path/_site
Generating...
Build Warning: Layout 'post' requested in blog/_posts/2015-06-14-welcome-to-jekyll.markdown does not exist.
Build Warning: Layout 'default' requested in blog/index.html does not exist.
Conversion error: Jekyll::Converters::Scss encountered an error converting 'blog/css/main.scss'.
Conversion error: File to import not found or unreadable: /blog/_sass/base.scss. Load paths: on line 47
I solved the first problem (Configuration file: none) by moving _config.ymlin the parent folder, however I still have problems when requesting layout using
---
layout: default
---
The imports in main.scssare also not working (last error).
If I'm doing the same command jekyll build in /path/blogafter moving again _config.yml, I have no errors. Does someone know how to be able to do a jekyll buildin the parent folder with the configuration I have? Do I have to entirely change the architecture of my website to include a Jekyll blog in it?
You config.yml is in /path with
source: /_jekyll
destination: /blog
baseurl: /blog
Your jekyll sources are in /path/_jekyll.
And you generated files will be in /path/blog.
Ready to deploy !
With jekyll-2.5.3 I'm able to run "jekyll serve --watch" to generate my site and preview it. However, since upgrading to jekyll-3.0.0.pre.beta1 I now see the following error
jekyll serve --watch
Configuration file: /wrk/git/blog/_config.yml
Deprecation: Auto-regeneration can no longer be set from your configuration file(s). Use the --[no-]watch/-w command-line option instead.
Deprecation: The 'pygments' configuration option has been renamed to 'highlighter'. Please update your config file accordingly. The allowed values are 'rouge', 'pygments' or null.
Source: /wrk/git/blog
Destination: /wrk/git/blog/_site
Incremental build: enabled
Generating...
Build Warning: Layout 'nil' requested in atom.xml does not exist.
Build Warning: Layout 'nil' requested in rss.xml does not exist.
jekyll 3.0.0-beta1 | Error: Is a directory # rb_sysopen - /wrk/git/blog/_site/tech/2013/04/24/blog
I've checked and I have read/write/execute permissions, so I don't think it's a permission error. If it helps, here's my source and layout (https://github.com/minhongrails/blog), which has directories like _includes, _layouts, _posts, index.html, etc in the root directory.
Does anyone have any ideas how to resolve this? Thanks!
Build Warning: Layout 'nil' requested in atom.xml does not exist.
Build Warning: Layout 'nil' requested in rss.xml does not exist.
I think the layout should be null, not nill.
For some reason I needed to move my source files into a "source" subdirectory as specified in the _config.yml. Here's some of the _config.yml that I had to modify
source: src
# needed to also update this b/c it was generating inside the "source" dir
destination: _site
In Jekyll 2 I didn't need to do this but I guess it's now necessary in Jekyll 3? Here's a Github issue with more details: https://github.com/jekyll/jekyll/issues/3248