1
votes

I've been trying to change the root directory of my jekyll site to another folder but I can't seem to find a way to do this and was wondering if it's possible? What I want is for all of my html pages to be in a folder named _pages, and for my website to load index.html from this folder. Currently I can only get this working by changing the baseurl and accessing the website by www.domain.com/pages/index.hmtl. Can I have it so the html files remain in this folder, and have jekyll render the site so that I can access index.html from www.domain.com/ ?

Thank you

1

1 Answers

4
votes

In your _config.yml file you'll need to include the directory where your HTML pages live like this:

include: [_pages]

In your _pages/index.html file include a permalink in the frontmatter like this:

---
permalink: /
---

Run your Jekyll build command again. If I understand your question correctly, this will output your homepage without needing to have or adjust your baseurl.