HTML: the modern way
Laurynas Veržukauskas
@Im0rtality
Saves time
Experienced authors
Features
Lattice that divides space in consistent units where text, headlines, images, and advertising can be placed
"TWBS" in short
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Bootstrap 101 Template</title>
<link href="//maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap.min.css" rel="stylesheet">
</head>
<body>
<div class="container">
<div class="row">
<div class="col-xs-12">
<h1>Hello, world!</h1>
...
</div>
</div>
</div>
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
<script src="//maxcdn.bootstrapcdn.com/bootstrap/3.2.0/js/bootstrap.min.js"></script>
</body>
</html>
dynamic pages
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>{% block title %}{% endblock %}</title>
{% block stylesheets %}{% stylesheets %}
<link href="//maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap.min.css" rel="stylesheet">
{% endstylesheets %}{% block stylesheets %}
</head>
<body>
<div class="container">
{% block content %}{% endblock %}
</div>
{% block javascripts %}{% javascripts %}
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
<script src="//maxcdn.bootstrapcdn.com/bootstrap/3.2.0/js/bootstrap.min.js"></script>
{% endjavascripts %}{% endblock %}
</body>
</html>
{% extends "::base.html.twig" %}
{% block title %}Hello world page{% endblock %}
{% block content %}
<div class="row">
<div class="col-xs-12">
<h1>Hello world!</h1>
</div>
</div>
{% endblock %}
{
"users": [
{
"name":"John",
"lastname":"Doe",
"username":"john.doe",
"email":"john.doe@example.com",
"image":"8676587.jpg"
},
{
"name":"Jane",
"lastname":"Doe",
"username":"jane.doe",
"email":"jane.dow@example.com",
"image":"7865907.jpg"
},
],
"comments": [
...
]
}
{% extends "::base.html.twig" %}
{% block title %}Users{% endblock %}
{% block content %}
<div class="row">
{% for user in users %}
<div class="col-xs-2">
<img src="{{ user.image | make_full_url }}"
alt="Avatar for {{ user.username }}"
class="img-circle">
<p>{{ user.name }} {{ user.lastname }}</p>
</div>
{% endfor %}
</div>
{% endblock %}