Install jekyll blog on VPS - jekyll

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.

Related

Hidding Servers Filesystem in Gatsby / ReactJS?

I am about to learn ReactJS.
I want to hide the filesystem structure of my server and only show the project root.
If i go to inspect tools in google-chrome i can see where my project is located on my C: Drive.
Wasnt able to find something about it and Ive got no Idea.
Hopefully, someone can help me.
This is because you are using your computer as a server to serve your site so the inspect tools are able to recognize the origin of the code, assets, and images.
Locally, even using gatsby develop or gatsby build (and gatsby serve) you will always be able to see the root of your project, it happens with all web development files, not only in Gatsby.
In a real scenario, where it's a server (with a domain attached, not your PC) that serves the files you will never see the origin because your site will be placed in the /public or /www of your server. To prepare your project to be deployed, you should run gatsby build command, which will create a /public folder in the root of your project with your code compiled, that folder is the one that needs to be deployed.
This is normal in development environment, for deploy your project try one of these approach in root of you project:
npm build
or
yarn build
This command build an optimized version of your project in build folder, after you can upload content of this folder to your www/plulic folder of your server,

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

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.

Commands to start and stop jekyll site

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.

Site Not Generating New Files

My jekyll site is generating files fine on my computer but is not working at all on the server; I can edit the _site folder to make the changes happen, but it won't generate on the server. I am running jekyll --server with no errors. Any suggestions?
My _config.yml file is:
server: false
permalink: /:year/:title/
Are you running any plugins? Unless you have a server that can run Ruby, plugins won't run anywhere besides locally. GitHub doesn't allow Ruby to be run for security reasons.
I'm surprised it's generating fine locally, since you should probably have server:true. More info on your server setup would be helpful if this doesn't solve your issues.