Closed Fethbita closed 9 months ago
I suspect you're overcomplicating the problem. We have been thinking of adding additional build "dimensions" (e.g. role/rbac), but for that to be worth while, there needs to be a strong relation (e.g. translations) between them. In your case, that link is very week and can easily be maintained manually (e.g. a link from the landing page to the blog).
What I think you need is:
I see, yeah that makes sense. That’s what I am doing now, have different configs that use the same theme. I will close the issue. This issue might nevertheless be helpful for those who want a similar approach in the future.
This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.
There are a couple of pages explaining how multisite support currently works with Hugo:
and I have tried all of these within my environment. My use case is as follows: I have a domain, https://example.com, and I want to generate a blog using Hugo and have it under https://blog.example.com and I want to generate a single "about" page and have that under https://example.com, have that as the landing page so to say. The styles and some static files will be used in both pages. My first instinct was to follow the discussion here and have a folder structure like the following:
and I have config files (
sites/blog/blog.toml
,sites/landing/landing.toml
) similar to the following (shortened):and
When I build my pages, I do it with the following two Hugo commands:
Then I can upload "public/landing" as my landing page and "public/blog" as my blog page.
I also tried moving the config files into config directories within "sites/blog" and "sites/landing" and build the sites with the following commands"
but that one required a bunch of mounts and the theme path looked similar to "../../../themes/default" which is quite ugly.
Lastly I arrived at using languages for building both sites at once. I generated a single
hugo.toml
and separated the different sites to different languages:and generated the site using the following single command:
and had both of the sides as
public/en
andpublic/fr
. There are no translations or different languages but I found this to be the cleanest way to generate multiple related websites. I tried entering an unsupported language code:but that didn't work.
My proposal is to copy the language functionality and rename it to something else, such as
sites
, so multiple sites can be generated with Hugo at once, just like howlanguages
can be generated.