Licenses aren't all-or-nothing. However, its useful to keep material under different licenses clearly separate. For example, your web site might have multiple directories: backend
, js
, assets
, content
. You could then clarify that different licenses apply to different parts:
LICENSE.txt
:
Some Pretty Website
Copyright 2021 Some Person
The material in backend/
and js/
is licensed under the MIT license, see LICENSE.MIT.txt
.
The material in assets/
is licensed under the CC-BY-NC-ND license 4.0, with the exception of the following assets:
The material in content/
is all rights reserved, and included for reference only.
In textual files, it might be possible to clarify the file's license with a machine-readable SPDX-License-Identifier comment.
In many cases, it will be less confusing to have different repositories for parts under different licenses. If there's only one applicable license, automated tools (like the auto-detected repository license field on GitHub) will be more accurate.
Note that in any case, you do retain your copyright. Open-source licenses work because you have a copyright: you as the copyright holder give certain permissions to the public. You are not bound by your licenses yourself. E.g. you can give a copy of your code to one person under the GPL license, another copy to someone else under the MIT license, and even sell a proprietary non-exclusive license to a another party.