# Questions about Jekyll and GitHub Pages (folder structure and other questions)

**URL:** <https://talk.jekyllrb.com/t/questions-about-jekyll-and-github-pages-folder-structure-and-other-questions/6850>\
**Category:** Help\
**Created:** [January 1, 2022, 8:26pm UTC](https://talk.jekyllrb.com/t/questions-about-jekyll-and-github-pages-folder-structure-and-other-questions/6850 "2022-01-01T20:26:40Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![carloswm85](https://yyz2.discourse-cdn.com/flex030/user_avatar/talk.jekyllrb.com/carloswm85/32/4231_2.png) [@carloswm85](https://talk.jekyllrb.com/u/carloswm85)\
**Post date:** [January 1, 2022, 8:26pm UTC](https://talk.jekyllrb.com/t/questions-about-jekyll-and-github-pages-folder-structure-and-other-questions/6850/1 "2022-01-01T20:26:40Z")

</div>

I’m thoroughly new at Jekyll, so I’d like to ask you some specific questions.

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

2. 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:

![image](https://canada1.discourse-cdn.com/flex030/uploads/jekyllrb/original/2X/e/ef8c8319ce95d2690b4a5f0fc71d7ca8bbdaf51a.png)

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

1. 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?

2. 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?

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

---

<div class="post-metadata">

**Author:** ![pippim](https://yyz2.discourse-cdn.com/flex030/user_avatar/talk.jekyllrb.com/pippim/32/4089_2.png) [@pippim](https://talk.jekyllrb.com/u/pippim)\
**Post date:** [January 2, 2022, 2:31pm UTC](https://talk.jekyllrb.com/t/questions-about-jekyll-and-github-pages-folder-structure-and-other-questions/6850/2 "2022-01-02T14:31:28Z")

</div>

# Answering your questions point by point

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

2. The javascript and CSS is kept under the `assets` directory as you can see here from my [pippim.githib.io](http://pippim.githib.io) Jekyll website:

3. I’m not sure of putting your website in a place other than `<YOUR_NAME>.github.io`

4. 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`.

5. Here is the [Jekyll Documentation](https://jekyllrb.com/docs/)

* * *

# Summary

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.

---

<div class="post-metadata">

**Author:** ![ashmaroli](https://avatars.discourse-cdn.com/v4/letter/a/df705f/32.png) [@ashmaroli](https://talk.jekyllrb.com/u/ashmaroli)\
**Post date:** [January 2, 2022, 4:33pm UTC](https://talk.jekyllrb.com/t/questions-about-jekyll-and-github-pages-folder-structure-and-other-questions/6850/3 "2022-01-02T16:33:24Z")

</div>

> [@carloswm85](#):
>
> Can I deploy single page web app, let’s say a weather app connected to external APIs, in that hosting service using Jekyll?

Jekyll _only runs while_ it is generating / building a site.  
A web app on the other hand needs a constantly running program to render real-time state.

> [@carloswm85](#):
>
> What’s the best folder structure I can use at GitHub Pages?

Jekyll is configurable. So, you’re free to customize the folder structure.  
Refer [Directory Structure | Jekyll • Simple, blog-aware, static sites](https://jekyllrb.com/docs/structure/) and [Default Configuration | Jekyll • Simple, blog-aware, static sites](https://jekyllrb.com/docs/configuration/default/) for details.

> [@carloswm85](#):
>
> Is there anything else I need for that hosting?

You’ll need a `CNAME` file if you need to set up a custom domain. Regardless refer [GitHub Pages | Jekyll • Simple, blog-aware, static sites](https://jekyllrb.com/docs/github-pages/) for helpful tips.

> [@carloswm85](#):
>
> I’ve seen some projects at GitHub pages where the files are stored at `github.com/username/reponame`… project repo separated from the code that belongs to their GitHub site?

Firstly, this site would be accessible at `[https://username.github.io/reponame/](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_.

> [@carloswm85](#):
>
> 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?

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`_.

> [@carloswm85](#):
>
> What dependencies for Jekyll can I use at GitHub Pages? Where’s their documentation?

See [Dependency versions | GitHub Pages](https://pages.github.com/versions/)
