I’m thoroughly new at Jekyll, so I’d like to ask you some specific questions.
I’m hosting my page (a personal one) at GitHub Pages. Can I deploy single page web app, let’s say a weather app connected to external APIs, in that hosting service using Jekyll? My thinking is that is possible, but I’d like to know if anyone knows something about this I should consider.
What’s the best folder structure I can use at GitHub Pages? When I use the command Jekyll new my-site I get this template as a result:
Is there anything else I need for that hosting? Or for any Jekyll project for that matter really. I’m a little confuse about what’s the best folder structure I can use for my site, and where should I place my scripts (Javascript) and styling (sass, and css).
I’ve seen some projects at GitHub pages where the files are stored at github.com/username/reponame inside a secondary branch, usually named gh-pages. Do they do that just for keeping the code from the project repo separated from the code that belongs to their GitHub site?
When deploying the site, I know that the files I’m going to use are sent to the _site folder, by default. Are these the files that I’m going to publish in the server? For any Jekyll project. What’s the workflow I have to follow. On the other hand, I’ve know that any compilation and deployment at GitHub Pages is made from the remote repository. Any comments on this?
What dependencies for Jekyll can I use at GitHub Pages? Where’s their documentation? I remember reading somewhere about this, but I lost track where it was that I did so.
Jekyll is a static site generator. If you want to display the weather based on a visitor’s location you probably want to use a dynamic site generator instead.
The javascript and CSS is kept under the assets directory as you can see here from my pippim.githib.io Jekyll website:
I’m not sure of putting your website in a place other than <YOUR_NAME>.github.io
I don’t know about publishing to _site directory directly. It is all automatically updated whenever I change a file in the repo. In about 2 minutes (it used to be 20 seconds with only a few files) GitHub Pages rebuilds the website to _site.
Feel free to visit the home page of my website linked above for methods to programmatically publish third party website data into your own website. For example the 1,200 blog posts on the Pippim Website were actually written on the Stack Exchange Website and converted into Jekyll Format.
Firstly, this site would be accessible at `https://username.github.io/reponame/
Secondly, in majority of the cases, it is not to separate project code from GitHub site code. The repository is an entirely different project and not necessarily a Jekyll site source.
That said, at times you may see different code in a main branch and gh-pages branch.
In such cases, gh-pages is for all intents and purposes, the generated HTML files served by GitHub.
You have two choices. Either have GitHub Pages build and deploy your Jekyll site. Or you build the site locally at your end and have GitHub Pages deploy / serve your generated contents. In the latter case, yes, you have to commit and push the contents of the _site.