ruby on rails - Packaging an html template, javascript and css to be consumed by multiple platforms -


i have large rails application wanting split out smaller applications. 1 piece of application universal smaller applications mast , footer. extract html, javascript , css mast , footer it's own package each app can load , render.

the main issue i'm running apps not written in rails. rails, expressjs, written in go, , may end being written in other languages, solution needs language agnostic.

my thought can extract html, css , javascript it's own git repo, use mustache templates html, , use grunt or similar build tool build gem, package.json structure , golang module. possibly each in it's own git submodule.

i'm curious if there more standardized way of doing this. or if knows of simpler way of achieving goal.

sounds technology in common html/js/css.

wouldn't better export mast , footer self contained js library, or more precisely, widgets?

so whatever application server tech stack be, generate html in form of:

<script src="your_widgets.js"></script> <script>new footer.render('id_of_dom_element_to_render_to');</script> 

by doing so, whether want widget library load template or want embed template widget library or whether want construct using htmlfragment not limited server tech choice.