Login  Register

Asciidoctor + Jekyll variables

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options Options
Embed post
Permalink
Reply | Threaded
Open this post in threaded view
| More
Print post
Permalink

Asciidoctor + Jekyll variables

Thibault Duchateau
Hi there,

Does anyone know if it's still possible to use Jekyll variables in a file processed by Asciidoctor?

For example, I have a test.adoc file, in which I'd like to display my site base URL:
---
layout: post
title: Any title
---
=== Some title
And the base URL should be {{ site.baseurl }}

Unfortunately, the {{ site.baseurl }} variable seems to be totally removed from the rendered file.

I'm using:
* Jekyll v2.5.3 + Asciidoctor gem v1.5.2
* the jekyll-asciidoc plugin v1.0.0
* here follows a piece of my _config.yml file:
asciidoctor:
  attributes:
    - icons=font
    - source-highlighter=coderay

Thanks!

Regards,
Thibault.

Reply | Threaded
Open this post in threaded view
| More
Print post
Permalink

Re: Asciidoctor + Jekyll variables

johncarl81
Thibault,

The variable substitution should work as you've described.  For comparison, I have a variety of variables replaced on http://androidtransfuse.org.  Namely the "site.currentVersion" variable:
Declared: https://github.com/johncarl81/transfuse-site/blob/master/_config.yml#L5
Used: https://github.com/johncarl81/transfuse-site/blame/master/index.adoc#L80

which is defined in the front matter of each page: https://github.com/johncarl81/transfuse-site/blame/master/index.adoc#L3

Reviewing your setup, you may need to define the variable baseurl in your _config.yml file.

Hope that works for you.

John

On Sun, May 24, 2015 at 3:25 PM, Thibault Duchateau [via Asciidoctor :: Discussion] <[hidden email]> wrote:
Hi there,

Does anyone know if it's still possible to use Jekyll variables in a file processed by Asciidoctor?

For example, I have a test.adoc file, in which I'd like to display my site base URL:
---
layout: post
title: Any title
---
=== Some title
And the base URL should be {{ site.baseurl }}

Unfortunately, the {{ site.baseurl }} variable seems to be totally removed from the rendered file.

I'm using:
* Jekyll 1.5.2
* the jekyll-asciidoc plugin
* here follows a piece of my _config.yml file:
asciidoctor:
  attributes:
    - icons=font
    - source-highlighter=coderay

Thanks!

Regards,
Thibault.




If you reply to this email, your message will be added to the discussion below:
http://discuss.asciidoctor.org/Asciidoctor-Jekyll-variables-tp3262.html
To start a new topic under Asciidoctor :: Discussion, email [hidden email]
To unsubscribe from Asciidoctor :: Discussion, click here.
NAML

Reply | Threaded
Open this post in threaded view
| More
Print post
Permalink

Re: Asciidoctor + Jekyll variables

Thibault Duchateau
John,

The baseurl variable is my _config.yml file was actually...empty.

I confirm that there is absolutely no problem using Jekyll variables in Asciidoctor documents.

Thanks you for pointing me in the right direction!

Regards,
Thibault.