Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9225821
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T04:40:30+00:00 2026-06-18T04:40:30+00:00

I am using the YAML heading of a markdown file to add an excerpt

  • 0

I am using the YAML heading of a markdown file to add an excerpt variable to blog posts that I can use elsewhere. In one of these excerpts I refer to an earlier blog post via markdown link markup, and I use the liquid template data variable {{ site.url }} in place of the base URL of the site.

So I have something like (trimmed it somewhat)

--- 
title: "Decluttering ordination plots in vegan part 2: orditorp()"
status: publish
layout: post
published: true
tags: 
- tag1
- tag2
excerpt: In the [earlier post in this series]({{ site.url }}/2013/01/12/
decluttering-ordination-plots-in-vegan-part-1-ordilabel/ "Decluttering ordination
plots in vegan part 1: ordilabel()") I looked at the `ordilabel()` function
----

However, jekyll and the Maruku md parser don’t like this, which makes me suspect that you can’t use liquid markup in the YAML header.

Is it possible to use liquid markup in the YAML header of pages handled by jekyll?

  1. If it is, what I am I doing wrong in the example shown?
  2. If it is not allowed, who else can I achieve what I intended? I am currently developing my site on my laptop and don’t want to hard code the base URL as it’ll have to change when I am ready to deploy.

The errors I am getting from Maruku are:

| Maruku tells you:
+---------------------------------------------------------------------------
| Must quote title
| ---------------------------------------------------------------------------
|  the [earlier post in this series]({{ site.url }}/2013/01/12/decluttering-o
| --------------------------------------|-------------------------------------
|                                       +--- Byte 40

and

| Maruku tells you:
+---------------------------------------------------------------------------
| Unclosed link
| ---------------------------------------------------------------------------
| the [earlier post in this series]({{ site.url }}/2013/01/12/decluttering-or
| --------------------------------------|-------------------------------------
|                                       +--- Byte 41

and

| Maruku tells you:
+---------------------------------------------------------------------------
| No closing ): I will not create the link for ["earlier post in this series"]
| ---------------------------------------------------------------------------
| the [earlier post in this series]({{ site.url }}/2013/01/12/decluttering-or
| --------------------------------------|-------------------------------------
|                                       +--- Byte 41
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-18T04:40:32+00:00Added an answer on June 18, 2026 at 4:40 am

    I don’t believe it’s possible to nest liquid variables inside YAML. At least, I haven’t figure out how to do it.

    One approach that will work is to use a Liquid’s replace filter. Specifically, define a string that you want to use for the variable replacement (e.g. !SITE_URL!). Then, use the replace filter to switch that to your desired Jekyll variable (e.g. site.url) during the output. Here’s a cut down .md file that behaves as expected on my jekyll 0.11 install:

    ---
    layout: post
    
    excerpt: In the [earlier post in this series](!SITE_URL!/2013/01/12/)
    
    ---
    
    {{ page.excerpt | replace: '!SITE_URL!', site.url }}
    

    Testing that on my machine, the URL is inserted properly and then translated from markdown into an HTML link as expected. If you have more than one item to replace, you can string multiple replace calls together.

    ---
    layout: post
    
    my_name: Alan W. Smith
    multi_replace_test: 'Name: !PAGE_MY_NAME! - Site: [!SITE_URL!](!SITE_URL!)'
    
    ---
    
    {{ page.multi_replace_test | replace: '!SITE_URL!', site.url | replace: '!PAGE_MY_NAME!', page.my_name }}
    

    An important note is that you must explicitly set the site.url value. You don’t get that for free with Jekyll. You can either set it in your _config.yml file with:

    url: http://alanwsmith.com
    

    Or, define it when you call jekyll:

    jekyll --url http://alanwsmith.com
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Okay, I have the following YAML file that was generated by using yaml_db for
I'm using a config file (in YAML) to define types that are used later
Using OpenCV, saving a CvMat structure into a YAML file on the disk is
using this http://bl.ocks.org/950642 we can see how to add images to nodes, the question
I am using yaml file to store attribute and value. But some of the
I'm trying to use a yaml config file as a very simple flat file
I have a collection of PHP classes that can be instantiated traditionally using constructors.
I'm serialising some object using YAML::dump() . Unfortunately that includes some elements that shouldn't
I have this YAML file: name: Firas dirs: [/bin/, /home/phiras/] I am using YAML::Syck
I am using yaml-cpp in my project, and find out that an anchor name

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.