How to pass a string containing quotes as an `include` parameter in Liquid/Jekyll? The Next CEO of Stack OverflowIn YAML, how do I break a string over multiple lines?Jekyll/Liquid - how to add large blocks of text to YAML front matter?Sorted navigation menu with Jekyll and LiquidInclude jekyll / liquid template data in a YAML variable?How do I include “% %” in markdown file when using jekyll?Passing parameters to inclusion in Liquid templatesJekyll: parametric (partial?) includeHow to concatenate / append a string to another one in Jekyll / Liquid?Passing Jekyll variables “up” scopeJekyll / Liquid: Passing an Array into an Include and Looping
What is the difference between "behavior" and "behaviour"?
What is the purpose of the Evocation wizard's Potent Cantrip feature?
% symbol leads to superlong (forever?) compilations
When did Lisp start using symbols for arithmetic?
Inappropriate reference requests from Journal reviewers
Why didn't Khan get resurrected in the Genesis Explosion?
Are there languages with no euphemisms?
How do I get the green key off the shelf in the Dobby level of Lego Harry Potter 2?
How do we know the LHC results are robust?
If the heap is initialized for security, then why is the stack uninitialized?
Can the Reverse Gravity spell affect the Meteor Swarm spell?
Too much space between section and text in a twocolumn document
Why here is plural "We went to the movies last night."
Customer Requests (Sometimes) Drive Me Bonkers!
How should I support this large drywall patch?
How easy is it to start Magic from scratch?
Is it okay to store user locations?
Why is there a PLL in CPU?
What size rim is OK?
How do I solve this limit?
Text adventure game code
Horror movie/show or scene where a horse creature opens its mouth really wide and devours a man in a stables
Grabbing quick drinks
Increase performance creating Mandelbrot set in python
How to pass a string containing quotes as an `include` parameter in Liquid/Jekyll?
The Next CEO of Stack OverflowIn YAML, how do I break a string over multiple lines?Jekyll/Liquid - how to add large blocks of text to YAML front matter?Sorted navigation menu with Jekyll and LiquidInclude jekyll / liquid template data in a YAML variable?How do I include “% %” in markdown file when using jekyll?Passing parameters to inclusion in Liquid templatesJekyll: parametric (partial?) includeHow to concatenate / append a string to another one in Jekyll / Liquid?Passing Jekyll variables “up” scopeJekyll / Liquid: Passing an Array into an Include and Looping
Consider: I want to pass a block of text as a parameter in an include
tag. The block of text contains a quote. For example:
Breaking news:
Area man says, "This is newsworthy!"
There are several ways I can think of to do this:
1. Wrap in single quotes
%
include newsitem.html
content='Breaking news:
Area man says, "This is newsworthy!"'
%
This is not ideal since there may be single quotes/apostrophes in the text block.
2. Use captures
% capture newscontent %
Breaking news:
Area man says, "This is newsworthy!"
% endcapture %
%
include newsitem.html
content=newscontent
%
This is not ideal because it is verbose.
3. Escape quotes
%
include newsitem.html
content="Breaking news:
Area man says, "This is newsworthy!""
%
This is not ideal because if there are many quotes then they will all need backslashes, which will be tiresome to add.
4. Use captures
and include
% capture content %% include_relative newscontent.md %% endcapture %
%
include newsitem.html
content=content
%
This is not really ideal because it is also fairly verbose.
5. Use frontmatter and/or YAML
---
newscontent: |
Breaking news:
Area man says, "This is newsworthy!"
---
%
include newsitem.html
content=page.newscontent
%
This is not ideal because it spreads out page content in a weird way.
Now, I absolutely admit these are all really trivial complaints. But mostly in order to gain a better familiarity with Jekyll/liquid, I'd like to know if there's another way to pass multi-line parameters containing quotes to include
. What would be GREAT is if I could use backtics, or some other character that isn't very common in textual content:
%
include newsitem.html
content=`Breaking news:
Area man says, "This is newsworthy!"`
%
Unfortunately this doesn't seem to be supported. What are your thoughts? Thanks!
yaml jekyll liquid
add a comment |
Consider: I want to pass a block of text as a parameter in an include
tag. The block of text contains a quote. For example:
Breaking news:
Area man says, "This is newsworthy!"
There are several ways I can think of to do this:
1. Wrap in single quotes
%
include newsitem.html
content='Breaking news:
Area man says, "This is newsworthy!"'
%
This is not ideal since there may be single quotes/apostrophes in the text block.
2. Use captures
% capture newscontent %
Breaking news:
Area man says, "This is newsworthy!"
% endcapture %
%
include newsitem.html
content=newscontent
%
This is not ideal because it is verbose.
3. Escape quotes
%
include newsitem.html
content="Breaking news:
Area man says, "This is newsworthy!""
%
This is not ideal because if there are many quotes then they will all need backslashes, which will be tiresome to add.
4. Use captures
and include
% capture content %% include_relative newscontent.md %% endcapture %
%
include newsitem.html
content=content
%
This is not really ideal because it is also fairly verbose.
5. Use frontmatter and/or YAML
---
newscontent: |
Breaking news:
Area man says, "This is newsworthy!"
---
%
include newsitem.html
content=page.newscontent
%
This is not ideal because it spreads out page content in a weird way.
Now, I absolutely admit these are all really trivial complaints. But mostly in order to gain a better familiarity with Jekyll/liquid, I'd like to know if there's another way to pass multi-line parameters containing quotes to include
. What would be GREAT is if I could use backtics, or some other character that isn't very common in textual content:
%
include newsitem.html
content=`Breaking news:
Area man says, "This is newsworthy!"`
%
Unfortunately this doesn't seem to be supported. What are your thoughts? Thanks!
yaml jekyll liquid
add a comment |
Consider: I want to pass a block of text as a parameter in an include
tag. The block of text contains a quote. For example:
Breaking news:
Area man says, "This is newsworthy!"
There are several ways I can think of to do this:
1. Wrap in single quotes
%
include newsitem.html
content='Breaking news:
Area man says, "This is newsworthy!"'
%
This is not ideal since there may be single quotes/apostrophes in the text block.
2. Use captures
% capture newscontent %
Breaking news:
Area man says, "This is newsworthy!"
% endcapture %
%
include newsitem.html
content=newscontent
%
This is not ideal because it is verbose.
3. Escape quotes
%
include newsitem.html
content="Breaking news:
Area man says, "This is newsworthy!""
%
This is not ideal because if there are many quotes then they will all need backslashes, which will be tiresome to add.
4. Use captures
and include
% capture content %% include_relative newscontent.md %% endcapture %
%
include newsitem.html
content=content
%
This is not really ideal because it is also fairly verbose.
5. Use frontmatter and/or YAML
---
newscontent: |
Breaking news:
Area man says, "This is newsworthy!"
---
%
include newsitem.html
content=page.newscontent
%
This is not ideal because it spreads out page content in a weird way.
Now, I absolutely admit these are all really trivial complaints. But mostly in order to gain a better familiarity with Jekyll/liquid, I'd like to know if there's another way to pass multi-line parameters containing quotes to include
. What would be GREAT is if I could use backtics, or some other character that isn't very common in textual content:
%
include newsitem.html
content=`Breaking news:
Area man says, "This is newsworthy!"`
%
Unfortunately this doesn't seem to be supported. What are your thoughts? Thanks!
yaml jekyll liquid
Consider: I want to pass a block of text as a parameter in an include
tag. The block of text contains a quote. For example:
Breaking news:
Area man says, "This is newsworthy!"
There are several ways I can think of to do this:
1. Wrap in single quotes
%
include newsitem.html
content='Breaking news:
Area man says, "This is newsworthy!"'
%
This is not ideal since there may be single quotes/apostrophes in the text block.
2. Use captures
% capture newscontent %
Breaking news:
Area man says, "This is newsworthy!"
% endcapture %
%
include newsitem.html
content=newscontent
%
This is not ideal because it is verbose.
3. Escape quotes
%
include newsitem.html
content="Breaking news:
Area man says, "This is newsworthy!""
%
This is not ideal because if there are many quotes then they will all need backslashes, which will be tiresome to add.
4. Use captures
and include
% capture content %% include_relative newscontent.md %% endcapture %
%
include newsitem.html
content=content
%
This is not really ideal because it is also fairly verbose.
5. Use frontmatter and/or YAML
---
newscontent: |
Breaking news:
Area man says, "This is newsworthy!"
---
%
include newsitem.html
content=page.newscontent
%
This is not ideal because it spreads out page content in a weird way.
Now, I absolutely admit these are all really trivial complaints. But mostly in order to gain a better familiarity with Jekyll/liquid, I'd like to know if there's another way to pass multi-line parameters containing quotes to include
. What would be GREAT is if I could use backtics, or some other character that isn't very common in textual content:
%
include newsitem.html
content=`Breaking news:
Area man says, "This is newsworthy!"`
%
Unfortunately this doesn't seem to be supported. What are your thoughts? Thanks!
yaml jekyll liquid
yaml jekyll liquid
asked Mar 21 at 16:30
RobertAKARobinRobertAKARobin
2,0881427
2,0881427
add a comment |
add a comment |
0
active
oldest
votes
Your Answer
StackExchange.ifUsing("editor", function ()
StackExchange.using("externalEditor", function ()
StackExchange.using("snippets", function ()
StackExchange.snippets.init();
);
);
, "code-snippets");
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "1"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55285122%2fhow-to-pass-a-string-containing-quotes-as-an-include-parameter-in-liquid-jekyl%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
0
active
oldest
votes
0
active
oldest
votes
active
oldest
votes
active
oldest
votes
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55285122%2fhow-to-pass-a-string-containing-quotes-as-an-include-parameter-in-liquid-jekyl%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown