I run a small blog based on Jekyll in GitHub Pages. Trying to fix an error at rebuilding it, I deleted the _site folder, which made all posts disappear from it.
It's rebuilding the site now, great, but it shows no posts at all — even that all of them are in _posts folder.
What am I missing here?
For reference: https://github.com/rghedin/rghedin.github.io
Thanks!
_site folder contains the generated files, it is not necessary to have them in the repo as github pages will build it.
If you deleted it and now there are no posts showing at the homepage, then there should be another error, try to run a local instance to debug it or wait for github pages to rebuild it and show the latest version, it could take some minutes to show the latest changes online.
Related
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.
Before we start, I do know custom hooks are not executed by Github pages, I'm suffering this issue locally(bundle exec jekyll serve).
I manage my own Github pages, and I found a great post about Jekyll hook that I wanted to try it out by myself.
I followed the instruction, first created _plugins folder at the root of my repo,
and created my own *.rb file.
But my hook is not executed at all!
I even downloaded the source file of the example blog, but I couldn't notice any difference that might cause this issue.
FYI, local serve of the example blog worked well with all the hooks executed.
If you can help me on this issue, it would be very much appreciated. Here is the WiP commit of my blog.
Thank you.
I recently was able to get Jekyll serve --watch to work. Now I see that that there are duplicates of most of my blog posts. I've tried to moving posts around, deleting them from the _site folder, checking for duplicates in the website. But nothing has been working. Is this typical of Jekyll serve? If I build, will the duplicates also be published?
No, this is not a tipical behaviour, posts should appear once.
Also watch is turned on by default when serving the site locally with jekyll serve.
Remove the _site folder and serve the website again.
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 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?