Rename the _site folder


#1

Is it possible to rename the _sites folder? If I want to use it as a publishing folder what is the best way?

thanks


#2

googling jekyll rename site directory gives you:

which seems to say you can specify what to name it and where it is in the config file.

As for the rest of your question, it isn’t clear what you mean - can you be more specific? all of us are publishing the site folder one way or another.


#3

Hi, thanks for your reply. I would like to rename
site to docs
to make it compatible with github pages for deployment. Alternatively create some sort of a task to copy the files from _site into docs but I feel it would be useless duplication.

Any ideas?


#4

You don’t need to rename it. You can put your Jekyll site’s source files in /docs and push those. GitHub Pages will build your site from there and deploy _site automatically.

I do this with many of my Jekyll themes. The root of the repo has the actual theme files, and in /docs I have the a Jekyll site that gets built on GH Pages to show as a “demo” for the theme.

Here’s an example.


#5

You can define source and destination folders either from the command line or in you config file.

From the command line:

bundle exec jekyll --source src --destination public

Wth shorter option name: bundle exec jekyll -s src -d public

From the configuration file

# _config.yml
source: src
destination: public

then run bundle exec jekyll build as usual.