<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Antártico Norte</title>
	<atom:link href="http://antarticonorte.com/blog/feed/" rel="self" type="application/rss+xml" />
	<link>http://antarticonorte.com/blog</link>
	<description>Fotografía, diseño web y de todo un poco</description>
	<lastBuildDate>Tue, 19 Jan 2010 19:20:49 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.1</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Usando LESS con Nanoc</title>
		<link>http://antarticonorte.com/blog/2010/01/19/usando-less-con-nanoc/</link>
		<comments>http://antarticonorte.com/blog/2010/01/19/usando-less-con-nanoc/#comments</comments>
		<pubDate>Tue, 19 Jan 2010 19:20:20 +0000</pubDate>
		<dc:creator>Al-x</dc:creator>
				<category><![CDATA[Web]]></category>
		<category><![CDATA[ruby]]></category>
		<category><![CDATA[css]]></category>
		<category><![CDATA[less]]></category>
		<category><![CDATA[nanoc]]></category>

		<guid isPermaLink="false">http://antarticonorte.com/blog/?p=215</guid>
		<description><![CDATA[ En el articulo anterior vimos como crear un sitio web básico con nanoc. Ahora vamos a ver como podemos gestionar nuestras hojas de estilo en un proyecto de nanoc utilizando LESS.
LESS, o &#8220;Leaner CSS&#8221; es una gema de Ruby que extiende el lenguaje CSS con elementos propios de otros lenguajes de programación, como variables, [...]]]></description>
			<content:encoded><![CDATA[<p><img src="http://antarticonorte.com/blog/wp-content/uploads/2010/01/less.png" alt="" title="less" width="214" height="114" class="alignright size-full wp-image-216" /> En el articulo anterior vimos como <a href="http://antarticonorte.com/blog/2010/01/09/empezando-con-nanoc/">crear un sitio web básico con nanoc</a>. Ahora vamos a ver como podemos gestionar nuestras hojas de estilo en un proyecto de nanoc utilizando <a href="http://lesscss.org/">LESS</a>.</p>
<p>LESS, o &#8220;Leaner CSS&#8221; es una gema de Ruby que extiende el lenguaje CSS con elementos propios de otros lenguajes de programación, como variables, herencia, operaciones aritméticas, etc. Algunas de las cosas que nos permite son:</p>
<p><strong>Variables</strong><br />
LESS te permite declarar variables y reutilizarlas dentro de tus hojas de estilo, haciendo cambios globales tan sencillos como modificar una linea.</p>

<div class="wp_syntax"><div class="code"><pre class="css" style="font-family:monospace;"><span style="color: #a1a100;">@color_logo: #F7BD01;</span>
&nbsp;
<span style="color: #cc00cc;">#logo</span> <span style="color: #00AA00;">&#123;</span> <span style="color: #000000; font-weight: bold;">background</span><span style="color: #00AA00;">:</span> <span style="color: #a1a100;">@color_logo; }</span></pre></div></div>

<p><strong>Elementos anidados (herencia)</strong><br />
Con LESS, en vez de tener selectores largos podemos anidar un selector dentro de otro. De esta forma la herencia queda más clara y tus hojas de estilo más pequeñas.</p>

<div class="wp_syntax"><div class="code"><pre class="css" style="font-family:monospace;"><span style="color: #808080; font-style: italic;">/* less */</span>
<span style="color: #cc00cc;">#cabecera</span> <span style="color: #00AA00;">&#123;</span>
    <span style="color: #000000; font-weight: bold;">background</span><span style="color: #00AA00;">:</span><span style="color: #cc00cc;">#222</span><span style="color: #00AA00;">;</span>
    <span style="color: #000000; font-weight: bold;">color</span><span style="color: #00AA00;">:</span><span style="color: #cc00cc;">#ccc</span><span style="color: #00AA00;">;</span>
    a <span style="color: #00AA00;">&#123;</span>
        <span style="color: #000000; font-weight: bold;">text-decoration</span><span style="color: #00AA00;">:</span><span style="color: #993333;">none</span><span style="color: #00AA00;">;</span>
        <span style="color: #000000; font-weight: bold;">font-weight</span><span style="color: #00AA00;">:</span><span style="color: #993333;">bold</span><span style="color: #00AA00;">;</span>
    <span style="color: #00AA00;">&#125;</span>
<span style="color: #00AA00;">&#125;</span>
&nbsp;
<span style="color: #808080; font-style: italic;">/* css */</span>
<span style="color: #cc00cc;">#cabecera</span> <span style="color: #00AA00;">&#123;</span>
    <span style="color: #000000; font-weight: bold;">background</span><span style="color: #00AA00;">:</span><span style="color: #cc00cc;">#222</span><span style="color: #00AA00;">;</span>
    <span style="color: #000000; font-weight: bold;">color</span><span style="color: #00AA00;">:</span><span style="color: #cc00cc;">#ccc</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span>
<span style="color: #cc00cc;">#cabecera</span> a <span style="color: #00AA00;">&#123;</span>
    <span style="color: #000000; font-weight: bold;">text-decoration</span><span style="color: #00AA00;">:</span><span style="color: #993333;">none</span><span style="color: #00AA00;">;</span>
    <span style="color: #000000; font-weight: bold;">font-weight</span><span style="color: #00AA00;">:</span><span style="color: #993333;">bold</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span></pre></div></div>

<p>No voy a hablar mucho más de LESS en este articulo. Para ver más características os recomiendo que leais la <a href="http://lesscss.org/docs.html">documentación oficial</a>, donde explican cómo extiende el lenguaje CSS y todo lo que se puede hacer con la librería.</p>
<p><span id="more-215"></span></p>
<h3>Instalando LESS</h3>
<p>Instalar LESS es tan sencillo como instalar cualquier otra gema de Ruby. Basta con abrir una sesión de terminal y ejecutar:</p>
<pre class="term">
$ sudo gem install less
</pre>
<h3>Integrar LESS con Nanoc</h3>
<p>Lo primero que necesitas es un proyecto de nanoc. Si seguiste el <a href="http://antarticonorte.com/blog/2010/01/09/empezando-con-nanoc/">anterior articulo</a> ya deberías de tener un proyecto, si no es así, leetelo y empieza a usar esta maravillosa herramienta.</p>
<p>Vete al directorio donde tengas tu proyecto de nanoc y crea un nuevo item. Para mantener las cosas organizadas, los items que sean hojas de estilo los vamos a crear dentro del directorio <code>css</code>.</p>
<pre class="term">
$ cd code/mi_sitio
$ nanoc3 create_item css/estilos
      create  content/css/estilos.yaml
      create  content/css/estilos.html
</pre>
<p>Fíjate en que no he escrito la extensión del fichero, y que nanoc ha supuesto automáticamente que quiero crear una página <code>.html</code>. Bueno, no hay forma de decirle que extensión queremos usar, por lo que la única solución es renombrar a posteriori el fichero. Los las hojas de estilo de LESS llevan la extensión .less</p>
<pre class="term">
$ mv content/css/estilos.html content/css/estilos.less
</pre>
<p>Ahora tenemos que decir a nanoc como tiene que compilar nuestras hojas de estilo. Para ello tenemos que modificar el fichero <code>Rules</code> de la raíz de nuestro proyecto y añadir lo siguiente al principio del todo.</p>

<div class="wp_syntax"><div class="code"><pre class="ruby" style="font-family:monospace;"><span style="color:#008000; font-style:italic;"># Stylesheets</span>
route <span style="color:#996600;">'/css/*'</span> <span style="color:#9966CC; font-weight:bold;">do</span>
  item.<span style="color:#9900CC;">identifier</span>.<span style="color:#CC0066; font-weight:bold;">chop</span> <span style="color:#006600; font-weight:bold;">+</span> <span style="color:#996600;">'.css'</span>
<span style="color:#9966CC; font-weight:bold;">end</span>
&nbsp;
compile <span style="color:#996600;">'/css/*'</span> <span style="color:#9966CC; font-weight:bold;">do</span>
  filter <span style="color:#ff3333; font-weight:bold;">:less</span>
<span style="color:#9966CC; font-weight:bold;">end</span></pre></div></div>

<p>No entraré en detalles, pero el código que hemos añadido en el fichero le dice a nanoc tres cosas: donde tiene que guardar nuestras hojas de estilo, con que nombre, y qué filtro debe utilizar para ello.</p>
<p>Para comprobar que funciona vamos a crear una hoja de estilo con LESS muy sencilla.</p>

<div class="wp_syntax"><div class="code"><pre class="css" style="font-family:monospace;"><span style="color: #00AA00;">*</span> <span style="color: #00AA00;">&#123;</span>
    <span style="color: #000000; font-weight: bold;">margin</span><span style="color: #00AA00;">:</span> <span style="color: #cc66cc;">0</span><span style="color: #00AA00;">;</span> <span style="color: #000000; font-weight: bold;">padding</span><span style="color: #00AA00;">:</span> <span style="color: #cc66cc;">0</span><span style="color: #00AA00;">;</span>
    <span style="color: #000000; font-weight: bold;">font-family</span><span style="color: #00AA00;">:</span> Georgia<span style="color: #00AA00;">,</span> Palatino<span style="color: #00AA00;">,</span> Times<span style="color: #00AA00;">,</span> <span style="color: #ff0000;">'Times New Roman'</span><span style="color: #00AA00;">,</span> <span style="color: #993333;">sans-serif</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span>
&nbsp;
body <span style="color: #00AA00;">&#123;</span>
    <span style="color: #000000; font-weight: bold;">background</span><span style="color: #00AA00;">:</span> <span style="color: #cc00cc;">#fff</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span>
&nbsp;
a <span style="color: #00AA00;">&#123;</span>
    <span style="color: #000000; font-weight: bold;">text-decoration</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">none</span><span style="color: #00AA00;">;</span>
    <span style="color: #3333ff;">:link</span><span style="color: #00AA00;">,</span> <span style="color: #3333ff;">:visited </span><span style="color: #00AA00;">&#123;</span>
        <span style="color: #000000; font-weight: bold;">color</span><span style="color: #00AA00;">:</span><span style="color: #cc00cc;">#f30</span><span style="color: #00AA00;">;</span>
    <span style="color: #00AA00;">&#125;</span>
    <span style="color: #3333ff;">:hover </span><span style="color: #00AA00;">&#123;</span>
        <span style="color: #000000; font-weight: bold;">color</span><span style="color: #00AA00;">:</span><span style="color: #cc00cc;">#f90</span><span style="color: #00AA00;">;</span>
    <span style="color: #00AA00;">&#125;</span>
<span style="color: #00AA00;">&#125;</span>
&nbsp;
<span style="color: #cc00cc;">#main</span> <span style="color: #00AA00;">&#123;</span>
    <span style="color: #000000; font-weight: bold;">position</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">absolute</span><span style="color: #00AA00;">;</span>
    <span style="color: #000000; font-weight: bold;">top</span><span style="color: #00AA00;">:</span> <span style="color: #933;">40px</span><span style="color: #00AA00;">;</span> <span style="color: #000000; font-weight: bold;">left</span><span style="color: #00AA00;">:</span> <span style="color: #933;">280px</span><span style="color: #00AA00;">;</span>
    <span style="color: #000000; font-weight: bold;">width</span><span style="color: #00AA00;">:</span> <span style="color: #933;">500px</span><span style="color: #00AA00;">;</span>
&nbsp;
    h1 <span style="color: #00AA00;">&#123;</span>
        <span style="color: #000000; font-weight: bold;">font-size</span><span style="color: #00AA00;">:</span> <span style="color: #933;">40px</span><span style="color: #00AA00;">;</span>
        <span style="color: #000000; font-weight: bold;">font-weight</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">normal</span><span style="color: #00AA00;">;</span>
        <span style="color: #000000; font-weight: bold;">line-height</span><span style="color: #00AA00;">:</span> <span style="color: #933;">40px</span><span style="color: #00AA00;">;</span>
        <span style="color: #000000; font-weight: bold;">letter-spacing</span><span style="color: #00AA00;">:</span> <span style="color: #933;">-1px</span><span style="color: #00AA00;">;</span>
    <span style="color: #00AA00;">&#125;</span>
    p <span style="color: #00AA00;">&#123;</span>
        <span style="color: #000000; font-weight: bold;">margin</span><span style="color: #00AA00;">:</span> <span style="color: #933;">20px</span> <span style="color: #cc66cc;">0</span><span style="color: #00AA00;">;</span>
        <span style="color: #000000; font-weight: bold;">font-size</span><span style="color: #00AA00;">:</span> <span style="color: #933;">15px</span><span style="color: #00AA00;">;</span>
        <span style="color: #000000; font-weight: bold;">line-height</span><span style="color: #00AA00;">:</span> <span style="color: #933;">20px</span><span style="color: #00AA00;">;</span>
    <span style="color: #00AA00;">&#125;</span>
    ul <span style="color: #00AA00;">&#123;</span>
        <span style="color: #000000; font-weight: bold;">margin</span><span style="color: #00AA00;">:</span> <span style="color: #933;">20px</span><span style="color: #00AA00;">;</span>
    <span style="color: #00AA00;">&#125;</span>
    li <span style="color: #00AA00;">&#123;</span>
        <span style="color: #000000; font-weight: bold;">list-style-type</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">square</span><span style="color: #00AA00;">;</span>
        <span style="color: #000000; font-weight: bold;">font-size</span><span style="color: #00AA00;">:</span> <span style="color: #933;">15px</span><span style="color: #00AA00;">;</span>
        <span style="color: #000000; font-weight: bold;">line-height</span><span style="color: #00AA00;">:</span> <span style="color: #933;">20px</span><span style="color: #00AA00;">;</span>
    <span style="color: #00AA00;">&#125;</span>
<span style="color: #00AA00;">&#125;</span>
&nbsp;
<span style="color: #cc00cc;">#sidebar</span> <span style="color: #00AA00;">&#123;</span>
    <span style="color: #000000; font-weight: bold;">position</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">absolute</span><span style="color: #00AA00;">;</span>
    <span style="color: #000000; font-weight: bold;">top</span><span style="color: #00AA00;">:</span> <span style="color: #933;">40px</span><span style="color: #00AA00;">;</span> <span style="color: #000000; font-weight: bold;">left</span><span style="color: #00AA00;">:</span> <span style="color: #933;">20px</span><span style="color: #00AA00;">;</span>
    <span style="color: #000000; font-weight: bold;">width</span><span style="color: #00AA00;">:</span> <span style="color: #933;">200px</span><span style="color: #00AA00;">;</span>
    <span style="color: #000000; font-weight: bold;">padding</span><span style="color: #00AA00;">:</span> <span style="color: #933;">20px</span> <span style="color: #933;">20px</span> <span style="color: #cc66cc;">0</span> <span style="color: #cc66cc;">0</span><span style="color: #00AA00;">;</span>
    <span style="color: #000000; font-weight: bold;">border-right</span><span style="color: #00AA00;">:</span> <span style="color: #933;">1px</span> <span style="color: #993333;">solid</span> <span style="color: #cc00cc;">#ccc</span><span style="color: #00AA00;">;</span>
    <span style="color: #000000; font-weight: bold;">text-align</span><span style="color: #00AA00;">:</span> <span style="color: #000000; font-weight: bold;">right</span><span style="color: #00AA00;">;</span>
    h2 <span style="color: #00AA00;">&#123;</span>
        <span style="color: #000000; font-weight: bold;">text-transform</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">uppercase</span><span style="color: #00AA00;">;</span>
        <span style="color: #000000; font-weight: bold;">font-size</span><span style="color: #00AA00;">:</span> <span style="color: #933;">13px</span><span style="color: #00AA00;">;</span>
        <span style="color: #000000; font-weight: bold;">color</span><span style="color: #00AA00;">:</span> <span style="color: #cc00cc;">#333</span><span style="color: #00AA00;">;</span>
        <span style="color: #000000; font-weight: bold;">letter-spacing</span><span style="color: #00AA00;">:</span> <span style="color: #933;">1px</span><span style="color: #00AA00;">;</span>
        <span style="color: #000000; font-weight: bold;">line-height</span><span style="color: #00AA00;">:</span> <span style="color: #933;">20px</span><span style="color: #00AA00;">;</span>
    <span style="color: #00AA00;">&#125;</span>
    ul <span style="color: #00AA00;">&#123;</span>
        <span style="color: #000000; font-weight: bold;">list-style-type</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">none</span><span style="color: #00AA00;">;</span>
        <span style="color: #000000; font-weight: bold;">margin</span><span style="color: #00AA00;">:</span> <span style="color: #933;">20px</span> <span style="color: #cc66cc;">0</span><span style="color: #00AA00;">;</span>
    <span style="color: #00AA00;">&#125;</span>
    li <span style="color: #00AA00;">&#123;</span>
        <span style="color: #000000; font-weight: bold;">font-size</span><span style="color: #00AA00;">:</span> <span style="color: #933;">14px</span><span style="color: #00AA00;">;</span>
        <span style="color: #000000; font-weight: bold;">line-height</span><span style="color: #00AA00;">:</span> <span style="color: #933;">20px</span><span style="color: #00AA00;">;</span>
    <span style="color: #00AA00;">&#125;</span>
<span style="color: #00AA00;">&#125;</span></pre></div></div>

<p>Como puedes ver estamos haciendo uso de los selectores anidados de LESS para dejar la hoja de estilo más limpia.</p>
<p>Para comprobar que los cambios han surtido efecto vamos a arrancar el autocompilador de nanoc. Para ello ejecutamos:</p>
<pre class="term">
$ nanoc3 aco
</pre>
<p>Si ahora abrimos un navegador y pedimos la URL http://localhost:3000/css/estilos.css, deberíamos de ver la hoja de estilos procesada con LESS:</p>

<div class="wp_syntax"><div class="code"><pre class="css" style="font-family:monospace;"><span style="color: #00AA00;">*</span> <span style="color: #00AA00;">&#123;</span>
  <span style="color: #000000; font-weight: bold;">margin</span><span style="color: #00AA00;">:</span> <span style="color: #cc66cc;">0</span><span style="color: #00AA00;">;</span>
  <span style="color: #000000; font-weight: bold;">padding</span><span style="color: #00AA00;">:</span> <span style="color: #cc66cc;">0</span><span style="color: #00AA00;">;</span>
  <span style="color: #000000; font-weight: bold;">font-family</span><span style="color: #00AA00;">:</span> Georgia<span style="color: #00AA00;">,</span> Palatino<span style="color: #00AA00;">,</span> Times<span style="color: #00AA00;">,</span> <span style="color: #ff0000;">'Times New Roman'</span><span style="color: #00AA00;">,</span> <span style="color: #993333;">sans-serif</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span>
body <span style="color: #00AA00;">&#123;</span> <span style="color: #000000; font-weight: bold;">background</span><span style="color: #00AA00;">:</span> <span style="color: #cc00cc;">#ffffff</span><span style="color: #00AA00;">;</span> <span style="color: #00AA00;">&#125;</span>
a <span style="color: #00AA00;">&#123;</span> <span style="color: #000000; font-weight: bold;">text-decoration</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">none</span><span style="color: #00AA00;">;</span> <span style="color: #00AA00;">&#125;</span>
a<span style="color: #3333ff;">:link </span><span style="color: #00AA00;">&#123;</span> <span style="color: #000000; font-weight: bold;">color</span><span style="color: #00AA00;">:</span> <span style="color: #cc00cc;">#ff3300</span><span style="color: #00AA00;">;</span> <span style="color: #00AA00;">&#125;</span>
a<span style="color: #3333ff;">:visited </span><span style="color: #00AA00;">&#123;</span> <span style="color: #000000; font-weight: bold;">color</span><span style="color: #00AA00;">:</span> <span style="color: #cc00cc;">#ff3300</span><span style="color: #00AA00;">;</span> <span style="color: #00AA00;">&#125;</span>
a<span style="color: #3333ff;">:hover </span><span style="color: #00AA00;">&#123;</span> <span style="color: #000000; font-weight: bold;">color</span><span style="color: #00AA00;">:</span> <span style="color: #cc00cc;">#ff9900</span><span style="color: #00AA00;">;</span> <span style="color: #00AA00;">&#125;</span>
...</pre></div></div>

<p>Utilizar la nueva hoja de estilo ya procesada es tan fácil como añadir un <code>&lt;link /&gt;</code> a tu fichero de layout. Para ello modificamos el fichero &#8220;layouts/default.html&#8221;, buscamos la siguiente linea:</p>

<div class="wp_syntax"><div class="code"><pre class="html4strict" style="font-family:monospace;"><span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">link</span> <span style="color: #000066;">rel</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;stylesheet&quot;</span> <span style="color: #000066;">type</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;text/css&quot;</span> <span style="color: #000066;">href</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;/style.css&quot;</span> <span style="color: #000066;">media</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;screen&quot;</span>&gt;</span></pre></div></div>

<p>y la cambiamos por esta otra:</p>

<div class="wp_syntax"><div class="code"><pre class="html4strict" style="font-family:monospace;"><span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">link</span> <span style="color: #000066;">rel</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;stylesheet&quot;</span> <span style="color: #000066;">type</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;text/css&quot;</span> <span style="color: #000066;">href</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;/css/estilos.css&quot;</span> <span style="color: #000066;">media</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;screen&quot;</span>&gt;</span></pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://antarticonorte.com/blog/2010/01/19/usando-less-con-nanoc/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Empezando con nanoc</title>
		<link>http://antarticonorte.com/blog/2010/01/09/empezando-con-nanoc/</link>
		<comments>http://antarticonorte.com/blog/2010/01/09/empezando-con-nanoc/#comments</comments>
		<pubDate>Sat, 09 Jan 2010 07:33:03 +0000</pubDate>
		<dc:creator>Al-x</dc:creator>
				<category><![CDATA[Web]]></category>
		<category><![CDATA[ruby]]></category>
		<category><![CDATA[nanoc]]></category>

		<guid isPermaLink="false">http://antarticonorte.com/blog/?p=161</guid>
		<description><![CDATA[
Nanoc es un generador de páginas estáticas escrito en Ruby. Nanoc crea ficheros HTML a partir de plantillas escritas en ERB, HAML u otros lenguajes.
No necesitas nada especial en el servidor para usar nanoc, ya que las plantillas se procesan en tu ordenador. Basta con subir los ficheros estáticos generados a un servidor web y [...]]]></description>
			<content:encoded><![CDATA[<p><img src="http://antarticonorte.com/blog/wp-content/uploads/2010/01/extensible.png" alt="" title="extensible" width="262" height="108" class="alignright size-full wp-image-203" /></p>
<p><a href="http://nanoc.stoneship.org/">Nanoc</a> es un generador de páginas estáticas escrito en Ruby. Nanoc crea ficheros HTML a partir de plantillas escritas en <a href="http://www.ruby-doc.org/stdlib/libdoc/erb/rdoc/">ERB</a>, <a href="http://haml-lang.com/">HAML</a> u otros lenguajes.</p>
<p>No necesitas nada especial en el servidor para usar nanoc, ya que las plantillas se procesan en tu ordenador. Basta con subir los ficheros estáticos generados a un servidor web y el sitio ya estará accesible.</p>
<p><span id="more-161"></span></p>
<h3>Creando un sitio</h3>
<p>Lo primero que tenemos que hacer es instalar nanoc y otras gemas que vamos a necesitar.</p>
<pre class="term">
$ sudo gem install nanoc3 rack mime-types
</pre>
<p>Una vez instalado todo el siguiente paso es crear nuestro primer sitio web.</p>
<pre class="term">
$ nanoc3 create_site mi_sitio
</pre>
<p>Esto nos genera la siguiente salida:</p>
<pre class="term">
      create  config.yaml
      create  Rakefile
      create  Rules
      create  content/index.yaml
      create  content/index.html
      create  layouts/default.yaml
      create  layouts/default.html
Created a blank nanoc site at 'mi_sitio'. Enjoy!
</pre>
<p>El comando anterior crea un nuevo proyecto de nanoc en la carpeta &#8216;mi_primer_sitio&#8217;, pero aún no hay ningún fichero que podamos abrir con un navegador web. Para ello debemos indicar a nanoc que compile nuestro proyecto en un sitio estático. </p>
<pre class="term">
$ nanoc3 compile
Loading site data...
Compiling site...
      create  [0.01s]  output/index.html

Site compiled in 0.01s.
</pre>
<p>Si echamos un vistazo al directorio <code>output</code> vemos que se ha creado un nuevo fichero llamado <code>index.html</code>. El contenido de este fichero se genera a partir de un contenedor o fichero de <em>layout</em> y un fichero de plantilla.</p>
<p>Los ficheros que genera nanoc no están pensados para abrirse directamente con el navegador, sino para ser servidos mediante un servidor web. Esto es importante, ya que nanoc por defecto utiliza rutas absolutas para los recursos (imágenes, hojas de estilo, etc&#8230;). Si abrimos el fichero directamente con el navegador seguramente veamos el contenido sin estilos aplicados.</p>
<p>Si a esto añadimos que con cada cambio que hagamos debemos recompilar el sitio, el proceso de desarrollo se hace muy tedioso. Para ello nanoc nos permite arrancar un servidor web local que compila automáticamente el sitio cada vez que accedemos a él. Para arrancarlo basta con escribir en el terminal.</p>
<pre class="term">
mi_sitio$ nanoc3 aco
</pre>
<p>Con esto abrimos un servidor web en el puerto 3000 de nuestra maquina en el que podremos ver el sitio web compilado. No es necesario compilar manualmente ya que nanoc lo hará por nosotros cada vez que accedamos a este servidor.</p>
<p>Podemos entrar con nuestro navegador favorito en <a href="http://localhost:3000/">http://localhost:3000/</a> y veremos el sitio web compilado:</p>
<p><a href="http://antarticonorte.com/blog/wp-content/uploads/2010/01/Imagen-1.png"><img src="http://antarticonorte.com/blog/wp-content/uploads/2010/01/Imagen-1-500x399.png" alt="" title="Imagen 1" width="500" height="399" class="alignnone size-medium wp-image-184" /></a></p>
<h3>Editando plantillas</h3>
<p>Las diferentes plantillas para generar nuestro sitio web estático se almacenan en el directorio <code>content</code>. Si entramos en él, veremos que tiene una estructura similar a esta:</p>
<pre class="term">
mi_sitio/content$ ls -l
total 16
-rw-r--r--  1 alex  _www  981  4 ene 01:21 index.html
-rw-r--r--  1 alex  _www   17  4 ene 01:21 index.yaml
</pre>
<p><code>index.html</code> es el fichero que contiene el contenido de la plantilla, e <code>index.yaml</code> es donde se almacenan los metadatos de la misma.</p>
<p>Vamos a modificar el título de la página. Para ello modificamos el fichero <code>index.html</code> y cambiamos el contenido del tag <code>&lt;h1&gt;</code> por lo siguiente:</p>

<div class="wp_syntax"><div class="code"><pre class="html4strict" style="font-family:monospace;"><span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">h1</span>&gt;</span>Mi primer sitio con nanoc<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">h1</span>&gt;</span></pre></div></div>

<p>Ahora abrimos el fichero <code>index.yaml</code> y dejamos su contenido como sigue:</p>

<div class="wp_syntax"><div class="code"><pre class="yaml" style="font-family:monospace;">--- 
title: Mi primer sitio con nanoc</pre></div></div>

<p>Accedemos de nuevo a http://localhost:3000/ para comprobar que ha modificado el sitio con nuestros cambios.</p>
<h3>Creando una nueva página</h3>
<p>Crear una nueva página en nanoc es muy simple:</p>
<pre class="term">
$ nanoc3 create_item nombre_pagina
</pre>
<p>Por ejemplo, vamos a crear una página en la que metamos información acerca de nosotros mismos</p>
<pre class="term">
mi_sitio$ nanoc3 create_item acerca_de
      create  content/acerca_de.yaml
      create  content/acerca_de.html
An item has been created at /acerca_de/.
</pre>
<p>Si ahora apuntamos nuestro navegador a <a href="http://localhost:3000/acerca_de/">http://localhost:3000/acerca_de/</a> veremos que se ha creado una nueva página en blanco. Si modificamos el fichero <code>content/acerca_de.html</code> se actualizará el contenido de la página que acabamos de crear.</p>
<h3>Entendiendo el layout</h3>
<p>Los layouts (podemos tener varios) se almacenan en el directorio <code>layouts</code>. Si echamos un vistazo al directorio tendremos una estructura similar a esta.</p>
<pre class="term">
mi_sitio/layouts$ ls -l
total 16
-rw-r--r--  1 alex  _www  875  4 ene 23:51 default.html
-rw-r--r--  1 alex  _www    8  4 ene 23:51 default.yaml
</pre>
<p>Esta estructura nos resultará familiar del contenido del directorio <code>content</code>.</p>
<p>Por defecto el fichero <code>default.yaml</code> viene vacío, así que de momento vamos a centrarnos en el contenido de <code>default.html</code></p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
</pre></td><td class="code"><pre class="html4strict" style="font-family:monospace;"><span style="color: #00bbdd;">&lt;!DOCTYPE HTML PUBLIC &quot;-//W3C//DTD HTML 4.01//EN&quot; &quot;http://www.w3.org/TR/html4/strict.dtd&quot;&gt;</span>
<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">html</span>&gt;</span>
  <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">head</span>&gt;</span>
    <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">title</span>&gt;</span>A Brand New nanoc Site - <span style="color: #009900;">&lt;%<span style="color: #66cc66;">=</span> @item<span style="color: #66cc66;">&#91;</span>:<span style="color: #000066;">title</span><span style="color: #66cc66;">&#93;</span> %&gt;&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">title</span>&gt;</span>
    <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">link</span> <span style="color: #000066;">rel</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;stylesheet&quot;</span> <span style="color: #000066;">type</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;text/css&quot;</span> <span style="color: #000066;">href</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;/style.css&quot;</span> <span style="color: #000066;">media</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;screen&quot;</span>&gt;</span>
  <span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">head</span>&gt;</span>
  <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">body</span>&gt;</span>
    <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">div</span> <span style="color: #000066;">id</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;main&quot;</span>&gt;</span>
<span style="color: #009900;">&lt;%<span style="color: #66cc66;">=</span> yield %&gt;</span>
    <span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">div</span>&gt;</span>
    <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">div</span> <span style="color: #000066;">id</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;sidebar&quot;</span>&gt;</span>
      <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">h2</span>&gt;</span>Documentation<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">h2</span>&gt;</span>
      <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">ul</span>&gt;</span>
        <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">li</span>&gt;&lt;<span style="color: #000000; font-weight: bold;">a</span> <span style="color: #000066;">href</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;http://nanoc.stoneship.org/tutorial/&quot;</span>&gt;</span>Tutorial<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">a</span>&gt;&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">li</span>&gt;</span>
        <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">li</span>&gt;&lt;<span style="color: #000000; font-weight: bold;">a</span> <span style="color: #000066;">href</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;http://nanoc.stoneship.org/manual/&quot;</span>&gt;</span>Manual<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">a</span>&gt;&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">li</span>&gt;</span>
      <span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">ul</span>&gt;</span>
      <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">h2</span>&gt;</span>Community<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">h2</span>&gt;</span>
      <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">ul</span>&gt;</span>
        <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">li</span>&gt;&lt;<span style="color: #000000; font-weight: bold;">a</span> <span style="color: #000066;">href</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;http://groups.google.com/group/nanoc/&quot;</span>&gt;</span>Discussion Group<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">a</span>&gt;&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">li</span>&gt;</span>
        <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">li</span>&gt;&lt;<span style="color: #000000; font-weight: bold;">a</span> <span style="color: #000066;">href</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;http://groups.google.com/group/nanoc-es/&quot;</span>&gt;</span>Spanish Discussion Group<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">a</span>&gt;&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">li</span>&gt;</span>
        <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">li</span>&gt;&lt;<span style="color: #000000; font-weight: bold;">a</span> <span style="color: #000066;">href</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;http://projects.stoneship.org/trac/nanoc/&quot;</span>&gt;</span>Wiki<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">a</span>&gt;&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">li</span>&gt;</span>
      <span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">ul</span>&gt;</span>
    <span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">div</span>&gt;</span>
  <span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">body</span>&gt;</span>
<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">html</span>&gt;</span></pre></td></tr></table></div>

<p>Como podemos ver se trata de un fichero HTML normal y corriente, salvo por dos detalles. El primero lo encontramos en el <title></p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>4
</pre></td><td class="code"><pre class="html4strict" style="font-family:monospace;">    <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">title</span>&gt;</span>A Brand New nanoc Site - <span style="color: #009900;">&lt;%<span style="color: #66cc66;">=</span> @item<span style="color: #66cc66;">&#91;</span>:<span style="color: #000066;">title</span><span style="color: #66cc66;">&#93;</span> %&gt;&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">title</span>&gt;</span></pre></td></tr></table></div>

<p>¿Recordais que antes modificamos el fichero <code>index.yaml</code>? Bien. El contenido de ese fichero se carga en las plantillas como variables del objeto <code>@item</code>. En este caso estamos cogiendo el contenido de <code>title</code> dentro de <code>index.yaml</code> y lo estamos escribiendo en el layout como parte del título de la página.</p>
<p>El segundo detalle que nos llama la atención está en la linea 9</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>8
9
10
</pre></td><td class="code"><pre class="html4strict" style="font-family:monospace;">    <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">div</span> <span style="color: #000066;">id</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;main&quot;</span>&gt;</span>
<span style="color: #009900;">&lt;%<span style="color: #66cc66;">=</span> yield %&gt;</span>
    <span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">div</span>&gt;</span></pre></td></tr></table></div>

<p>La llamada a <code>yield</code> se sustituirá con el contenido de la página sobre la que estemos aplicando el layout. En este caso, coge el contenido de <code>content/index.html</code> y lo coloca ahí.</p>
<h3>Más información</h3>
<p>Puedes ampliar información sobre nanoc en el <a href="http://nanoc.stoneship.org/tutorial/">tutorial oficial</a>, sobre el que he basado este articulo.</p>
<p>Otro buen tutorial es <a href="http://nanoc2.jottit.com/">Maquetación ágil con nanoc 2.1</a>, de Ale Muñoz. Está escrito sobre una versión antigua, pero trata la herramienta de forma más profunda.</p>
<p>Por último y para profundizar del todo en nanoc, es de lectura obligada el <a href="http://nanoc.stoneship.org/manual/">manual oficial</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://antarticonorte.com/blog/2010/01/09/empezando-con-nanoc/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Cómo usar markdown en Rails</title>
		<link>http://antarticonorte.com/blog/2010/01/04/como-usar-markdown-en-rails/</link>
		<comments>http://antarticonorte.com/blog/2010/01/04/como-usar-markdown-en-rails/#comments</comments>
		<pubDate>Mon, 04 Jan 2010 08:30:50 +0000</pubDate>
		<dc:creator>Al-x</dc:creator>
				<category><![CDATA[Web]]></category>
		<category><![CDATA[rails]]></category>
		<category><![CDATA[ruby]]></category>
		<category><![CDATA[bluecloth]]></category>
		<category><![CDATA[markdown]]></category>

		<guid isPermaLink="false">http://antarticonorte.com/blog/?p=170</guid>
		<description><![CDATA[Me encanta markdown. Tiene una sintaxis fácil de aprender y convive muy bien con texto existente en HTML. Es un buen lenguaje para foros o blogs, ya que permite dar formato de forma sencilla sin necesidad de saber HTML.
Recientemente quería usar markdown para un proyecto que estoy haciendo con Rails. El framework ofrece un método [...]]]></description>
			<content:encoded><![CDATA[<p>Me encanta <a href="http://daringfireball.net/projects/markdown/">markdown</a>. Tiene una <a href="http://daringfireball.net/projects/markdown/syntax">sintaxis</a> fácil de aprender y convive muy bien con texto existente en HTML. Es un buen lenguaje para foros o blogs, ya que permite dar formato de forma sencilla sin necesidad de saber HTML.</p>
<p>Recientemente quería usar markdown para un proyecto que estoy haciendo con Rails. El framework <a href="http://api.rubyonrails.org/classes/ActionView/Helpers/TextHelper.html#M001750">ofrece un método</a> para trabajar directamente con markdown, pero es necesario tener instalada una librería externa a Rails. En mi caso opté por BlueCloth.</p>
<p><span id="more-170"></span></p>
<p>Para usar bluecloth basta con instalar la gema</p>
<pre class="term">
$ sudo gem install bluecloth
</pre>
<p>NOTA: en algunas guías he visto el comando <code>sudo gem install BlueCloth</code> en vez de <code>bluecloth</code>. RubyGems es sensible a mayúsculas y minúsculas y al usar <code>BlueCloth</code> se instala una versión antigua de la gema.</p>
<h3>Haciendo que Rails reconozca bluecloth</h3>
<p>Para que Rails permita usar el método <code>markdown</code> debemos indicarle que queremos usar bluecloth. Para ello modificamos el fichero <code>config/environment.rb</code></p>

<div class="wp_syntax"><div class="code"><pre class="ruby" style="font-family:monospace;"><span style="color:#6666ff; font-weight:bold;">Rails::Initializer</span>.<span style="color:#9900CC;">run</span> <span style="color:#9966CC; font-weight:bold;">do</span> <span style="color:#006600; font-weight:bold;">|</span>config<span style="color:#006600; font-weight:bold;">|</span>
  ...
  <span style="color:#9900CC;">config</span>.<span style="color:#9900CC;">gem</span> <span style="color:#996600;">&quot;bluecloth&quot;</span>
  ...
<span style="color:#9966CC; font-weight:bold;">end</span></pre></div></div>

<p>Reiniciamos el servidor de desarrollo para que reconozca nuestros cambios y voila! Usar markdown en nuestras vistas es tan simple como llamar al helper <code>markdown</code></p>

<div class="wp_syntax"><div class="code"><pre class="html4strict" style="font-family:monospace;"><span style="color: #808080; font-style: italic;">&lt;!-- cosas... --&gt;</span>
<span style="color: #009900;">&lt;%<span style="color: #66cc66;">=</span> markdown variable %&gt;</span>
<span style="color: #808080; font-style: italic;">&lt;!-- otras cosas... --&gt;</span></pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://antarticonorte.com/blog/2010/01/04/como-usar-markdown-en-rails/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>De marcha con los zombies</title>
		<link>http://antarticonorte.com/blog/2009/02/09/de-marcha-con-los-zombies/</link>
		<comments>http://antarticonorte.com/blog/2009/02/09/de-marcha-con-los-zombies/#comments</comments>
		<pubDate>Sun, 08 Feb 2009 23:12:40 +0000</pubDate>
		<dc:creator>Al-x</dc:creator>
				<category><![CDATA[Fotografía]]></category>

		<guid isPermaLink="false">http://antarticonorte.com/?p=126</guid>
		<description><![CDATA[

Ayer sábado fue la Marcha zombie Madrid. Es una marcha en honor al nacimiento de George A. Romero, considerado el padre del arquetipo zombie.
Por motivos que no recuerdo, no pude asistir a las ediciones pasadas, pero este año allí estuve, rodeado de no-muertos, de otros fotógrafos y de híbridos de ambas cosas.
El set completo podeis [...]]]></description>
			<content:encoded><![CDATA[<div class="estirar">
<a href="http://www.flickr.com/photos/antarticonorte/3260633277/" title="Marcha Zombie Madrid 2009 por AntarticoNorte, en Flickr"><img class="boxed drcha" src="http://farm4.static.flickr.com/3494/3260633277_9f863ec7a6.jpg" width="333" height="500" alt="Marcha Zombie Madrid 2009" style="margin-bottom:10px;" /></a></p>
<p>Ayer sábado fue la <a href="http://marchazombi.es">Marcha zombie Madrid</a>. Es una marcha en honor al nacimiento de <a href="http://es.wikipedia.org/wiki/George_A._Romero">George A. Romero</a>, considerado el padre del arquetipo zombie.</p>
<p>Por motivos que no recuerdo, no pude asistir a las ediciones pasadas, pero este año allí estuve, rodeado de no-muertos, de otros fotógrafos y de híbridos de ambas cosas.</p>
<p>El <a href="http://flickr.com/photos/antarticonorte/sets/72157613480495466/">set completo</a> podeis verlo en mi <a href="http://flickr.com/photos/antarticonorte/">flickr</a>
</div>
]]></content:encoded>
			<wfw:commentRss>http://antarticonorte.com/blog/2009/02/09/de-marcha-con-los-zombies/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Pongame&#8230;</title>
		<link>http://antarticonorte.com/blog/2009/01/27/pongame/</link>
		<comments>http://antarticonorte.com/blog/2009/01/27/pongame/#comments</comments>
		<pubDate>Tue, 27 Jan 2009 14:18:02 +0000</pubDate>
		<dc:creator>Al-x</dc:creator>
				<category><![CDATA[wtf]]></category>
		<category><![CDATA[beicon]]></category>
		<category><![CDATA[sandguix]]></category>

		<guid isPermaLink="false">http://antarticonorte.com/?p=122</guid>
		<description><![CDATA[
&#8230;uno de esos sanguixes de beicon por favor.
Capturado en una cafetería de Campo de los cojones naciones
]]></description>
			<content:encoded><![CDATA[<p><img src="http://antarticonorte.com/blog/wp-content/uploads/2009/01/sanguix-con-beicon.jpg" alt="sanguix-con-beicon" title="sanguix-con-beicon" width="500" height="333" class="boxed" /></p>
<p>&#8230;uno de esos sanguixes de beicon por favor.</p>
<p>Capturado en una cafetería de Campo de los <del>cojones</del> naciones</p>
]]></content:encoded>
			<wfw:commentRss>http://antarticonorte.com/blog/2009/01/27/pongame/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Cinco programas imprescindibles para OS X</title>
		<link>http://antarticonorte.com/blog/2009/01/25/cinco-programas-imprescindibles-para-os-x/</link>
		<comments>http://antarticonorte.com/blog/2009/01/25/cinco-programas-imprescindibles-para-os-x/#comments</comments>
		<pubDate>Sun, 25 Jan 2009 17:45:43 +0000</pubDate>
		<dc:creator>Al-x</dc:creator>
				<category><![CDATA[Personal]]></category>
		<category><![CDATA[Links]]></category>
		<category><![CDATA[os x]]></category>

		<guid isPermaLink="false">http://antarticonorte.com/?p=115</guid>
		<description><![CDATA[Me cae una pedrada desde la gaviota asesina. Por lo visto tenía el blog un poco muerto y la ha tirado para ver si se seguía moviendo o algo.
Ahí van mis cinco:

Textmate: EL editor de código. Con soporte para un porrón de lenguajes y con la posiblidad de crear los tuyos propios. El día que [...]]]></description>
			<content:encoded><![CDATA[<p>Me cae una pedrada desde <a href="http://lagaviotaasesina.blogspot.com/2009/01/cinco-programas-imprescindibles-o-no.html">la gaviota asesina</a>. Por lo visto tenía el blog un poco muerto y la ha tirado para ver si se seguía moviendo o algo.</p>
<p>Ahí van mis cinco:</p>
<ol>
<li><a href="http://macromates.com/">Textmate</a>: <em>EL</em> editor de código. Con soporte para un porrón de lenguajes y con la posiblidad de crear los tuyos propios. El día que le pongan autocompletado de código de verdad se convertirá en el editor perfecto.</li>
<li><a href="http://docs.blacktree.com/quicksilver/what_is_quicksilver">Quicksilver</a>: Algo así como una navaja suiza. Su principal funcion es la de lanzador de aplicaciones, pero es capaz de mucho más.</li>
<li><a href="http://www.adiumx.com/">Adium</a>: El sustituto perfecto para el messenger de microsoft (al que detesto con avaricia). Puede usarse con más redes de mensajería.</li>
<li><a href="http://www.vienna-rss.org/">Vienna</a>: Un lector de feeds de escritorio libre y gratuito.</li>
<li><a href="http://cyberduck.ch/">Cyberduck</a>: Un cliente de FTP, libre y gratuito también. Se integra bastante bien con textmate para editar los ficheros directamente en el servidor.</li>
</ol>
<p>Tiro la piedra al aire a ver donde cae. El que quiera poner una lista de cinco programas que use en su sistema operativo de elección, que lo haga.</p>
]]></content:encoded>
			<wfw:commentRss>http://antarticonorte.com/blog/2009/01/25/cinco-programas-imprescindibles-para-os-x/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Fuentes relativas en CSS</title>
		<link>http://antarticonorte.com/blog/2008/09/24/fuentes-relativas-en-css/</link>
		<comments>http://antarticonorte.com/blog/2008/09/24/fuentes-relativas-en-css/#comments</comments>
		<pubDate>Wed, 24 Sep 2008 21:00:49 +0000</pubDate>
		<dc:creator>Al-x</dc:creator>
				<category><![CDATA[Web]]></category>
		<category><![CDATA[css]]></category>
		<category><![CDATA[fuentes]]></category>
		<category><![CDATA[html]]></category>
		<category><![CDATA[ie]]></category>

		<guid isPermaLink="false">http://antarticonorte.com/?p=42</guid>
		<description><![CDATA[En algún momento de nuestra carrera profesional, todos nosotros hemos oído o leido que debemos usar tamaños de fuentes relativos (si no es el caso, te lo digo yo: debes usar tamaños de fuentes relativos).
¿Por qué debo yo usar fuentes relativos?
Simple: por usabilidad.

Como diseñadores, tenemos que dar al usuario la posibilidad de usar el tamaño [...]]]></description>
			<content:encoded><![CDATA[<p>En algún momento de nuestra carrera profesional, todos nosotros hemos oído o leido que debemos usar tamaños de fuentes relativos (si no es el caso, te lo digo yo: debes usar tamaños de fuentes relativos).</p>
<h3>¿Por qué debo yo usar fuentes relativos?</h3>
<p>Simple: por usabilidad.</p>
<p><span id="more-42"></span></p>
<p>Como diseñadores, tenemos que dar al usuario la posibilidad de usar el tamaño de fuente que ellos quieran. Usando un tamaño de fuente absoluto estamos quitando esta opción a los usuarios, a muchos usuarios (los que usan ese <em title="Internet explorer">gran amigo</em> de los diseñadores y desarrolladores web).</p>
<p>Cojamos una web cualquiera al azar, como por ejemplo <a href="http://www.elpais.com">elpais.com</a>.</p>
<p><img src="http://antarticonorte.com/blog/wp-content/uploads/2008/09/imagen-1.png" alt="" title="elpais.com tamaño de fuente medio" /></p>
<p>Ahora ir al menú Ver &gt; Tamaño de fuente &gt; La más grande.</p>
<p><a href="http://antarticonorte.com/blog/wp-content/uploads/2008/09/menu-ie.png"><img src="http://antarticonorte.com/blog/wp-content/uploads/2008/09/menu-ie.png" alt="" title="menu-ie" class="boxed" /></a></p>
<p>Y podemos ver como el texto no cambia, tiene el mismo tamaño:</p>
<p><img src="http://antarticonorte.com/blog/wp-content/uploads/2008/09/imagen-1.png" alt="" title="elpais.com tamaño de fuente más grande." /></p>
<h3>Cómo usar fuentes relativas</h3>
<p>Para poder usar tamaños relativos de fuente, debemos partir de la base de que casi todos los navegadores tienen un tamaño estándar de 16px. Sabiendo esto sólo tenemos que hacer algo de matemáticas y usar <em>em</em> como unidad para las fuentes.</p>
<p>Por definición, 1em equivale al tamaño de fuente que estemos utilizando (en nuestro caso 16px). Así 2em equivalen a 32px y 0.5em a 8px.</p>
<p>Si queremos que el tamaño de todos los <code>&ld;p /&gt;</code> de nuestra página tengan un tamaño de fuente de 12px, tendremos que usar el siguiente CSS</p>

<div class="wp_syntax"><div class="code"><pre class="css" style="font-family:monospace;">p <span style="color: #00AA00;">&#123;</span> <span style="color: #000000; font-weight: bold;">font-size</span><span style="color: #00AA00;">:</span><span style="color: #933;">.75em</span><span style="color: #00AA00;">;</span> <span style="color: #00AA00;">&#125;</span></pre></div></div>

<p>Calcular el tamaño de todos los elementos puede ser una tarea tediosa (y odiosa). Podemos simplificarlo cambiando el tamaño de fuente del documento a 10px de forma que las conversiones sean más directas (1em = 10px, 1.2em = 12px, &#8230;)</p>

<div class="wp_syntax"><div class="code"><pre class="css" style="font-family:monospace;">html <span style="color: #00AA00;">&#123;</span> <span style="color: #000000; font-weight: bold;">font-size</span><span style="color: #00AA00;">:</span><span style="color: #933;"><span style="color: #cc66cc;">62.5</span>%</span><span style="color: #00AA00;">;</span> <span style="color: #00AA00;">&#125;</span> <span style="color: #808080; font-style: italic;">/* 10/16 = 0.625. Usamos porcentajes por que hay navegadores que discriminan el tercer decimal */</span>
p <span style="color: #00AA00;">&#123;</span> <span style="color: #000000; font-weight: bold;">font-size</span><span style="color: #00AA00;">:</span><span style="color: #933;">1.2em</span><span style="color: #00AA00;">;</span> <span style="color: #00AA00;">&#125;</span></pre></div></div>

<h3>Mas allá: unidades relativas para las medidas</h3>
<p>Podemos hacer que el <em>layout</em> de la página se adapte al tamaño de fuente del usuario usando unidades relativas para los anchos. Como hemos establecido un tamaño base de 10px la conversión es directa.</p>
<p>Supongamos el siguiente layout:</p>

<div class="wp_syntax"><div class="code"><pre class="html" style="font-family:monospace;">&lt;div class=&quot;container&quot;&gt;
	&lt;div class=&quot;col1&quot;&gt;&lt;h2&gt;lorem ipsum dolor sit amet&lt;/h2&gt;&lt;/div&gt;
	&lt;div class=&quot;col2&quot;&gt;&lt;h2&gt;consequecter adipliscing elit&lt;/h2&gt;&lt;/div&gt;
	&lt;div style=&quot;clear:both;&quot;&gt;&lt;/div&gt;
&lt;/div&gt;</pre></div></div>


<div class="wp_syntax"><div class="code"><pre class="css" style="font-family:monospace;"><span style="color: #6666ff;">.container</span> <span style="color: #00AA00;">&#123;</span> <span style="color: #000000; font-weight: bold;">width</span><span style="color: #00AA00;">:</span><span style="color: #933;">300px</span><span style="color: #00AA00;">;</span> <span style="color: #000000; font-weight: bold;">margin</span><span style="color: #00AA00;">:</span><span style="color: #cc66cc;">0</span> <span style="color: #993333;">auto</span><span style="color: #00AA00;">;</span> <span style="color: #00AA00;">&#125;</span>
<span style="color: #6666ff;">.col1</span> <span style="color: #00AA00;">&#123;</span> <span style="color: #000000; font-weight: bold;">float</span><span style="color: #00AA00;">:</span><span style="color: #000000; font-weight: bold;">left</span><span style="color: #00AA00;">;</span> <span style="color: #000000; font-weight: bold;">width</span><span style="color: #00AA00;">:</span> <span style="color: #933;">100px</span><span style="color: #00AA00;">;</span> <span style="color: #00AA00;">&#125;</span>
<span style="color: #6666ff;">.col2</span> <span style="color: #00AA00;">&#123;</span> <span style="color: #000000; font-weight: bold;">float</span><span style="color: #00AA00;">:</span><span style="color: #000000; font-weight: bold;">right</span><span style="color: #00AA00;">;</span> <span style="color: #000000; font-weight: bold;">width</span><span style="color: #00AA00;">:</span><span style="color: #933;">200px</span><span style="color: #00AA00;">;</span> <span style="color: #00AA00;">&#125;</span>
h2 <span style="color: #00AA00;">&#123;</span> <span style="color: #000000; font-weight: bold;">font-size</span><span style="color: #00AA00;">:</span><span style="color: #933;">2em</span><span style="color: #00AA00;">;</span> <span style="color: #00AA00;">&#125;</span></pre></div></div>

<p>Si aumentamos el tamaño de la fuente con el navegador, llegará un momento en el que el texto no entre en las columnas y se solapen. Sin embargo, si utilizamos el siguiente CSS</p>

<div class="wp_syntax"><div class="code"><pre class="css" style="font-family:monospace;"><span style="color: #6666ff;">.container</span> <span style="color: #00AA00;">&#123;</span><span style="color: #000000; font-weight: bold;">width</span><span style="color: #00AA00;">:</span><span style="color: #933;">30em</span><span style="color: #00AA00;">;</span><span style="color: #00AA00;">&#125;</span>
<span style="color: #6666ff;">.col1</span> <span style="color: #00AA00;">&#123;</span><span style="color: #000000; font-weight: bold;">width</span><span style="color: #00AA00;">:</span><span style="color: #933;">10em</span><span style="color: #00AA00;">;</span><span style="color: #00AA00;">&#125;</span>
<span style="color: #6666ff;">.col2</span> <span style="color: #00AA00;">&#123;</span><span style="color: #000000; font-weight: bold;">width</span><span style="color: #00AA00;">:</span><span style="color: #933;">20em</span><span style="color: #00AA00;">;</span><span style="color: #00AA00;">&#125;</span></pre></div></div>

<p>Al aumentar el tamaño de la fuente, aumentará de forma proporcional el ancho de las columnas, por lo que nunca se llegará a solapar el texto de una sobre el de otra.</p>
]]></content:encoded>
			<wfw:commentRss>http://antarticonorte.com/blog/2008/09/24/fuentes-relativas-en-css/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Conducir en Sada</title>
		<link>http://antarticonorte.com/blog/2008/09/03/conducir-en-sada/</link>
		<comments>http://antarticonorte.com/blog/2008/09/03/conducir-en-sada/#comments</comments>
		<pubDate>Wed, 03 Sep 2008 15:11:33 +0000</pubDate>
		<dc:creator>Al-x</dc:creator>
				<category><![CDATA[Fotografía]]></category>
		<category><![CDATA[sada]]></category>
		<category><![CDATA[tráfico]]></category>

		<guid isPermaLink="false">http://antarticonorte.com/?p=36</guid>
		<description><![CDATA[Una situación un tanto WTF me he encontrado hoy andando por Sada.

¡Donde puedo ir! ¡Incertidumbre! 
]]></description>
			<content:encoded><![CDATA[<p>Una situación un tanto WTF me he encontrado hoy andando por <a href="http://maps.google.com/maps?f=q&#038;hl=en&#038;geocode=&#038;q=Calle+portales,+Sada,+galicia&#038;sll=43.351147,-8.254509&#038;sspn=0.131316,0.315857&#038;ie=UTF8&#038;ll=43.352879,-8.254745&#038;spn=0.008207,0.019741&#038;z=16&#038;iwloc=addr">Sada</a>.</p>
<p><a href="http://www.flickr.com/photos/antarticonorte/2825208158/" title="¿Y ahora que? por AntarticoNorte, en Flickr"><img class="boxed" src="http://farm4.static.flickr.com/3040/2825208158_e5595d31b8.jpg" width="500" height="500" alt="¿Y ahora que?" /></a></p>
<p>¡Donde puedo ir! ¡Incertidumbre! </p>
]]></content:encoded>
			<wfw:commentRss>http://antarticonorte.com/blog/2008/09/03/conducir-en-sada/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Rascafría</title>
		<link>http://antarticonorte.com/blog/2008/07/27/rascafria/</link>
		<comments>http://antarticonorte.com/blog/2008/07/27/rascafria/#comments</comments>
		<pubDate>Sun, 27 Jul 2008 14:34:55 +0000</pubDate>
		<dc:creator>Al-x</dc:creator>
				<category><![CDATA[Fotografía]]></category>

		<guid isPermaLink="false">http://antarticonorte.com/?p=34</guid>
		<description><![CDATA[En un pueblecito del norte de Madrid que hace honor a su nombre (que frío pasamos&#8230;), subiendo por una pista forestal se puede llegar a un claro donde los jóvenes suben en pareja con sus utilitarios de segunda mano para experimentar las cosas de la vida y del amor.
Pero además de fornicadores en potencia hay [...]]]></description>
			<content:encoded><![CDATA[<p>En un pueblecito del norte de Madrid que hace honor a su nombre (que frío pasamos&#8230;), subiendo por una pista forestal se puede llegar a un claro donde los jóvenes suben en pareja con sus utilitarios de segunda mano para experimentar las cosas de la vida y del amor.</p>
<p>Pero además de fornicadores en potencia hay un cielo estrellado precioso, apenas contaminado por la luz de la capital, donde se puede experimentar con fotografía nocturna.</p>
<p><a href="http://www.flickr.com/photos/antarticonorte/2706581390/" title="Rascafria por AntarticoNorte, en Flickr"><img src="http://farm4.static.flickr.com/3276/2706581390_3419a8f757.jpg" width="500" height="333" alt="Rascafria" class="boxed" /></a></p>
<p>Para este tipo de tomas es mejor subir acompañado (para no aburrirse, por eso de no poder tocar la cámara en 20-30 minutos..) y a ser posible con más de una cámara. Mientras dejas una de ellas haciendo una foto de esas largas puedes hacer el tonto con la otra.</p>
]]></content:encoded>
			<wfw:commentRss>http://antarticonorte.com/blog/2008/07/27/rascafria/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>León vs Madrid</title>
		<link>http://antarticonorte.com/blog/2008/07/24/leon-vs-madrid/</link>
		<comments>http://antarticonorte.com/blog/2008/07/24/leon-vs-madrid/#comments</comments>
		<pubDate>Thu, 24 Jul 2008 19:37:56 +0000</pubDate>
		<dc:creator>Al-x</dc:creator>
				<category><![CDATA[Personal]]></category>

		<guid isPermaLink="false">http://antarticonorte.com/?p=32</guid>
		<description><![CDATA[Me quiero ir a mi tierra a pasar frio  

]]></description>
			<content:encoded><![CDATA[<p>Me quiero ir a mi tierra a pasar frio <img src='http://antarticonorte.com/blog/wp-includes/images/smilies/icon_sad.gif' alt=':(' class='wp-smiley' /> </p>
<p><img src="http://antarticonorte.com/blog/wp-content/uploads/2008/07/imagen-3.png" alt="" title="imagen-3" width="499" height="177" class="boxed" /></p>
]]></content:encoded>
			<wfw:commentRss>http://antarticonorte.com/blog/2008/07/24/leon-vs-madrid/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>
