If you want, I would be glad to see you trying my (beta) routing library based on Ractive,
Altiva.
You can define multiple dynamic areas and change them based on route.
Create an index.html file, add the altiva.min.js and, inside another script tag, add:
var app = new Altiva ()
app.sessions( [ 'content' ] )
app.route( '/',
{
content: 'Root'
});
app.route( '/mirror',
{
content: 'CodeMirror'
});
app.route( '/simple',
{
content: 'SimpleMDE'
});
app.start();
Finally, create a "components" folder in the root folder of your project and, for each component you want to use, create a html file. In this case, Root.html, CodeMirror.html and SimpleMDE.html
Each of them follow the official Ractive component definition:
<!-- HTML part -->
<p class="test-class">Just an {{example}} text</p>
<!-- CSS part (optional) -->
<style>
.test-class {
color: #aa0000;
}
</style>
<!-- Javascirpt part (optional) -->
<script>
component.exports = {
data: {
example: 'awesome'
}
}
</script>
I would like to know if this is interesting to you.