From c7816c5b523739045b0c9a54d75d370737a622f3 Mon Sep 17 00:00:00 2001 From: Ryan Watters Date: Thu, 6 Apr 2017 17:04:05 -0500 Subject: [PATCH] Update single page examples to use more recent Hugo features --- content/functions/with.md | 6 +- content/templates/lookup-order.md | 2 + content/templates/shortcode-templates.md | 20 ++++--- content/templates/single-page-templates.md | 67 +++++++++++----------- 4 files changed, 52 insertions(+), 43 deletions(-) diff --git a/content/functions/with.md b/content/functions/with.md index d3c131530..c0d8a2db2 100644 --- a/content/functions/with.md +++ b/content/functions/with.md @@ -16,11 +16,13 @@ relatedfuncs: [] deprecated: false --- -An alternative way of writing the "`if`" and then referencing the same value is to use `with` instead. `with` rebinds the context (`.`) within its scope and skips the block if the variable is absent: +An alternative way of writing the "`if`" and then referencing the same value is to use `with` instead. `with` rebinds the context (`.`) within its scope and skips the block if the variable is absent. + +The following example checks for a [user-defined site variable](/variables/site/) defined as `twitteruser` in your [site configuration](/getting-started/configuration/). If the key-value is not set, the following will render nothing: {{% code file="layouts/partials/twitter.html" %}} ```html -{{with .Site.Params.TwitterUser}} +{{with .Site.Params.twitteruser}}