I am using Jekyll for some static site templates and I have a folder of product html pages which I want to be bundled into the root site/ folder rather than into a site/products folder.
example below with just 2 product pages:
src folder
output to site
Is there an easy way to do this?
Additionally would there be an easy way to append products- to each file in this folder?
Try looking into Jekyll collections. You'll specifically want the Permalink feature. Hopefully the following snippet will get you started.
config.yml
collections:
products:
output: true
permalink: /product-:title/
source tree
_products
|
1.html
2.html
3.html
...
output tree
_site
|
product-1
|
index.html
product-2
|
index.html
product-3
|
index.html
...
This creates the "pretty permalinks" structure where file endings are removed by using index.html
within a directory of the correct name. Of course you could set it to create the "ugly permalinks" (project-1.html
, etc), but I like this style more.