Skip to content

Instantly share code, notes, and snippets.

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
get '/' do
@page_title = 'Mi pagina web'
erb :index
<div id="header">
<h1 align="center"></h1>
<p align="center">Sitio web personal.</p>
<p align="center"><img src="./img/tinfoilhatarea-sign.jpg" /></p>
<div id="body">
<p align="center">
[ <a href="">blog</a>
| <a href="">podcast</a>
| <a href="/publicaciones">publicaciones</a>
| <a href="/cv">currículum</a>
| <a href="/cobach/index">estudiantes</a> ]
<p align="center">&nbsp;</p>
<p align="center"><b>contacto</b></p>
<p align="center">
[ el.badbit en
| <a href="/redes">redes sociales</a> ]
<h1>Encabezado principal</h1>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "">
<html xmlns="">
<head 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" />
<title><%= @page_title %> -</title>
<div id="container">
<%= partial :header %>
<%= yield %>
<%= partial :footer %>
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.