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










0















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!










share|improve this question


























    0















    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!










    share|improve this question
























      0












      0








      0


      1






      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!










      share|improve this question














      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






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked Mar 21 at 16:30









      RobertAKARobinRobertAKARobin

      2,0881427




      2,0881427






















          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
          );



          );













          draft saved

          draft discarded


















          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















          draft saved

          draft discarded
















































          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.




          draft saved


          draft discarded














          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





















































          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







          Popular posts from this blog

          Kamusi Yaliyomo Aina za kamusi | Muundo wa kamusi | Faida za kamusi | Dhima ya picha katika kamusi | Marejeo | Tazama pia | Viungo vya nje | UrambazajiKuhusu kamusiGo-SwahiliWiki-KamusiKamusi ya Kiswahili na Kiingerezakuihariri na kuongeza habari

          Swift 4 - func physicsWorld not invoked on collision? The Next CEO of Stack OverflowHow to call Objective-C code from Swift#ifdef replacement in the Swift language@selector() in Swift?#pragma mark in Swift?Swift for loop: for index, element in array?dispatch_after - GCD in Swift?Swift Beta performance: sorting arraysSplit a String into an array in Swift?The use of Swift 3 @objc inference in Swift 4 mode is deprecated?How to optimize UITableViewCell, because my UITableView lags

          Access current req object everywhere in Node.js ExpressWhy are global variables considered bad practice? (node.js)Using req & res across functionsHow do I get the path to the current script with Node.js?What is Node.js' Connect, Express and “middleware”?Node.js w/ express error handling in callbackHow to access the GET parameters after “?” in Express?Modify Node.js req object parametersAccess “app” variable inside of ExpressJS/ConnectJS middleware?Node.js Express app - request objectAngular Http Module considered middleware?Session variables in ExpressJSAdd properties to the req object in expressjs with Typescript