# Two websites, same theme

**URL:** https://discourse.gohugo.io/t/two-websites-same-theme/19249
**Category:** support
**Created:** [June 18, 2019, 7:14am UTC](https://discourse.gohugo.io/t/two-websites-same-theme/19249 "2019-06-18T07:14:19Z")
**Posts on this page:** 9
**Page:** 1

<div class="post-metadata">

### Author: ![dktue](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/dktue/32/8653_2.png) [@dktue](https://discourse.gohugo.io/u/dktue)
#### Post date: [June 18, 2019, 7:14am UTC](https://discourse.gohugo.io/t/two-websites-same-theme/19249/1 "2019-06-18T07:14:19Z")

</div>

I have two websites and I want to use the same theme for them. Currently, I copy the theme folder from one website to the other one on a regular basis (the theme evovles aswell).

Is there any way to put both websites and the theme in the same “root” so that both websites use the same theme-folder?

---

<div class="post-metadata">

### Author: ![peaceiris](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/peaceiris/32/7358_2.png) [@peaceiris](https://discourse.gohugo.io/u/peaceiris)
#### Post date: [June 18, 2019, 8:26am UTC](https://discourse.gohugo.io/t/two-websites-same-theme/19249/2 "2019-06-18T08:26:17Z")

</div>

How about the following?

```auto
# build site A
hugo --config config-a.toml

# build site B
hugo --config config-b.toml

```

```auto
$ ls
config-a.toml
config-b.toml
content-a/
content-b/
themes/your-theme/

```

```auto
# content-a.toml
contentDir = "content-a"
theme = "your-theme"

```

```auto
# content-b.toml
contentDir = "content-b"
theme = "your-theme"

```

---

<div class="post-metadata">

### Author: ![dktue](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/dktue/32/8653_2.png) [@dktue](https://discourse.gohugo.io/u/dktue)
#### Post date: [June 18, 2019, 8:30am UTC](https://discourse.gohugo.io/t/two-websites-same-theme/19249/3 "2019-06-18T08:30:58Z")

</div>

I like the approach – but what about website-specific archetype, data, layout and stuff?

---

<div class="post-metadata">

### Author: ![peaceiris](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/peaceiris/32/7358_2.png) [@peaceiris](https://discourse.gohugo.io/u/peaceiris)
#### Post date: [June 18, 2019, 8:34am UTC](https://discourse.gohugo.io/t/two-websites-same-theme/19249/4 "2019-06-18T08:34:00Z")

</div>

> **[Configure Hugo](https://gohugo.io/getting-started/configuration/#all-configuration-settings)**
>
> How to configure your Hugo site.

You can also define those at each a config file.

- `archetypeDir`
- `assetDir`
- `dataDir`
- `layoutDir`
- `staticDir`
- `publishDir`

---

<div class="post-metadata">

### Author: ![dktue](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/dktue/32/8653_2.png) [@dktue](https://discourse.gohugo.io/u/dktue)
#### Post date: [June 18, 2019, 8:38am UTC](https://discourse.gohugo.io/t/two-websites-same-theme/19249/5 "2019-06-18T08:38:18Z")

</div>

Thanks! That sounds like a doable workaround for me. I hope that I could simply put the theme somewhere else and reference it from both but that apparently doesn’t work. ☹

---

<div class="post-metadata">

### Author: ![peaceiris](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/peaceiris/32/7358_2.png) [@peaceiris](https://discourse.gohugo.io/u/peaceiris)
#### Post date: [June 18, 2019, 8:40am UTC](https://discourse.gohugo.io/t/two-websites-same-theme/19249/6 "2019-06-18T08:40:58Z")

</div>

If you manage your website using Git and GitHub (GitLab, and so on), you can publish your theme and pull it as a git submodule on each a site content repository.

---

<div class="post-metadata">

### Author: ![dktue](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/dktue/32/8653_2.png) [@dktue](https://discourse.gohugo.io/u/dktue)
#### Post date: [June 18, 2019, 8:41am UTC](https://discourse.gohugo.io/t/two-websites-same-theme/19249/7 "2019-06-18T08:41:40Z")

</div>

Oh that’s even nicer – thanks for the suggestion!

---

<div class="post-metadata">

### Author: ![peaceiris](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/peaceiris/32/7358_2.png) [@peaceiris](https://discourse.gohugo.io/u/peaceiris)
#### Post date: [June 18, 2019, 8:50am UTC](https://discourse.gohugo.io/t/two-websites-same-theme/19249/8 "2019-06-18T08:50:42Z")

</div>

Your welcome! If you have no more question, please close this topic. 😃

 ![](https://d11a6trkgmumsb.cloudfront.net/original/3X/1/1/11e8347fb7cf1b9d039b85a5d653b96cf1b47ea8.png)

---

<div class="post-metadata">

### Author: ![davidsneighbour](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/davidsneighbour/32/24507_2.png) [@davidsneighbour](https://discourse.gohugo.io/u/davidsneighbour)
#### Post date: [June 18, 2019, 1:57pm UTC](https://discourse.gohugo.io/t/two-websites-same-theme/19249/9 "2019-06-18T13:57:05Z")

</div>

That’s kind of buying a Mercedes car so you can listen to your mixtape cassette tape.

Create two repositories for your two sites. Move your theme to a third repository. Add the theme as submodule to your two websites. That’s the way you install themes anyway.

If you change something in the submodule (your theme) on either site, it will show you an info should you run `git status` on the site itself. Follow this solution to submit your changes to the submodule:

> <https://stackoverflow.com/questions/3590400/git-commit-to-common-submodule-master-branch>

And then load the changes in each repo by updating the submodule.

This way you have two websites logically separated and you got your theme separate in case you want to add a third site with the same theme.
