Using multiple Hugo Templates with Caddy Server

Hi everyone, in this case, I am trying to do the following and would need some guidance to make it as simple as possible.

  1. I have 2 hugo templates, one applies to the main site and one applies to /widgets. So for example one would be mysite.com and the other would be mysite.com/widgets

  2. I have the following configuration:

http://localhost {
gzip
tls luisalvaradox@gmail.com
root /home/cyrex/www/public
hugo /home/cyrex/www {
flag bind 0.0.0.0
}
expires {
match .js$ 35m
match .css$ 35m
match .html$ 35m
match .jpg$ 35m
match .png$ 35m
match .svg$ 35m
match .woff$ 35m
}
basicauth /admin username password
errors {
* stderr
404 404.html
}
}

Now here is the issue, how can I add another hugo so when I go to /widgets it actually loads the other template. I was guessing something like this:

http://localhost {
gzip
tls luisalvaradox@gmail.com
root /home/cyrex/www/public
hugo /home/cyrex/www, /home/cyrex/www/widget {
flag bind 0.0.0.0
}
expires {
match .js$ 35m
match .css$ 35m
match .html$ 35m
match .jpg$ 35m
match .png$ 35m
match .svg$ 35m
match .woff$ 35m
}
basicauth /admin username password
errors {
* stderr
404 404.html
}
}

So how can I handle multiple hugos using caddyserver or how can I tell hugo that, when somebody visits / it shows a specific template and when they go to /widgets it shows another one.

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.