ECTとは?
テンプレートエンジンです.
公式サイト
ECT - Fastest JavaScript template engine with CoffeeScript syntax
ECTの凄さは他の方が書かれた記事が優れているのでそちらをご覧になったほうがいいかと.
ectの検索結果 - Qiita
テンプレート
layout.ect
<!DOCTYPE html>
<html lang="ja">
<head>
<meta charset="utf-8">
<meta name="keywords" content="<%- @keywords %>">
<meta name="description" content="<%- @description %>">
<meta property="og:type" content="<%- @og_type %>">
<meta property="og:title" content="<%- @title %>">
<meta property="og:image" content="<%- @og_image %>">
<meta property="og:url" content="<%- @og_url %>">
<meta property="og:description" content="<%- @description %>">
<meta property="og:site_name" content="<%- @og_site %>">
<meta name="viewport" content="width=device-width,initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="IE=Edge,chrome=1">
<link rel="shortcut icon" href="/favicon.ico">
<link rel="apple-touch-icon" href="/apple-touch-icon.png">
<% include 'style' %>
<title><%- @title %></title>
</head>
<body>
<% content %>
<% include 'script' %>
</body>
</html>
style.ect
<link rel="stylesheet" href="stylesheets/normalize.css">
<link rel="stylesheet" href="stylesheets/style.css">
<% content 'style' %>
script.ect
<script src="javascripts/main.js"></script>
<% content 'script' %>
使用例
例えばindex.ectで使用する場合は
index.ect
<% extend 'layout' %>
<div class="wrapper">
<header role="banner">
<h1></h1>
</header>
<main role="main">
</main>
<footer role="contentinfo">
</footer>
</div>