15. YAML
Metadatos en el propio archivo del post
---
title: Happy Birthday Sculpin!
tags:
- sculpin
- markdown
categories:
- personal
---
16. Twig
{% set year = '0' %}
<h2>Posts Archive</h2>
{% for post in page.pagination.items %}
{% set this_year %}{{ post.date | date("Y") }}{% endset %}
{% if year != this_year %}
{% set month = '0' %}
{% set year = this_year %}
{% endif %}
{% set this_month %}{{ post.date | date("F") }}{% endset %}
{% if month != this_month %}
{% set month = this_month %}
...
17. Markdown
Heading
=======
Sub-heading
-----------------
Paragraphs are separated
by a blank line.
Text attributes *italic*,
**bold**, `monospace`.
A [link](http://example.com).
<<< No space between ] and ( >>>
Shopping list:
* apples
* oranges
* pears
Numbered list:
1. apples
2. oranges
3. pears
The rain---not the reign---in Spain.
Reemplazo ASCII de código HTML
18. Archivos estáticos
● Todo archivo en la carpeta correspondiente es el
equivalente a una entrada en base de datos (entidad).
● Generators: Páginas “plantilla” para mostrar estas
entidades o listados de ellas.
○ { use: [posts_categories] }
■ { % for category,posts in data.posts_categories %}
○ { generator: pagination} ... { use: [posts] }
■ {% for post in page.pagination.items %}
19. Archivos estáticos
● Mejor rendimiento no se puede!!
● Sistema de layouts jerárquico gracias a Twig
---
layout: default
---
● Árbol de directorios sencillo
○ app/config → YAML’s de configuraciones
○ source → Código fuente
○ source/_posts → Entidades “dinámicas” (en el ejemplo: posts)
○ output_prod → Salida HTML para subir
31. También backend!!
● Sculpin utiliza el HTTP Kernel de Symfony.
● Sistema de eventos.
● Se pueden utilizar bundles de Symfony para
extender Sculpin con funcionalidades más
avanzadas!!!