Jekyll command bundle exec jekyll serve automatically loads site made previously - jekyll

I am working with Jekyll on a new project. I created a new project by running jekyll new [folder name] then ran bundle exec jekyll serve. However every time I run that command files from a former jekyll project get put in the folder! I am not using this project anymore (more of me learning jekyll on my own) so I even deleted the folders. Still, this old site files get loaded.
I even tried serving the site over a different port number (4001, not 4000), and uninstalling and reinstalling the jekyll gem. What is going wrong? Thanks!

This is resolved.
I ended up creating a blank default index file in the root. When I did this and ran jekyll serve, the index file of the former site ceased to be generated. Still generated another page from the site, but I am assuming I can prevent that the same way.

Related

jekyll on github pages ignores custom layout

I'm trying to clone the repo https://github.com/TowerofHanoi/towerofhanoi.github.io on my GitHub, based on the website https://toh.necst.it and publish it on a new GitHub pages instance. I'm doing this to check that a new article is well formatted for publication.
I'm having trouble generating the website on GitHub pages, the site is somehow bad: https://mencucci.github.io/towerofhanoi.github.io/ (my repo: https://github.com/Mencucci/towerofhanoi.github.io).
Locally on my Ubuntu machine, I can get the site to render properly with the following commands:
bundle init
bundle add jekyll
rm -rf \_site && bundle exec jekyll serve --verbose
I couldn't get the remote to build properly.
I tried:
adding a valid theme (no changes)
using a custom build action (no changes)
I noticed a difference in the logs: local, and github. The local log references the /_layout directory, but the remote one does not. Maybe it doesn't "see" the theme?
Thank you for your time
Figured it out, my main issue was that I was running the site using the default url, which hosts the site at <username>.github.io/<repo_name>. Some hard coded elements assumed that the site be hosted at domain root instead. I solved my issue by using a custom domain, which mapped the to the base domain (empty path).

How do I get jekyll to run without server?

In order for me to view the site, it looks like I need to run bundle exec jekyll serve and open the server address in my web browser.
How do I go about having the viewing the site without running the command. I've went into the _site and clicked on the index.html file without running the server and noticed this.
Do you have any suggestions on how to go about this? There is no styling and none of the links works.
Is it possible to just place the .md file in posts folder and be able to view it without having to run a server still styled?
Any help would be appreciated.
You can build your static files using bundle exec jekyll build, then all your files will be in _site.
Now you need a server to serve theses static files. You can install something like nginx or apache.
Once it's done you'll want to copy your static files that are inside _site under /var/www/html/ and make sure your server is started with a command like:
sudo service nginx start

bootstrapped jekyll project fails to load its auto-generated css

I've created a new jekyll project precisely following the simple command sequence at https://jekyllrb.com/. However it seems like the server is not looking for the right main.css:
GET http://example.com/css/main.css 404 (Not Found)
This error in the browser console seems to imply an irrelevant domain for a local project, so I wonder whether those instructions just mentioned are not what one should do for bootstrapping and running/testing a jekyll project on your local server. In that case, what is the right procedure for working locally? and is there an automated command for setting a different host name for deploying to a real server?
I am using a fresh install of jekyll 3.2.1.
Thanks!
Dirty temporary patch (because of this issue).
In _config.yml, set url: http://matanster.github.io/bloglike or wathever is your production url.
Create a config_dev.yml and add url: http://127.0.0.1
Locally, you can serve with :
bundle exec jekyll serve --config _config.yml,_config_dev.yml

Install jekyll blog on VPS

I'm trying very hard to install Jekyll blog
on my VPS because i want to host my website on my VPS not on github pages also I have followed the steps here
https://jekyllrb.com/docs/deployment-methods/
but i didnt succeed is there any one can help me to step by step install jekyll blog on my hosting
By looking at the image you attached in your comment, you probably uploaded jekyll files and not the static files which exists in the folder _site.
So what you have to do is, install jekyll using npm or RubyGems in your own machine, setup everything in your jekyll files, then use the command jekyll serve to build and check if everything is generated successfully by going to localhost:4000, if everything went well, then go to your jekyll directory and take the files inside _site and upload them to your webhost using FTP
You might want to consider to NOT install Jekyll on your VPS.
You can install it on your local machine. Jekyll is a static site generator and generates flat HTML files in the '_site' folder. This folder can be easily transmitted through FTP to your VPS after an update.
Another way to let your VPS host your Jekyll site and NOT install Jekyll, is to let the guys from CloudCannon do the Jekyll part and let them connect to your VPS through FTP. CloudCannon will automatically push the static site to your VPS on update. You will get their CMS for free as a bonus.

jekyll not generating index.html

I have been using Jekyll for my blog and it has been working fine. Now I am trying to add new posts from a computer running Ubuntu 14.04 and Jekyll 2.4.0. The problem is that, only on this computer, it does not generate index.html in _site.
I can't find anything in the documentation that helps, and in any event, I'm using git so I have the same configuration on all of my machines.
So the question is: How does one turn off generation of index.html in Jekyll, and how can it be turned back on?
[Update: I did gem uninstall jekyll followed by gem install jekyll, rebuilt the site, and everything works fine. The original install must not have completed properly.]
To turn generation off you can remove this file. Or to use static index.html file remove markdown section enclosed with double triple --- in header (in this case static index.html will be parsed). Also mention filename it in exclude: section of _config.yml to avoid copying to _site folder.