Commands to start and stop jekyll site - jekyll

Which commands do I need to use to start and stop a jekyll site?
I am trying to use
jekyll build
or
jekyll serve
but I only get build and serve folders created instead.

Both commands create a folder containing your website files already processed and ready to make them available using a web server, with the difference that serve also starts a server that should be used only for development only at http://localhost:4000.
So you can "start" a Jekyll site with jekyll build and then using a server to make those files "available" or you can use jekyll serve and then access http://localhost:4000 to browse your website while you develop it.

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).

Jekyll command bundle exec jekyll serve automatically loads site made previously

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.

How should I set up my repository using GitHub pages so I can see all the files that the site uses?

Can I set up my repository so that I can see all the files (html and css) that my site uses in the repository while still using the GitHub page generator?
I want to use github.com to maintain my multi page site, without installing Jekyll locally.
After you create your github repo go to the settings and select the option to host from the docs directory I found this to be the best method to host my websites that way you done have to mess with different branches unless your in to that thing.
It is not required for you to use Jekyll I personally have never used it. It is to wordpress esq.
What you can use instead of Jekyll is a static site generator or spa to precompile your website content add the static content to the doc directory and push your repo.
Github will generate a url for your that will also be available in your settings. You can also add custom domains.
I recomd using a static site generator performance and seo is the reason.
If you create a Jekyll website on your local machine in /some/path/website/, initialise your Git repository there:
cd /some/path/website/
git init
Then you can push this to your remote Github repository and all of your files will added and viewable.
I don't think you can initialise a Jekyll website in your remote repository though.
From their documentation:
Jekyll's simplified build process with GitHub Pages is one of the biggest advantages of using Jekyll instead of other static site generators. GitHub Pages manages your site's build process with a single push to your site's publishing branch. This is Jekyll's build process for managing your site:
Push file changes to your pages publishing branch (my emphasis)
GitHub Pages publishes your site.
It turned out that the reason I was not seeing many files was that there was only the index.html that I created using the tutorial at GitHub Pages
The reason I thought there must have been other files was that the theme I picked looked a whole lot better than my helloworld.html

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.

Having trouble building jekyll locally and deploying to gh-pages

A few months ago, I set up a site using jekyll and it's hosted on github pages here: http://sethxd.github.io. Originally, I just figured I'd let github pages handle the building because I wouldn't need to use plugins.
Well, now I'd like to use plugins. I've tried to follow a few tutorials online to set up a separate source branch, but I keep running into git errors and conflicts. I'd also like to set up a rakefile or other tool to build and deploy this automatically in the future.
I'm on Windows, running Jekyll 3.0.
GitHub Pages doesn't allow using most of Jekyll plugins for security reasons, but some can be used. The only way to deploy a Jekyll website to GitHub that uses plugins is via _site folder. You only upload the content of this folder, so GitHub won't build the site for you, it will display it as simple html.