What's the difference between `src/` and `site/src` in a new rebar3 Nitrogen project?

Hello. I’m creating a new Nitrogen rebar3 project like this:

git clone git@github.com:osbre/nitrogen.git --branch=rebar3
cd nitrogen
make rel_cowboy PROJECT=example # project name

cd ../example
make run_dev
open "" # or xdg-open if on Linux

Just noticed there is a site/ directory which links to the other directories:

├── site
│   ├── include -> ../include
│   ├── src -> ../src
│   ├── static -> ../priv/static
│   └── templates -> ../priv/templates

As a beginner to both Erlang and Nitrogen, what are the reasons for having this directory?

Is it for compatibility with learning resources that mention the site/ directory? If so, can I delete the site/ folder?

After deleting this folder, the project still runs fine. Looks like the site/ folder is not needed and was there for compatibility with older tutorials, as I mentioned. Leaving the question here in case someone gets the same one. (or comes from a search engine)

Hi @Ostap, you are correct. The site directory is there for backwards compatibility with any previous documentation or code that might still be referring to the site directory structure from Nitrogen 2.x. If you are starting a new project, it is safe to delete this directory.

1 Like