Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
SITIO BASICO: Como crear un simple sistema de plantillas para sitios web muy basicos. versión Ruby w/Sinatra
require 'sinatra'
helpers do
def partial(page)
erb page, :layout => false
end
end
get '/' do
@page_title = 'Mi pagina web'
erb :index
end
<div id="header">
<h1 align="center">badbit.org</h1>
<p align="center">Sitio web personal.</p>
<p align="center"><img src="./img/tinfoilhatarea-sign.jpg" /></p>
</div>
<div id="body">
<p align="center">
[ <a href="http://badbit.blogspot.com">blog</a>
| <a href="http://canal.badbit.org">podcast</a>
| <a href="/publicaciones">publicaciones</a>
| <a href="/cv">currículum</a>
| <a href="/cobach/index">estudiantes</a> ]
</p>
<p align="center">&nbsp;</p>
<p align="center"><b>contacto</b></p>
<p align="center">
[ el.badbit en gmail.com
| <a href="/redes">redes sociales</a> ]
</p>
</div>
<h1>Encabezado principal</h1>
<p>Información</p>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head profile="http://www.w3.org/2005/10/profile">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link rel="icon" type="image/png" href="favicon.ico">
<link rel="stylesheet" type="text/css" href="css/style.css" />
<link rel="stylesheet" type="text/css" href="css/footer.css" />
<!--[if lt IE 7]>
<link rel="stylesheet" type="text/css" href="css/ie7footer.css" />
<![endif]-->
<title><%= @page_title %> - badbit.org</title>
</head>
<body>
<div id="container">
<%= partial :header %>
<%= yield %>
</div>
<%= partial :footer %>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.