# \_layouts, \_sass and \_includes got cleaned up on build

**URL:** <https://talk.jekyllrb.com/t/-layouts--sass-and--includes-got-cleaned-up-on-build/981>\
**Category:** Help\
**Created:** [September 17, 2017, 3:39am UTC](https://talk.jekyllrb.com/t/-layouts--sass-and--includes-got-cleaned-up-on-build/981 "2017-09-17T03:39:20Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![zxiang77](https://avatars.discourse-cdn.com/v4/letter/z/f19dbf/32.png) [@zxiang77](https://talk.jekyllrb.com/u/zxiang77)\
**Post date:** [September 17, 2017, 3:39am UTC](https://talk.jekyllrb.com/t/-layouts--sass-and--includes-got-cleaned-up-on-build/981/1 "2017-09-17T03:39:20Z")

</div>

I want to add Latex to my site, so I have to add a line to include MathJax in ./\_layout/some\_html.html. However, I just cannot find \_layouts, \_sass and \_includes. I added it manually, they just got deleted when I run either `jekyll serve` or `bundle exec jekyll serve`. Even those folders in my gem-theme folders were cleaned up as well. I am new to Ruby and Jekyll, so any suggestions will be helpful!  
Thanks in advance.

---

<div class="post-metadata">

**Author:** ![zxiang77](https://avatars.discourse-cdn.com/v4/letter/z/f19dbf/32.png) [@zxiang77](https://talk.jekyllrb.com/u/zxiang77)\
**Post date:** [September 17, 2017, 3:48am UTC](https://talk.jekyllrb.com/t/-layouts--sass-and--includes-got-cleaned-up-on-build/981/2 "2017-09-17T03:48:15Z")

</div>

Also, I followed the instructions in [https://jekyllrb.com/docs/themes/](https://jekyllrb.com/docs/themes/) to change to another theme, but it just displays nothing because the \_layouts folders were cleaned on built and I think that is the same issue here.

---

<div class="post-metadata">

**Author:** ![zxiang77](https://avatars.discourse-cdn.com/v4/letter/z/f19dbf/32.png) [@zxiang77](https://talk.jekyllrb.com/u/zxiang77)\
**Post date:** [September 17, 2017, 4:04am UTC](https://talk.jekyllrb.com/t/-layouts--sass-and--includes-got-cleaned-up-on-build/981/3 "2017-09-17T04:04:53Z")

</div>

Ok. Problem solved. I think I put them in the wrong place. I placed them in \_site folder, so this folder just rebuild every time on build and that’s why. But still I cannot render anything when I am using a gem based theme.

---

<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:** [September 17, 2017, 5:57am UTC](https://talk.jekyllrb.com/t/-layouts--sass-and--includes-got-cleaned-up-on-build/981/4 "2017-09-17T05:57:27Z")

</div>

> [@zxiang77](#):
>
> But still I cannot render anything when I am using a gem based theme.

Can you elaborate on the steps taken to render, please?  
(If you have the project made public posting the url to the repository would be added help.)

---

<div class="post-metadata">

**Author:** ![zxiang77](https://avatars.discourse-cdn.com/v4/letter/z/f19dbf/32.png) [@zxiang77](https://talk.jekyllrb.com/u/zxiang77)\
**Post date:** [September 17, 2017, 9:21pm UTC](https://talk.jekyllrb.com/t/-layouts--sass-and--includes-got-cleaned-up-on-build/981/5 "2017-09-17T21:21:24Z")

</div>

problem solved. The problem was, when I changed the theme, the corresponding \_folders were not added to my root folder automatically. Then the site just cannot find the layout page they are looking for, and finally a blank page was rendered. So I have to manually copied and pasted the from gems folder.  
I just wonder if that is normal with Jekyll when switching themes, because [this](https://jekyllrb.com/docs/themes/#installing-a-theme) link’s description doesn’t sound like I have to manually copy those folders…

---

<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:** [September 18, 2017, 1:32am UTC](https://talk.jekyllrb.com/t/-layouts--sass-and--includes-got-cleaned-up-on-build/981/6 "2017-09-18T01:32:48Z")

</div>

You’re right in wondering if its normal to have to copy “\_folders” when switching themes.  
The deal behind using gem-based themes is that **unless you need to customize a theme file, you shouldn’t have to copy anything to your project’s source directory. Doing so will render you unable to easily sync future updates to your theme.**

* * *

**TL;DR:**  
A well maintained them would have proper documentation set up to easily migrate from the default theme Minma.

* * *

The one common issue users face while switching themes is that the layouts are named arbitrarily. So, instead of having a `_layouts/post.html` for posts, the theme may have `_layouts/entry.html` intended for blog entries and hence users will have to edit each and every markdown document in the `_posts` directory to switch to `layout: entry` from `layout: post`.

At times its possible that a theme’s `_includes/head.html` references a `css/style.css` as the main stylesheet instead of the default `assets/main.css` and this could lead to an unstyled site all of a sudden.

A
