- Using git branches, as you mentioned.
Of course you can create some kind of 'main' branch for your prototype and each branch for specific page.
Your process will be then:
git checkout -B new_branch
to create a 'copy' of template.
- Commiting some changes to your new branch.
- In meanwhile, making some updates to your 'mainline'.
git merge main_branch
to reapply updates on each specific branch.
What could be the problem: After some time the differences between 'mainline' and each specific branch will grow up to the point that you realize, that you spend most of your time by resolving merge conflicts than real development.
- Better solution, using your target technology.
In my humble opinion, better solution would be to develop your common functionalities as some kind of 'library' or 'template'. Then include or import it in your specific projects.
How to do it, depends mainly on your technology. You can do it using some kind of full feature modern framework like Angular, React or Vue. It can also be some simple set of Javascript functions that operate on DOM.
Remember, that you have two possibilities (you have to decide which will bring you more advantages in your case):
- Create a template with some kind of 'entry points' that make it easy to change behavior in sub-projects.
- Create a set of reusable components.