I have my main website, but I also want to have an exact copy of the website that uses different CSS, without using JavaScript.
Is this possible?
E.g. my main site is on mysite.example.com/ and the copy with different theming on mysite.example.com/othertheme/
NOTE: I don’t exactly need a different theme altogether, just two different CSS files to use for each variation of the site
irkode
July 30, 2024, 6:49pm
2
Using Hugos template lookup rules you may use differnt layouts for sections. (fe top-level-source-folders)
if you specify a type field in frontmatter you can also select specific.
within the layouts you could use include different css.
another option is to check the page.Section in baseof and conditionally include a css.
I don’t want different CSS for only certain sections; I want an exact copy of the entire website that uses a different theme, and publish this site alongside the current site.
irkode
July 31, 2024, 8:55am
4
So I got that wrong?
Or you my answer.
I ment to put the whole website into one subfolder and provide a different style for all stuff inside
Is there a way to make an exact copy of the website, though, across two different folders?
irkode
July 31, 2024, 9:49am
6
If you build the two websites seperately (two hugo) calls then you just have to deploy the resulting site into a subfolder of the other.
All crosslinks have to be generated manually
And you have to use a different base url for them matching their deployed folder.
There are variants of all that with different complexities.
If you tend to use just one Hugo call it depends on the complexity of your sie and theme.
And you may only have one site config. Which depending on setup may add complexity…
1 Like