I have a website that was originally created as a one page application that is now morphing into a full (multi-page) site. I am trying to refactor the various design elements for reuse on the other pages. Not all pages have the same elements. What would be the best way to do this:
put the code for each element in a separate file (in "designElements" folder?)and include directly on the pages that I would like it to appear. (Obviously not an option if there are any parameters that need to be passed)
make one large "designElements" file a function for each element. Include the file once and then call the function when I want to use an element
create separate files for each element, but wrap the code in a function, so that when I want to use an element I include that file and then call the function.
Something else?