Declare variables on-the-fly and use them anywhere
Substituting
Declaring and using variables in your BLUEPHRASE templates gives them the flexibility to be used over and over.
Substitution variables allow you to apply different textual content within standard templates.
Use of the include
and enclosure
pragmas are two templating techniques that organize your body of work. They provide branding and cohesion when used consistently across your body of work. Substitution variables provide flexibility to your custom templates, allowing them to be used in different contexts.
Variable notation uses the dollar-sign symbol $, like this:
$DESCRIPTION="Give me a day, with the sun on my shoulders, with a breeze on my face, with the earth between my toes, and I will thank you forever."
$KEYWORDS="joy,shoulders,face,toes"
$TITLE="Give Me a Day with Joy"
When these variables are declared, they can be used elsewhere in your writing. Consider this enclosure template ...
html {
head {
meta *charset=UTF-8
meta *name=viewport *content='width=device-width, initial-scale=1'
meta *name=description *content='$DESCRIPTION'
meta *name=keywords *content='$KEYWORDS'
title $TITLE
}
body {
!target-matter
}
}
... and this web page ...
!enclosure #poem `./std-template.blue`
$DESCRIPTION="Give me a day with joy, and I will thank you forever."
$KEYWORDS="joy, shoulders, face, toes"
$TITLE="Give Me a Day with Joy"
article#poem {
Give me a day,
with the sun on my shoulders,
with a breeze on my face,
with the earth between my toes,
and I will thank you forever.
}
The substitution variables are applied to the enclosure template resulting in a final HTML document like this:
<html>
<head>
<meta charset=UTF-8 />
<meta name=viewport content='width=device-width, initial-scale=1' />
<meta name=description content='Give me a day with joy, and I will thank you forever.' />
<meta name=keywords content='joy, shoulders, face, toes' />
<title>Give Me a Day with Joy</title>
</head>
<body>
<article id=poem>
<p>Give me a day,</p>
<p>with the sun on my shoulders,</p>
<p>with a breeze on my face,</p>
<p>with the earth between my toes,</p>
<p>and I will thank you forever.</p>
</article>
</body>
</html>