Skip to content

Instantly share code, notes, and snippets.

@xenda
Created January 15, 2011 15:41
Show Gist options
  • Select an option

  • Save xenda/780988 to your computer and use it in GitHub Desktop.

Select an option

Save xenda/780988 to your computer and use it in GitHub Desktop.
#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 %}
@xenda
Copy link
Author

xenda commented Jan 15, 2011

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment