From 03e9d0182d03779632d96bbce2e9f67d32e4eeaf Mon Sep 17 00:00:00 2001 From: karl Date: Sat, 3 Aug 2013 00:31:43 -0400 Subject: [PATCH 1/3] Fixing documentation according to Issue #362. The documentation as it is right now produces a CRITICAL: 'article' is undefined --- docs/faq.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/faq.rst b/docs/faq.rst index a8043e07..8eafba3f 100644 --- a/docs/faq.rst +++ b/docs/faq.rst @@ -92,7 +92,7 @@ For reStructuredText, this metadata should of course be prefixed with a colon:: This metadata can then be accessed in the template:: - {% if article.modified %} + {% if article and article.modified %} Last modified: {{ article.modified }} {% endif %} From 6a0d19ef5c22ad8434f70bc650944419dcd98f8f Mon Sep 17 00:00:00 2001 From: karl Date: Sat, 3 Aug 2013 12:47:44 -0400 Subject: [PATCH 2/3] Adding context to the documentation for metadata Giving a longer description Thanks to justin mayer for #995 --- docs/faq.rst | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/docs/faq.rst b/docs/faq.rst index 8eafba3f..bb348d45 100644 --- a/docs/faq.rst +++ b/docs/faq.rst @@ -90,12 +90,16 @@ For reStructuredText, this metadata should of course be prefixed with a colon:: :Modified: 2012-08-08 -This metadata can then be accessed in the template:: +This metadata can then be accessed in templates such as `article.html` via:: - {% if article and article.modified %} + {% if article.modified %} Last modified: {{ article.modified }} {% endif %} +If you want to include metadata in templates outside the article context (e.g., `base.html`), the `if` statement should instead be: + + {% if article and article.modified %} + How do I assign custom templates on a per-page basis? ===================================================== From a4ce664f176f668eb56402ae978a29c943dc0f22 Mon Sep 17 00:00:00 2001 From: karl Date: Sat, 3 Aug 2013 22:31:54 -0400 Subject: [PATCH 3/3] fixing the inline code markup --- docs/faq.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/faq.rst b/docs/faq.rst index bb348d45..2cd363d8 100644 --- a/docs/faq.rst +++ b/docs/faq.rst @@ -90,13 +90,13 @@ For reStructuredText, this metadata should of course be prefixed with a colon:: :Modified: 2012-08-08 -This metadata can then be accessed in templates such as `article.html` via:: +This metadata can then be accessed in templates such as ``article.html`` via:: {% if article.modified %} Last modified: {{ article.modified }} {% endif %} -If you want to include metadata in templates outside the article context (e.g., `base.html`), the `if` statement should instead be: +If you want to include metadata in templates outside the article context (e.g., ``base.html``), the ``if`` statement should instead be: {% if article and article.modified %}