Jekyll theme error - jekyll

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)

Related

How to install this Jekyll theme correctly in order to make custom adjustments?

I'm a total newbie when it comes to Jekyll, and have encountered a big problem. I'm probably doing something wrong or missing something, but what?
I find it very confusing trying to install the "Agency Jekyll Theme" which is the first theme I'm trying out. Mostly because there are several ways to do it, the commands don't add up and there is a lot of "you can do this" embedded into what you actually have to do to install it.
These are the guides I've been following:
https://jekyllrb.com/docs/step-by-step/01-setup/
https://www.rubydoc.info/gems/jekyll-agency/1.2.0
http://jekyllthemes.org/themes/agency/
Basically, I've tried all the 3 possible ways to install it without success.
I'm running on Windows.
My problem:
jekyll serve (ran in my site folder) creates a _site folder and content in the subfolders css, img and js. Nothing else is created, not index.html, and other files needed directly under _site folder.
In my site root folder, there are only _config.yml and Gemfile, after completing the initial steps.
There seems to be a problem with actually downloading the full theme into my root folder. When I manually download the agency-jekyll-theme-starter-master.zip and extract the entire content in my root site folder, there is index.html, _data folder, etc. However, in the assets folder, there is only an img folder.
As a result, when I open http://localhost:4000/agency-jekyll-theme-starter/ in a browser there is only a directory listing with the folder "assets".
Where do the css folder and its content come from that generates under _site?
My workaround:
I run jekyll build so that the site in its entirety is placed under _site folder. However, with this process, the whole point of using Jekyll is lost because I have to edit the generated HTML files, CSS files, etc. To change simple stuff like renaming the page/navigation "Services" to another word I have to go through the HTML file and replace all occurrences
My successful attempt to reproduce your issue:
I tried this method from http://jekyllthemes.org/themes/agency/
Using the Starter Template
This is the fastest and easiest way to get up and running on GitHub Pages. Simply generate your own repository by clicking here, then replace the sample content with your own and configure for your needs.
The starter template (that is also linked on the page above) allowed me to start a code space and commit the repo content into my new branch.
I could reproduce your problem, there were no styles when running jekyll serve.
The reason for the issue:
The problem is the baseurl in the _config.yml file. It points to a relative path that does not exist in your repository. Your baseurl / path is "", because you run your server from the root folder, most probably both locally and later remotely using GitHub pages.
The solution for the issue:
In the _config.yml file in your repo, change this one line
from
baseurl: "/agency-jekyll-theme-starter" # the subpath of your site, e.g. /blog
to
baseurl: "" # the subpath of your site, e.g. /blog
Check out https://github.com/cadamini/jekyll-agency-test if you like.
I hope this was understandable and helpful and that you can solve your issue with these instructions. Don't hesitate to comment for further clarification.

How to get rid of "WARNING: no homepage content found in homepage.md"?

I'm getting started with KSS using CSS in Depth by Keith Grant as a reference.
At 10.1.4, the author writes
Inside the css directory, create a new file at css/homepage.md. This will be a file in markdown that serves as an introduction to the pattern library. Copy this listing into the file.
# Pattern library
Page heading This is a collection of all the modules in our stylesheet. You may use any of these
modules when constructing a page.
Now run npm run build and the warning about home page content should be gone.
The point is that the warning is not gone for me,
WARNING: no homepage content found in homepage.md.
and indeed opening docs/index.html in the browser shows the content of the directory.
In case it might be related, here's the full output of the npm run kss command:
> simplemodule#1.0.0 kss
> kss --config kss-config.json
Version 9 of Highlight.js has reached EOL and is no longer supported.
Please upgrade or ask whatever dependency you are using to upgrade.
https://github.com/highlightjs/highlight.js/issues/2877
WARNING: no homepage content found in homepage.md
I have solved this problem.For details,please refer to the official demo homepage.md
note:The homepage.md file should be placed at the project root directory
to visit official demo

Keep Github Pages and Hugo output in same directory?

I recently decided to generate a Github Pages website using Hugo. I wanted to keep Hugo input (configuration, themes) in the same directory as the output, for easy management. Unfortunately, Github Pages's CI complains when I try to turn public directory into a symlink into ., as well as when I create a hugo directory and make hugo/public a symlink to ... Are there any other options to keep configs and output in the same directory, bypassing that error?
I solved the problem by putting the following in my config.toml file:
publishDir = "."
As a result, I didn't need the "public" directory pointing to ..

Jekyll not finding blog posts

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.

Jekyll generates empty files

I recently pulled a copy of my github pages site to a new Windows machine and when I run jekyll all the files get created in _site but any that use a layout are empty.
I have tried jekyll build --layouts C:\Path\to\site\_layouts which still resulted in empty files.
Its compiling SASS no problem and copying the files with no front matter. Its generating empty files for all the posts and drafts so its seeing _posts and _drafts which makes me think it should be able to see _layouts but its not...
anyone come across this issue?