Understanding templates

Templates are, at a very high level, a way to include common portions of content that should be included on multiple pages. By default, any call to render that renders an HTML template will have that render happen INSIDE of a template, and that template will be under /lib/vocial_web/templates/layout/app.html.eex. If we open up that file, we can see a base HTML structure and the default file that we’ll start off with:

<!DOCTYPE html><html lang="en"> <head>   <meta charset="utf-8">   <meta http-equiv="X-UA-Compatible" content="IE=edge">   <meta name="viewport" content="width=device-width, initial-scale=1">   <meta name="description" content="">   <meta name="author" content="">   <title>Hello Vocial!</title> <link rel="stylesheet" ...

Get Phoenix Web Development now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.