[英]Client-side templating for a Single page site
Usually in a CMS, there is a template engine where we define "templated html pages", when URL is accessed for a specific page it returned the "templated" rendered page. 通常在CMS中,有一个模板引擎,我们在其中定义“模板html页面”,当访问特定页面的URL时,它返回“模板”呈现的页面。
However, I want to do single page site and deploy it in CMS, while taking advantage of a template engine that runs on the client-side. 但是,我想做一个单页站点并在CMS中部署它,同时利用在客户端运行的模板引擎。
In my current setup, I have a "root" page in which other pages are injected in a specified div like: 在当前设置中,我有一个“根”页面,其中的其他页面被注入到指定的div中,例如:
<body>
$page.content
</body>
Content pages that are injected in this root page are mapped with a URL like: /home
/blog
/etc
注入到此根页面中的内容页面使用以下URL进行映射:
/home
/blog
/etc
What are the options of implementing such single-page site with templating support? 在模板支持下实现这种单页网站有哪些选择? What I need is a JS Template engine that does not need any server side backend or something...
我需要的是一个不需要任何服务器端后端或其他任何东西的JS模板引擎。
如果喜欢Templet引擎,请尝试http://mustache.github.com/ ,这会有所帮助
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.