laktek / punch

A fun and easy way to build modern websites
http://laktek.github.com/punch
MIT License
1.17k stars 107 forks source link

Docs: Multi-site setup #60

Open chadwithuhc opened 11 years ago

chadwithuhc commented 11 years ago

Can you please provide more documentation on setting up a multi-site install with shared resources? The docs do mention it briefly, but a dedicated page would be appreciated!

For Example:

One Domain with Multiple Subdomains Say I have domain.com as my main site and want to setup a few subdomained sites with similar design. These will be something like products.domain.com, support.domain.com, etc. They will share the same assets such as CSS, JS, Images, etc. Since they are separate subdomains they will need to be output to different folders and have separate config.json files.

laktek commented 11 years ago

Easiest would be to have a config.json for each site, which instructs to use a common template directory and different content directories to output into different directories (eg. products.domain.com)

Then you will need to run punch g config1.json to generate each site. I will see whether I can improve the generate command to look and execute multiple configs.

chadwithuhc commented 11 years ago

So each site has to be output manually? I thought I read something in the docs about putting them in subfolders to allow multiple sites on one install and shared resources?

laktek commented 11 years ago

You can do that too. Output each site in their own sub-folder and then map them to the domain with apache config.

teddychan commented 11 years ago

is it possible to work with this in Amazon S3 case?

say I have site:

www.domain1.com www.domain2.com www.domain3.com

when i do punch g www.domain1.com it will deploy to the correct S3 bucket?

what will it look like in the output folder?

/output/www.domain1.com/index.html
/output/www.domain2.com/index.html
/output/www.domain3.com/index.html