Created
January 15, 2011 15:41
-
-
Save xenda/780988 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #original | |
| {% assign page = pages['hi-there'] %} | |
| {% if page %} | |
| <h2>{{ page.title }} </h2> | |
| {{ page.content }} | |
| {% endif %} | |
| #opcion1 | |
| {% page 'hi-there' %} | |
| <h2>{{ page.title }} </h2> | |
| {{ page.content }} | |
| {% endpage %} | |
| #opción final | |
| {% getpage 'hi-there' %} | |
| <h2>{{ page.title }} </h2> | |
| {{ page.content }} | |
| {% endgetpage %} | |
| #opcion final (buscando por id) | |
| {% getpage 'id', 5 %} | |
| <h2>{{ page.title }} </h2> | |
| {{ page.content }} | |
| {% endgetpage %} | |
Author
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
El código lo que hace es asignar a la variable "page" el objeto Page cuyo permalink sea "hi-there" y luego la usa para imprimir contenido.
{% %} ejecuta código
{{ }} imprime el resultado